3 # <!-- $Id: REAL_cust_pkg.cgi,v 1.3 2002-04-23 07:32:49 ivan Exp $ -->
7 if ( $cgi->param('error') ) {
8 $error = $cgi->param('error');
9 $pkgnum = $cgi->param('pkgnum');
11 my($query) = $cgi->keywords;
12 $query =~ /^(\d+)$/ or die "no pkgnum";
17 my $cust_pkg = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum});
18 die "No package!" unless $cust_pkg;
19 my $part_pkg = qsearchs('part_pkg',{'pkgpart'=>$cust_pkg->getfield('pkgpart')});
22 #$cust_pkg->$_(str2time($cgi->param($_)) foreach qw(setup bill);
23 $cust_pkg->setup(str2time($cgi->param('setup')));
24 $cust_pkg->bill(str2time($cgi->param('bill')));
27 #my $custnum = $cust_pkg->getfield('custnum');
28 print header('Package Edit'); #, menubar(
29 # "View this customer (#$custnum)" => popurl(2). "view/cust_main.cgi?$custnum",
30 # 'Main Menu' => popurl(2)
34 my($susp,$cancel,$expire)=(
35 $cust_pkg->getfield('susp'),
36 $cust_pkg->getfield('cancel'),
37 $cust_pkg->getfield('expire'),
39 my($pkg,$comment)=($part_pkg->getfield('pkg'),$part_pkg->getfield('comment'));
40 my($setup,$bill)=($cust_pkg->getfield('setup'),$cust_pkg->getfield('bill'));
41 my $otaker = $cust_pkg->getfield('otaker');
43 print '<FORM NAME="formname" ACTION="process/REAL_cust_pkg.cgi" METHOD="POST">', qq!<INPUT TYPE="hidden" NAME="pkgnum" VALUE="$pkgnum">!;
45 print qq!<FONT SIZE="+1" COLOR="#ff0000">Error: $error</FONT>!
48 print &ntable("#cccccc"), '<TR><TD>', &ntable("#cccccc",2),
49 '<TR><TD ALIGN="right">Package number</TD><TD BGCOLOR="#ffffff">',
50 $pkgnum, '</TD></TR>',
51 '<TR><TD ALIGN="right">Package</TD><TD BGCOLOR="#ffffff">',
53 '<TR><TD ALIGN="right">Comment</TD><TD BGCOLOR="#ffffff">',
54 $comment, '</TD></TR>',
55 '<TR><TD ALIGN="right">Order taker</TD><TD BGCOLOR="#ffffff">',
56 $otaker, '</TD></TR>',
57 '<TR><TD ALIGN="right">Setup date</TD><TD>'.
58 '<INPUT TYPE="text" NAME="setup" SIZE=32 VALUE="',
59 ( $setup ? time2str("%c %z (%Z)",$setup) : "" ), '"></TD></TR>',
60 '<TR><TD ALIGN="right">Next bill date</TD><TD>',
61 '<INPUT TYPE="text" NAME="bill" SIZE=32 VALUE="',
62 ( $bill ? time2str("%c %z (%Z)",$bill) : "" ), '"></TD></TR>',
65 print '<TR><TD ALIGN="right">Suspension date</TD><TD BGCOLOR="#ffffff">',
66 time2str("%D",$susp), '</TD></TR>'
69 print '<TR><TD ALIGN="right">Expiration date</TD><TD BGCOLOR="#ffffff">',
70 time2str("%D",$expire), '</TD></TR>'
73 print '<TR><TD ALIGN="right">Cancellation date</TD><TD BGCOLOR="#ffffff">',
74 time2str("%D",$cancel), '</TD></TR>'
78 </TABLE></TD></TR></TABLE>
79 <BR><INPUT TYPE="submit" VALUE="Apply Changes">