1 %# if ( $link eq 'popup' ) {
2 <% include('/elements/header-popup.html', $title ) %>
4 %# <% include("/elements/header.html", $title, '') %>
7 <LINK REL="stylesheet" TYPE="text/css" HREF="../elements/calendar-win2k-2.css" TITLE="win2k-2">
8 <SCRIPT TYPE="text/javascript" SRC="../elements/calendar_stripped.js"></SCRIPT>
9 <SCRIPT TYPE="text/javascript" SRC="../elements/calendar-en.js"></SCRIPT>
10 <SCRIPT TYPE="text/javascript" SRC="../elements/calendar-setup.js"></SCRIPT>
12 % if ( $cgi->param('error') ) {
13 <FONT SIZE="+1" COLOR="#ff0000">Error: <% $cgi->param('error') %></FONT>
17 <FORM NAME="sc_popup" ACTION="<% popurl(1) %>process/cancel_pkg.html" METHOD=POST>
18 <INPUT TYPE="hidden" NAME="pkgnum" VALUE="<% $pkgnum %>">
19 <INPUT TYPE="hidden" NAME="method" VALUE="<% $method %>">
23 <% ucfirst($method) . " $pkgnum: " .$part_pkg->pkg. ' - ' .$part_pkg->comment %>
24 <% ntable("#cccccc", 2) %>
26 % if ($method eq 'expire') {
28 <TD>Cancel package on </TD>
29 <TD><INPUT TYPE="text" NAME="date" ID="expire_date" VALUE="<% $date %>">
30 <IMG SRC="<% $p %>images/calendar.png" ID="expire_button" STYLE="cursor:pointer" TITLE="Select date">
34 <SCRIPT TYPE="text/javascript">
36 inputField: "expire_date",
38 button: "expire_button",
45 <% include('/elements/tr-select-reason.html', 'reasonnum', $class, '', '', '', 'document.sc_popup.submit' ) %>
50 <INPUT TYPE="submit" NAME="submit" VALUE="<% $submit %>" disabled='true'>
57 my($method, $pkgnum, $reasonnum, $submit, $cust_pkg, $part_pkg,
58 $date, $curuser, $class);
59 $date = time2str("%m/%d/%Y", time);
60 if ( $cgi->param('error') ) {
61 $method = $cgi->param('method');
62 $pkgnum = $cgi->param('pkgnum');
63 $reasonnum = $cgi->param('reasonnum');
64 $date = $cgi->param('date');
65 } elsif ( $cgi->param('pkgnum') =~ /^(\d+)$/ ) {
68 die "illegal query ". $cgi->keywords;
71 $method = $cgi->param('method');
72 if ($method eq 'cancel') {
74 $submit = "Cancel Now";
75 }elsif ($method eq 'expire') {
77 $submit = "Cancel Later";
78 }elsif ($method eq 'suspend') {
82 die "illegal query ". $cgi->keywords;
85 my $title = ucfirst($method) . ' Package';
87 $cust_pkg = qsearchs('cust_pkg', {'pkgnum' => $pkgnum});
88 die "No such package: $pkgnum" unless $cust_pkg;
90 $part_pkg = $cust_pkg->part_pkg;
92 $curuser = $FS::CurrentUser::CurrentUser;