summaryrefslogtreecommitdiff
path: root/fs_selfservice/FS-SelfService
diff options
context:
space:
mode:
authorjeff <jeff>2006-11-30 02:27:57 +0000
committerjeff <jeff>2006-11-30 02:27:57 +0000
commitdbb388836b7951a3db49deda05a1ff9ba5125c17 (patch)
treee0c27eb8e84c416a9a833c21977d587983c7ef9e /fs_selfservice/FS-SelfService
parent12c852be6d4cabcc89fd9db901a6b315efbc1e97 (diff)
prepaid download/upload tracking
Diffstat (limited to 'fs_selfservice/FS-SelfService')
-rw-r--r--fs_selfservice/FS-SelfService/cgi/myaccount_menu.html1
-rw-r--r--fs_selfservice/FS-SelfService/cgi/selfservice.cgi10
-rw-r--r--fs_selfservice/FS-SelfService/cgi/view_usage.html49
3 files changed, 59 insertions, 1 deletions
diff --git a/fs_selfservice/FS-SelfService/cgi/myaccount_menu.html b/fs_selfservice/FS-SelfService/cgi/myaccount_menu.html
index aa24f5d8f..92f3e1575 100644
--- a/fs_selfservice/FS-SelfService/cgi/myaccount_menu.html
+++ b/fs_selfservice/FS-SelfService/cgi/myaccount_menu.html
@@ -31,6 +31,7 @@ push @menu, (
{ title=>' ' },
+{ title=>'View my usage', url=>'view_usage', size=>'+1', },
{ title=>'Setup my services', url=>'provision', size=>'+1', },
{ title=>' ' },
diff --git a/fs_selfservice/FS-SelfService/cgi/selfservice.cgi b/fs_selfservice/FS-SelfService/cgi/selfservice.cgi
index 0f8979cd8..1a2c74a64 100644
--- a/fs_selfservice/FS-SelfService/cgi/selfservice.cgi
+++ b/fs_selfservice/FS-SelfService/cgi/selfservice.cgi
@@ -65,7 +65,7 @@ $session_id = $cgi->param('session');
#order|pw_list XXX ???
$cgi->param('action') =~
- /^(myaccount|view_invoice|make_payment|payment_results|recharge_prepay|recharge_results|logout|change_bill|change_ship|customer_order_pkg|process_order_pkg|provision|provision_svc|process_svc_acct|process_svc_external|delete_svc|change_password|process_change_password)$/
+ /^(myaccount|view_invoice|make_payment|payment_results|recharge_prepay|recharge_results|logout|change_bill|change_ship|customer_order_pkg|process_order_pkg|provision|provision_svc|process_svc_acct|process_svc_external|delete_svc|view_usage||change_password|process_change_password)$/
or die "unknown action ". $cgi->param('action');
my $action = $1;
@@ -321,6 +321,14 @@ sub delete_svc {
);
}
+sub view_usage {
+ list_svcs(
+ 'session_id' => $session_id,
+ 'svcdb' => 'svc_acct',
+ 'ncancelled' => 1,
+ );
+}
+
sub change_password {
list_svcs(
'session_id' => $session_id,
diff --git a/fs_selfservice/FS-SelfService/cgi/view_usage.html b/fs_selfservice/FS-SelfService/cgi/view_usage.html
new file mode 100644
index 000000000..40aec7bcf
--- /dev/null
+++ b/fs_selfservice/FS-SelfService/cgi/view_usage.html
@@ -0,0 +1,49 @@
+<HTML><HEAD><TITLE>MyAccount</TITLE></HEAD>
+<BODY BGCOLOR="#eeeeee"><FONT SIZE=5>MyAccount</FONT><BR><BR>
+<%= $url = "$selfurl?session=$session_id;action="; ''; %>
+<%= include('myaccount_menu') %>
+<TD VALIGN="top">
+
+<FONT SIZE=4>Service usage</FONT><BR><BR>
+
+<FORM ACTION="<%= $selfurl %>" METHOD="POST">
+<INPUT TYPE="hidden" NAME="session" VALUE="<%= $session_id %>">
+
+<TABLE BGCOLOR="#cccccc">
+ <TR>
+ <TH ALIGN="left">Account</TH>
+ <TH ALIGN="right">Time remaining</TH>
+ <TH ALIGN="right">Upload remaining</TH>
+ <TH ALIGN="right">Download remaining</TH>
+ <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 .= $svc->{'seconds'};
+ $OUT .= '</TD><TD ALIGN="right">';
+ $OUT .= $svc->{'upbytes'};
+ $OUT .= '</TD><TD ALIGN="right">';
+ $OUT .= $svc->{'downbytes'};
+ $OUT .= '</TD><TD ALIGN="right">';
+ $OUT .= $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>
+</BODY></HTML>