From 55a68e4aabe10db4d9c3ab1bb8befd2f9f4b9008 Mon Sep 17 00:00:00 2001 From: ivan Date: Sat, 29 Jan 2005 12:34:12 +0000 Subject: registration codes --- httemplate/search/reg_code.html | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 httemplate/search/reg_code.html (limited to 'httemplate/search/reg_code.html') diff --git a/httemplate/search/reg_code.html b/httemplate/search/reg_code.html new file mode 100644 index 000000000..ba1eee078 --- /dev/null +++ b/httemplate/search/reg_code.html @@ -0,0 +1,35 @@ +<% + +my $agentnum = $cgi->param('agentnum'); +$agentnum =~ /^(\d+)$/ or eidiot "illegal agentnum $agentnum"; +$agentnum = $1; +my $agent = qsearchs('agent', { 'agentnum' => $agentnum } ); + +my $count_query = "SELECT COUNT(*) FROM reg_code WHERE agentnum = $agentnum"; + +%> +<%= 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!'. + $_->pkg. ' - '. $_->comment. + '
' + } $_[0]->part_pkg + }, + ], + 'links' => [ + '', + #$plink, + '', + ], + ) +%> -- cgit v1.2.1