diff options
Diffstat (limited to 'httemplate/edit/prepay_credit.cgi')
-rw-r--r-- | httemplate/edit/prepay_credit.cgi | 75 |
1 files changed, 40 insertions, 35 deletions
diff --git a/httemplate/edit/prepay_credit.cgi b/httemplate/edit/prepay_credit.cgi index c32c04d16..9e1c30ba6 100644 --- a/httemplate/edit/prepay_credit.cgi +++ b/httemplate/edit/prepay_credit.cgi @@ -1,38 +1,11 @@ -% -%my $agent = ''; -%my $agentnum = ''; -%if ( $cgi->param('agentnum') =~ /^(\d+)$/ ) { -% $agent = qsearchs('agent', { 'agentnum' => $agentnum=$1 } ); -%} -% -%tie my %multiplier, 'Tie::IxHash', -% 1 => 'seconds', -% 60 => 'minutes', -% 3600 => 'hours', -%; -% -%tie my %bytemultiplier, 'Tie::IxHash', -% 1 => 'bytes', -% 1000 => 'Kbytes', -% 1000000 => 'Mbytes', -% 1000000000 => 'Gbytes', -%; -% -%$cgi->param('multiplier', '60') unless $cgi->param('multiplier'); -%$cgi->param('upmultiplier', '1000000') unless $cgi->param('upmultiplier'); -%$cgi->param('downmultiplier', '1000000') unless $cgi->param('downmultiplier'); -%$cgi->param('totalmultiplier','1000000') unless $cgi->param('totalmultiplier'); - -<% include("/elements/header.html",'Generate prepaid cards'. ($agent ? ' for '. $agent->agent : ''), - menubar( 'Main Menu' => $p, )) -%> +<% include("/elements/header.html",'Generate prepaid cards'. ($agent ? ' for '. $agent->agent : '') ) %> <% include('/elements/error.html') %> <FORM ACTION="<%popurl(1)%>process/prepay_credit.cgi" METHOD="POST" NAME="OneTrueForm" onSubmit="document.OneTrueForm.submit.disabled=true"> Generate -<INPUT TYPE="text" NAME="num" VALUE="<% $cgi->param('num') || '(quantity)' %>" SIZE=10 MAXLENGTH=10 onFocus="if ( this.value == '(quantity)' ) { this.value = ''; }"> +<INPUT TYPE="text" NAME="num" VALUE="<% $cgi->param('num') || '(quantity)' |h %>" SIZE=10 MAXLENGTH=10 onFocus="if ( this.value == '(quantity)' ) { this.value = ''; }"> <SELECT NAME="type"> % foreach (qw(alpha alphanumeric numeric)) { @@ -52,10 +25,10 @@ prepaid cards <TABLE> <TR><TD>Value: -$<INPUT TYPE="text" NAME="amount" SIZE=8 MAXLENGTH=7 VALUE="<% $cgi->param('amount') %>"> +$<INPUT TYPE="text" NAME="amount" SIZE=8 MAXLENGTH=7 VALUE="<% $cgi->param('amount') |h %>"> </TD> <TD>and/or -<INPUT TYPE="text" NAME="seconds" SIZE=6 MAXLENGTH=5 VALUE="<% $cgi->param('seconds') %>"> +<INPUT TYPE="text" NAME="seconds" SIZE=6 MAXLENGTH=5 VALUE="<% $cgi->param('seconds') |h %>"> <SELECT NAME="multiplier"> % foreach my $multiplier ( keys %multiplier ) { @@ -66,7 +39,7 @@ $<INPUT TYPE="text" NAME="amount" SIZE=8 MAXLENGTH=7 VALUE="<% $cgi->param('amou </TD></TR> <TR><TD></TD> <TD>and/or -<INPUT TYPE="text" NAME="upbytes" SIZE=6 MAXLENGTH=5 VALUE="<% $cgi->param('upbytes') %>"> +<INPUT TYPE="text" NAME="upbytes" SIZE=6 MAXLENGTH=5 VALUE="<% $cgi->param('upbytes') |h %>"> <SELECT NAME="upmultiplier"> % foreach my $multiplier ( keys %bytemultiplier ) { @@ -77,7 +50,7 @@ $<INPUT TYPE="text" NAME="amount" SIZE=8 MAXLENGTH=7 VALUE="<% $cgi->param('amou </TD></TR> <TR><TD></TD> <TD>and/or -<INPUT TYPE="text" NAME="downbytes" SIZE=6 MAXLENGTH=5 VALUE="<% $cgi->param('downbytes') %>"> +<INPUT TYPE="text" NAME="downbytes" SIZE=6 MAXLENGTH=5 VALUE="<% $cgi->param('downbytes') |h %>"> <SELECT NAME="downmultiplier"> % foreach my $multiplier ( keys %bytemultiplier ) { @@ -88,7 +61,7 @@ $<INPUT TYPE="text" NAME="amount" SIZE=8 MAXLENGTH=7 VALUE="<% $cgi->param('amou </TD></TR> <TR><TD></TD> <TD>and/or -<INPUT TYPE="text" NAME="totalbytes" SIZE=6 MAXLENGTH=5 VALUE="<% $cgi->param('totalbytes') %>"> +<INPUT TYPE="text" NAME="totalbytes" SIZE=6 MAXLENGTH=5 VALUE="<% $cgi->param('totalbytes') |h %>"> <SELECT NAME="totalmultiplier"> % foreach my $multiplier ( keys %bytemultiplier ) { @@ -101,5 +74,37 @@ $<INPUT TYPE="text" NAME="amount" SIZE=8 MAXLENGTH=7 VALUE="<% $cgi->param('amou <BR><BR> <INPUT TYPE="submit" NAME="submit" VALUE="Generate" onSubmit="this.disabled = true"> -</FORM></BODY></HTML> +</FORM> +<% include('/elements/footer.html') %> + +<%init> + +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('Configuration'); + +my $agent = ''; +my $agentnum = ''; +if ( $cgi->param('agentnum') =~ /^(\d+)$/ ) { + $agent = qsearchs('agent', { 'agentnum' => $agentnum=$1 } ); +} + +tie my %multiplier, 'Tie::IxHash', + 1 => 'seconds', + 60 => 'minutes', + 3600 => 'hours', +; + +tie my %bytemultiplier, 'Tie::IxHash', + 1 => 'bytes', + 1000 => 'Kbytes', + 1000000 => 'Mbytes', + 1000000000 => 'Gbytes', +; + +$cgi->param('multiplier', '60') unless $cgi->param('multiplier'); +$cgi->param('upmultiplier', '1000000') unless $cgi->param('upmultiplier'); +$cgi->param('downmultiplier', '1000000') unless $cgi->param('downmultiplier'); +$cgi->param('totalmultiplier','1000000') unless $cgi->param('totalmultiplier'); + +</%init> |