NG selfservice webpay interface, #23579
[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">Product</TH>
21   <TH ALIGN="LEFT">Status</TH>
22   <TH ALIGN="LEFT" COLSPAN=2>Service(s)</TH>
23   <TH ALIGN="LEFT"></TH>
24 </TR>
25
26 <? foreach ( $cust_pkg AS $pkg ) {
27     if ( $pkg['status'] == 'one-time charge' ) { continue; }
28     //$link = '<A HREF="ticket.php?'. $ticket['id']. '">';
29     $rowspan = count($pkg['cust_svc']);
30     if ( $rowspan == 0 ) { $rowspan = 1; }
31     $td = '<TD ALIGN="LEFT" VALIGN="top" ROWSPAN="'. $rowspan. '">';
32 ?>
33   <TR>
34     <TD COLSPAN=4 STYLE="border-top:1px solid #999999"></TD>
35   </TR>
36   <TR>
37     <? echo $td ?><? echo $pkg['pkg_label']; ?></TD>
38     <? echo $td ?>
39       <FONT COLOR="#<? echo $pkg['statuscolor'] ?>"><B>
40         <? echo ucfirst($pkg['status']); ?>
41       </B></FONT>
42       <? if ( $pkg['status'] == 'active' && $pkg['bill'] ) { ?>
43         - renews on <? echo date('M jS Y', $pkg['bill']); ?>
44       <? } ?>
45     </TD>
46     <? $subsequent = 0;
47        foreach ( $pkg['cust_svc'] AS $svc ) {
48          $label  = $svc['label'][0];
49          $value  = $svc['label'][1];
50          $table  = $svc['label'][2];
51          $svcnum = $svc['label'][3];
52     ?>
53        <? if ( $subsequent++ ) { echo '<TR>'; } ?>
54          <TD ALIGN="right"><? echo $label ?>: </TD>
55          <TD><? echo $value ?></TD>
56        </TR>
57     <? } ?>
58 <? } ?>
59
60 </TABLE>
61 <BR>
62
63 <!-- <A HREF="services_new.php">Order a new service</A> -->
64 <FORM ACTION="services_new.php">
65 <INPUT TYPE="submit" VALUE="Order a new service">
66 </FORM>
67
68 <? include('elements/menu_footer.php'); ?>
69 <? include('elements/footer.php'); ?>