From dbb388836b7951a3db49deda05a1ff9ba5125c17 Mon Sep 17 00:00:00 2001 From: jeff Date: Thu, 30 Nov 2006 02:27:57 +0000 Subject: prepaid download/upload tracking --- .../FS-SelfService/cgi/myaccount_menu.html | 1 + fs_selfservice/FS-SelfService/cgi/selfservice.cgi | 10 ++++- fs_selfservice/FS-SelfService/cgi/view_usage.html | 49 ++++++++++++++++++++++ 3 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 fs_selfservice/FS-SelfService/cgi/view_usage.html (limited to 'fs_selfservice/FS-SelfService') 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 @@ +MyAccount +MyAccount

+<%= $url = "$selfurl?session=$session_id;action="; ''; %> +<%= include('myaccount_menu') %> + + +Service usage

+ +
+ + + + + + + + + + +<%= 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 .= ''; + } %> + +
AccountTime remainingUpload remainingDownload remainingTotal remaining
'; + $OUT .= $svc->{'label'}. ': '. $svc->{'value'}; + $OUT .= ''; + $OUT .= $svc->{'seconds'}; + $OUT .= ''; + $OUT .= $svc->{'upbytes'}; + $OUT .= ''; + $OUT .= $svc->{'downbytes'}; + $OUT .= ''; + $OUT .= $totalbytes; + $OUT .= '
+
+ +
+ + +
+powered by freeside + -- cgit v1.2.1