Reverted menu-left-example.png back to original and cleaned up menu-top-example to...
[freeside.git] / httemplate / edit / reg_code.cgi
1 <% include('/elements/header.html', 'Generate registration codes for '. $agent->agent) %>
2
3 <% include('/elements/error.html') %>
4
5 <FORM ACTION="<%popurl(1)%>process/reg_code.cgi" METHOD="POST" NAME="OneTrueForm" onSubmit="document.OneTrueForm.submit.disabled=true">
6 <INPUT TYPE="hidden" NAME="agentnum" VALUE="<% $agent->agentnum %>">
7
8 Generate
9 % my $num = '';
10 % if ( $cgi->param('num') =~ /^\s*(\d+)\s*$/ ) {
11 %   $num = $1;
12 % }
13 <INPUT TYPE="text" NAME="num" VALUE="<% $num %>" SIZE=5 MAXLENGTH=4>
14 registration codes for <B><% $agent->agent %></B> allowing the following packages:
15 <BR><BR>
16
17 % foreach my $part_pkg ( qsearch('part_pkg', { 'disabled' => '' } ) ) { 
18 %   my $pkgpart = $part_pkg->pkgpart;
19
20     <INPUT TYPE="checkbox" NAME="pkgpart<% $pkgpart %>" <% $cgi->param("pkgpart$pkgpart") ? 'CHECKED' : '' %>>
21     <% $part_pkg->pkg_comment %>
22     <BR>
23
24 % } 
25
26
27 <BR>
28 <INPUT TYPE="submit" NAME="submit" VALUE="Generate">
29
30 </FORM>
31
32 <% include('/elements/footer.html') %>
33
34 <%init>
35
36 die "access denied"
37   unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
38
39 my $agentnum = $cgi->param('agentnum');
40 $agentnum =~ /^(\d+)$/ or errorpage("illegal agentnum $agentnum");
41 $agentnum = $1;
42 my $agent = qsearchs('agent', { 'agentnum' => $agentnum } );
43
44 </%init>