retouch bandwidth countdown
[freeside.git] / fs_selfservice / FS-SelfService / cgi / view_usage.html
index 40aec7b..73ad1e4 100644 (file)
@@ -6,8 +6,9 @@
 
 <FONT SIZE=4>Service usage</FONT><BR><BR>
 
-<FORM ACTION="<%= $selfurl %>" METHOD="POST">
-<INPUT TYPE="hidden" NAME="session" VALUE="<%= $session_id %>">
+<%= if ( $error ) {
+  $OUT .= qq!<FONT SIZE="+1" COLOR="#ff0000">$error</FONT><BR><BR>!;
+} ''; %>
 
 <TABLE BGCOLOR="#cccccc">
   <TR>
     <TH ALIGN="right">Total remaining</TH>
   </TR>
 <%= foreach my $svc ( @svcs ) {
-    my $totalbytes = '';
-    if ( ($svc->{'upbytes'}   + 0) eq $svc->{'upbytes'}
-      || ($svc->{'downbytes'} + 0) eq $svc->{'downbytes'} ) {
-
-      $totalbytes = $svc->{'upbytes'} + $svc->{'downbytes'};
-    }
-
   $OUT .= '<TR><TD>';
     $OUT .= $svc->{'label'}. ': '. $svc->{'value'};
     $OUT .= '</TD><TD ALIGN="right">';
     $OUT .= '</TD><TD ALIGN="right">';
     $OUT .= $svc->{'downbytes'};
     $OUT .= '</TD><TD ALIGN="right">';
-    $OUT .= $totalbytes;
+    $OUT .= $svc->{'totalbytes'};
   $OUT .= '</TD></TR>';
+    if ( $svc->{'recharge_amount'} ) {
+      my $link = "${url}process_order_recharge;".
+                 "svcnum=$svc->{'svcnum'}";
+    $OUT .= '<TR><TD ALIGN="right">';
+      $OUT .= qq!<A HREF="$link">!.'Recharge for $';
+      $OUT .= $svc->{'recharge_amount'} . '</A> with';
+      $OUT .= '</TD><TD ALIGN="right">';
+      $OUT .= $svc->{'recharge_seconds'} if $svc->{'recharge_seconds'};
+      $OUT .= '</TD><TD ALIGN="right">';
+      $OUT .=  $svc->{'recharge_upbytes'} if $svc->{'recharge_upbytes'};
+      $OUT .= '</TD><TD ALIGN="right">';
+      $OUT .= $svc->{'recharge_downbytes'} if $svc->{'recharge_downbytes'};
+      $OUT .= '</TD><TD ALIGN="right">';
+      $OUT .= $svc->{'recharge_totalbytes'} if $svc->{'recharge_totalbytes'};
+    $OUT .= '</TD></TR>';
+    }
   } %>
 
 </TABLE>
 <BR>
 
-</FORM>
-
 </TD></TR></TABLE>
 <HR>
 <FONT SIZE="-2">powered by <a href="http://www.sisd.com/freeside">freeside</a></FONT>