blob: 739fb517f206ca78847e47b9ea9497e78a5dd48a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
<!-- $Id: expire_pkg.cgi,v 1.3 2002-01-30 14:18:09 ivan Exp $ -->
<%
#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 $pkgnum = $1;
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;
print $cgi->redirect(popurl(2). "view/cust_main.cgi?".$cust_pkg->getfield('custnum'));
%>
|