summaryrefslogtreecommitdiff
path: root/httemplate/misc/unprovision.cgi
blob: 8f2a7d13da0c009bac797bc0881e90e2cc6867f4 (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
27
28
29
30
31
32
33
<%

my $dbh = dbh;
 
#untaint svcnum
my($query) = $cgi->keywords;
$query =~ /^(\d+)$/;
my $svcnum = $1;

#my $svc_acct = qsearchs('svc_acct',{'svcnum'=>$svcnum});
#die "Unknown svcnum!" unless $svc_acct;

my $cust_svc = qsearchs('cust_svc',{'svcnum'=>$svcnum});
die "Unknown svcnum!" unless $cust_svc;
#&eidiot(qq!This account has already been audited.  Cancel the 
#    <A HREF="!. popurl(2). qq!view/cust_pkg.cgi?! . $cust_svc->getfield('pkgnum') .
#    qq!pkgnum"> package</A> instead.!) 
#  if $cust_svc->pkgnum ne '' && $cust_svc->pkgnum ne '0';

my $custnum = $cust_svc->cust_pkg->custnum;

my $error = $cust_svc->cancel;

if ( $error ) {
  %>
<!-- mason kludge -->
<%
  &eidiot($error);
} else {
  print $cgi->redirect(popurl(2)."view/cust_main.cgi?$custnum");
}

%>