diff options
Diffstat (limited to 'httemplate/search/reg_code.html')
-rw-r--r-- | httemplate/search/reg_code.html | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/httemplate/search/reg_code.html b/httemplate/search/reg_code.html new file mode 100644 index 0000000..f7d6d20 --- /dev/null +++ b/httemplate/search/reg_code.html @@ -0,0 +1,40 @@ +<% include( 'elements/search.html', + 'title' => 'Unused Registration Codes for '. + $agent->agent, + 'name' => 'registration codes', + 'query' => { 'table' => 'reg_code', + 'hashref' => { 'agentnum' => $agentnum, }, + }, + 'count_query' => $count_query, + #'redirect' => $link, + 'header' => [ qw(Code Packages) ], + 'fields' => [ + 'code', + sub { + map { + qq!<A HREF="${p}edit/part_pkg.cgi?!. $_->pkgpart. '">'. + $_->pkg_comment(nopkgpart => 1). + '</A><BR>' + } $_[0]->part_pkg + }, + ], + 'links' => [ + '', + #$plink, + '', + ], + ) +%> +<%init> + +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('Configuration'); + +my $agentnum = $cgi->param('agentnum'); +$agentnum =~ /^(\d+)$/ or errorpage("illegal agentnum $agentnum"); +$agentnum = $1; +my $agent = qsearchs('agent', { 'agentnum' => $agentnum } ); + +my $count_query = "SELECT COUNT(*) FROM reg_code WHERE agentnum = $agentnum"; + +</%init> |