X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fmisc%2Fexpire_pkg.cgi;h=b59674a69603673b9c34d89d3cbae6b278afa689;hp=9e4ce8b620976a6ae26796d1c2a3436f6497d71d;hb=351b0af13ba6c449151c1bec2303294051c073d1;hpb=5a5242465520ef7a64a715496c31a3c17c95cc57 diff --git a/httemplate/misc/expire_pkg.cgi b/httemplate/misc/expire_pkg.cgi index 9e4ce8b62..b59674a69 100755 --- a/httemplate/misc/expire_pkg.cgi +++ b/httemplate/misc/expire_pkg.cgi @@ -1,25 +1,55 @@ + <% -#untaint date & pkgnum - -my $date; -if ( $cgi->param('date') ) { - str2time($cgi->param('date')) =~ /^(\d+)$/ or die "Illegal date"; - $date=$1; -} else { - $date=''; -} - -$cgi->param('pkgnum') =~ /^(\d+)$/ or die "Illegal pkgnum"; +my($query) = $cgi->keywords; +$query =~ /^(\d+)$/; my $pkgnum = $1; +#get package record my $cust_pkg = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum}); -my %hash = $cust_pkg->hash; -$hash{expire}=$date; -my $new = new FS::cust_pkg ( \%hash ); -my $error = $new->replace($cust_pkg); -&eidiot($error) if $error; +die "Unknown pkgnum $pkgnum" unless $cust_pkg; +my $part_pkg = $cust_pkg->part_pkg; + +my $custnum = $cust_pkg->getfield('custnum'); -print $cgi->redirect(popurl(2). "view/cust_main.cgi?".$cust_pkg->getfield('custnum')); +my $date = $cust_pkg->expire ? time2str('%D', $cust_pkg->expire) : ''; %> + +<%= header('Expire package', menubar( + "View this customer (#$custnum)" => "${p}view/cust_main.cgi?$custnum", + 'Main Menu' => popurl(2) +)) %> + + + + + + +<%= $pkgnum %>: <%= $part_pkg->pkg. ' - '. $part_pkg->comment %> + +
+ + + + + + +
Cancel package on + +
m/d/y +
+ + + + +
+ +