3 # <!-- $Id: REAL_cust_pkg.cgi,v 1.5 2003-04-01 01:22:24 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",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>';
61 print '<TR><TD ALIGN="right">Last bill date</TD><TD>',
62 '<INPUT TYPE="text" NAME="last_bill" SIZE=32 VALUE="',
63 ( $cust_pkg->last_bill
64 ? time2str("%c %z (%Z)", $cust_pkg->last_bill)
67 if $cust_pkg->dbdef_table->column('last_bill');
69 print '<TR><TD ALIGN="right">Next bill date</TD><TD>',
70 '<INPUT TYPE="text" NAME="bill" SIZE=32 VALUE="',
71 ( $bill ? time2str("%c %z (%Z)",$bill) : "" ), '"></TD></TR>';
73 print '<TR><TD ALIGN="right">Suspension date</TD><TD BGCOLOR="#ffffff">',
74 time2str("%D",$susp), '</TD></TR>'
77 #print '<TR><TD ALIGN="right">Expiration date</TD><TD BGCOLOR="#ffffff">',
78 # time2str("%D",$expire), '</TD></TR>'
80 print '<TR><TD ALIGN="right">Expiration date'.
82 '<INPUT TYPE="text" NAME="expire" SIZE=32 VALUE="',
83 ( $expire ? time2str("%c %z (%Z)",$expire) : "" ), '">'.
84 '<BR><FONT SIZE=-1>(will <b>cancel</b> this package'.
85 ' when the date is reached)</FONT>'.
88 print '<TR><TD ALIGN="right">Cancellation date</TD><TD BGCOLOR="#ffffff">',
89 time2str("%D",$cancel), '</TD></TR>'
94 <BR><INPUT TYPE="submit" VALUE="Apply Changes">