remove
[freeside.git] / httemplate / misc / expire_pkg.cgi
1 <!-- $Id: expire_pkg.cgi,v 1.3 2002-01-30 14:18:09 ivan Exp $ -->
2 <%
3
4 #untaint date & pkgnum
5
6 my $date;
7 if ( $cgi->param('date') ) {
8   str2time($cgi->param('date')) =~ /^(\d+)$/ or die "Illegal date";
9   $date=$1;
10 } else {
11   $date='';
12 }
13
14 $cgi->param('pkgnum') =~ /^(\d+)$/ or die "Illegal pkgnum";
15 my $pkgnum = $1;
16
17 my $cust_pkg = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum});
18 my %hash = $cust_pkg->hash;
19 $hash{expire}=$date;
20 my $new = new FS::cust_pkg ( \%hash );
21 my $error = $new->replace($cust_pkg);
22 &eidiot($error) if $error;
23
24 print $cgi->redirect(popurl(2). "view/cust_main.cgi?".$cust_pkg->getfield('custnum'));
25
26 %>