fix for correct radacct column names
[freeside.git] / httemplate / edit / REAL_cust_pkg.cgi
1 <!-- mason kludge -->
2 <%
3 # <!-- $Id: REAL_cust_pkg.cgi,v 1.4 2002-07-08 13:07:40 ivan Exp $ -->
4
5 my $error ='';
6 my $pkgnum = '';
7 if ( $cgi->param('error') ) {
8   $error = $cgi->param('error');
9   $pkgnum = $cgi->param('pkgnum');
10 } else {
11   my($query) = $cgi->keywords;
12   $query =~ /^(\d+)$/ or die "no pkgnum";
13   $pkgnum = $1;
14 }
15
16 #get package record
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')});
20
21 if ( $error ) {
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')));
25 }
26
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)
31 #));
32
33 #print info
34 my($susp,$cancel,$expire)=(
35   $cust_pkg->getfield('susp'),
36   $cust_pkg->getfield('cancel'),
37   $cust_pkg->getfield('expire'),
38 );
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');
42
43 print '<FORM NAME="formname" ACTION="process/REAL_cust_pkg.cgi" METHOD="POST">',      qq!<INPUT TYPE="hidden" NAME="pkgnum" VALUE="$pkgnum">!;
44
45 print qq!<FONT SIZE="+1" COLOR="#ff0000">Error: $error</FONT>!
46   if $error;
47
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">',
52       $pkg,  '</TD></TR>',
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>',
63 ;
64
65 print '<TR><TD ALIGN="right">Suspension date</TD><TD BGCOLOR="#ffffff">',
66        time2str("%D",$susp), '</TD></TR>'
67   if $susp;
68
69 #print '<TR><TD ALIGN="right">Expiration date</TD><TD BGCOLOR="#ffffff">',
70 #       time2str("%D",$expire), '</TD></TR>'
71 #  if $expire;
72 print '<TR><TD ALIGN="right">Expiration date'.
73       '</TD><TD>',
74       '<INPUT TYPE="text" NAME="expire" SIZE=32 VALUE="',
75       ( $expire ? time2str("%c %z (%Z)",$expire) : "" ), '">'.
76       '<BR><FONT SIZE=-1>(will <b>cancel</b> this package'.
77       ' when the date is reached)</FONT>'.
78       '</TD></TR>';
79
80 print '<TR><TD ALIGN="right">Cancellation date</TD><TD BGCOLOR="#ffffff">',
81        time2str("%D",$cancel), '</TD></TR>'
82   if $cancel;
83
84 %>
85 </TABLE>
86 <BR><INPUT TYPE="submit" VALUE="Apply Changes">
87 </FORM>
88 </BODY>
89 </HTML>