release held packages when automatically unsuspending, RT#83847
[freeside.git] / ng_selfservice / services.php
1 <? $title ='My Services'; include('elements/header.php'); ?>
2 <? $current_menu = 'services.php'; include('elements/menu.php'); ?>
3 <?
4
5 $list_pkgs = $freeside->list_pkgs( array(
6   'session_id' => $_COOKIE['session_id'],
7 ) );
8
9 if ( isset($list_pkgs['error']) && $list_pkgs['error'] ) {
10   $error = $list_pkgs['error'];
11   header('Location:index.php?error='. urlencode($error));
12   die();
13 }
14
15 extract($list_pkgs);
16
17 ?>
18 <TABLE BORDER=0 CELLSPACING=2 CELLPADDING=1>
19 <TR>
20   <TH ALIGN="LEFT">&nbsp;</TH>
21   <TH ALIGN="LEFT">Product</TH>
22   <TH ALIGN="LEFT">Status</TH>
23   <TH ALIGN="LEFT" COLSPAN=2>Service(s)</TH>
24   <TH ALIGN="LEFT"></TH>
25 </TR>
26
27 <? foreach ( $cust_pkg AS $pkg ) {
28     if ( $pkg['status'] == 'one-time charge' ) { continue; }
29     //$link = '<A HREF="ticket.php?'. $ticket['id']. '">';
30     $rowspan = count($pkg['cust_svc']);
31     if ( $rowspan == 0 ) { $rowspan = 1; }
32     $td = '<TD ALIGN="LEFT" VALIGN="top" ROWSPAN="'. $rowspan. '">';
33
34     $change_link = '';
35     if ( in_array("Change packages", $menu_disable) == 0) {
36       $change_link = '<a href="packages_change.php?pkgnum=' . $pkg['pkgnum'] . '">[change]</a>';
37     }
38 ?>
39   <TR>
40     <TD COLSPAN=4 STYLE="border-top:1px solid #999999"></TD>
41   </TR>
42   <TR>
43     <? echo $td ?><? echo $change_link ?>&nbsp;&nbsp;</TD>
44     <? echo $td ?><? echo htmlspecialchars($pkg['pkg_label']); ?></TD>
45     <? echo $td ?>
46       <FONT COLOR="#<? echo $pkg['statuscolor'] ?>"><B>
47         <? echo ucfirst($pkg['status']); ?>
48       </B></FONT>
49       <? if ( $pkg['status'] == 'active' && $pkg['bill'] ) { ?>
50         - renews on <? echo date('M jS Y', $pkg['bill']); ?>
51       <? } ?>
52     </TD>
53     <? $subsequent = 0;
54        foreach ( $pkg['cust_svc'] AS $svc ) {
55          $label  = $svc['label'][0];
56          $value  = $svc['label'][1];
57          $table  = $svc['label'][2];
58          $svcnum = $svc['label'][3];
59     ?>
60        <? if ( $subsequent++ ) { echo '<TR>'; } ?>
61          <TD ALIGN="right"><? echo $label ?>: </TD>
62          <TD><? echo $value ?></TD>
63        </TR>
64     <? } ?>
65 <? } ?>
66
67 </TABLE>
68 <BR>
69
70 <!-- <A HREF="services_new.php">Order a new service</A> -->
71 <FORM ACTION="services_new.php">
72 <INPUT TYPE="submit" VALUE="Order a new service">
73 </FORM>
74
75 <? include('elements/menu_footer.php'); ?>
76 <? include('elements/footer.php'); ?>