2 # <!-- $Id: REAL_cust_pkg.cgi,v 1.1 2001-10-15 14:58:03 ivan Exp $ -->
6 if ( $cgi->param('error') ) {
7 $error = $cgi->param('error');
8 $pkgnum = $cgi->param('pkgnum');
10 my($query) = $cgi->keywords;
11 $query =~ /^(\d+)$/ or die "no pkgnum";
16 my $cust_pkg = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum});
17 die "No package!" unless $cust_pkg;
18 my $part_pkg = qsearchs('part_pkg',{'pkgpart'=>$cust_pkg->getfield('pkgpart')});
21 #$cust_pkg->$_(str2time($cgi->param($_)) foreach qw(setup bill);
22 $cust_pkg->setup(str2time($cgi->param('setup')));
23 $cust_pkg->bill(str2time($cgi->param('bill')));
26 #my $custnum = $cust_pkg->getfield('custnum');
27 print header('Package Edit'); #, menubar(
28 # "View this customer (#$custnum)" => popurl(2). "view/cust_main.cgi?$custnum",
29 # 'Main Menu' => popurl(2)
33 my($susp,$cancel,$expire)=(
34 $cust_pkg->getfield('susp'),
35 $cust_pkg->getfield('cancel'),
36 $cust_pkg->getfield('expire'),
38 my($pkg,$comment)=($part_pkg->getfield('pkg'),$part_pkg->getfield('comment'));
39 my($setup,$bill)=($cust_pkg->getfield('setup'),$cust_pkg->getfield('bill'));
40 my $otaker = $cust_pkg->getfield('otaker');
42 print '<FORM NAME="formname" ACTION="process/REAL_cust_pkg.cgi" METHOD="POST">', qq!<INPUT TYPE="hidden" NAME="pkgnum" VALUE="$pkgnum">!;
44 print qq!<FONT SIZE="+1" COLOR="#ff0000">Error: $error</FONT>!
47 print &ntable("#cccccc"), '<TR><TD>', &ntable("#cccccc",2),
48 '<TR><TD ALIGN="right">Package number</TD><TD BGCOLOR="#ffffff">',
49 $pkgnum, '</TD></TR>',
50 '<TR><TD ALIGN="right">Package</TD><TD BGCOLOR="#ffffff">',
52 '<TR><TD ALIGN="right">Comment</TD><TD BGCOLOR="#ffffff">',
53 $comment, '</TD></TR>',
54 '<TR><TD ALIGN="right">Order taker</TD><TD BGCOLOR="#ffffff">',
55 $otaker, '</TD></TR>',
56 '<TR><TD ALIGN="right">Setup date</TD><TD>'.
57 '<INPUT TYPE="text" NAME="setup" SIZE=32 VALUE="',
58 ( $setup ? time2str("%c %z (%Z)",$setup) : "" ), '"></TD></TR>',
59 '<TR><TD ALIGN="right">Next bill date</TD><TD>',
60 '<INPUT TYPE="text" NAME="bill" SIZE=32 VALUE="',
61 ( $bill ? time2str("%c %z (%Z)",$bill) : "" ), '"></TD></TR>',
64 print '<TR><TD ALIGN="right">Suspension date</TD><TD BGCOLOR="#ffffff">',
65 time2str("%D",$susp), '</TD></TR>'
68 print '<TR><TD ALIGN="right">Expiration date</TD><TD BGCOLOR="#ffffff">',
69 time2str("%D",$expire), '</TD></TR>'
72 print '<TR><TD ALIGN="right">Cancellation date</TD><TD BGCOLOR="#ffffff">',
73 time2str("%D",$cancel), '</TD></TR>'
77 </TABLE></TD></TR></TABLE>'.
78 <BR><INPUT TYPE="submit" VALUE="Apply Changes">