1 <% include("/elements/header.html",'Generate prepaid cards'. ($agent ? ' for '. $agent->agent : '') ) %>
3 <% include('/elements/error.html') %>
5 <FORM ACTION="<%popurl(1)%>process/prepay_credit.cgi" METHOD="POST" NAME="OneTrueForm" onSubmit="document.OneTrueForm.submit.disabled=true">
8 <INPUT TYPE="text" NAME="num" VALUE="<% $cgi->param('num') || '(quantity)' |h %>" SIZE=10 MAXLENGTH=10 onFocus="if ( this.value == '(quantity)' ) { this.value = ''; }">
11 % foreach (qw(alpha alphanumeric numeric)) {
12 <OPTION<% $cgi->param('type') eq $_ ? ' SELECTED' : '' %>><% $_ %>
18 <BR>for <SELECT NAME="agentnum"><OPTION>(any agent)
19 % foreach my $opt_agent ( qsearch('agent', { 'disabled' => '' } ) ) {
21 <OPTION VALUE="<% $opt_agent->agentnum %>"<% $opt_agent->agentnum == $agentnum ? ' SELECTED' : '' %>><% $opt_agent->agent %>
28 $<INPUT TYPE="text" NAME="amount" SIZE=8 MAXLENGTH=7 VALUE="<% $cgi->param('amount') |h %>">
31 <INPUT TYPE="text" NAME="seconds" SIZE=6 MAXLENGTH=5 VALUE="<% $cgi->param('seconds') |h %>">
32 <SELECT NAME="multiplier">
33 % foreach my $multiplier ( keys %multiplier ) {
35 <OPTION VALUE="<% $multiplier %>"<% $cgi->param('multiplier') eq $multiplier ? ' SELECTED' : '' %>><% $multiplier{$multiplier} %>
42 <INPUT TYPE="text" NAME="upbytes" SIZE=6 MAXLENGTH=5 VALUE="<% $cgi->param('upbytes') |h %>">
43 <SELECT NAME="upmultiplier">
44 % foreach my $multiplier ( keys %bytemultiplier ) {
46 <OPTION VALUE="<% $multiplier %>"<% $cgi->param('upmultiplier') eq $multiplier ? ' SELECTED' : '' %>><% $bytemultiplier{$multiplier} %>
53 <INPUT TYPE="text" NAME="downbytes" SIZE=6 MAXLENGTH=5 VALUE="<% $cgi->param('downbytes') |h %>">
54 <SELECT NAME="downmultiplier">
55 % foreach my $multiplier ( keys %bytemultiplier ) {
57 <OPTION VALUE="<% $multiplier %>"<% $cgi->param('downmultiplier') eq $multiplier ? ' SELECTED' : '' %>><% $bytemultiplier{$multiplier} %>
64 <INPUT TYPE="text" NAME="totalbytes" SIZE=6 MAXLENGTH=5 VALUE="<% $cgi->param('totalbytes') |h %>">
65 <SELECT NAME="totalmultiplier">
66 % foreach my $multiplier ( keys %bytemultiplier ) {
68 <OPTION VALUE="<% $multiplier %>"<% $cgi->param('totalmultiplier') eq $multiplier ? ' SELECTED' : '' %>><% $bytemultiplier{$multiplier} %>
71 </SELECT> total transfer
75 <INPUT TYPE="submit" NAME="submit" VALUE="Generate" onSubmit="this.disabled = true">
79 <% include('/elements/footer.html') %>
84 unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
88 if ( $cgi->param('agentnum') =~ /^(\d+)$/ ) {
89 $agent = qsearchs('agent', { 'agentnum' => $agentnum=$1 } );
92 tie my %multiplier, 'Tie::IxHash',
98 tie my %bytemultiplier, 'Tie::IxHash',
102 1073741824 => 'Gbytes',
105 $cgi->param('multiplier', '60') unless $cgi->param('multiplier');
106 $cgi->param('upmultiplier', '1048576') unless $cgi->param('upmultiplier');
107 $cgi->param('downmultiplier', '1048576') unless $cgi->param('downmultiplier');
108 $cgi->param('totalmultiplier','1048576') unless $cgi->param('totalmultiplier');