Will things ever be the same again?
[freeside.git] / httemplate / search / reg_code.html
1 %
2 %
3 %my $agentnum = $cgi->param('agentnum');
4 %$agentnum =~ /^(\d+)$/ or eidiot "illegal agentnum $agentnum";
5 %$agentnum = $1;
6 %my $agent = qsearchs('agent', { 'agentnum' => $agentnum } );
7 %
8 %my $count_query = "SELECT COUNT(*) FROM reg_code WHERE agentnum = $agentnum";
9 %
10 %
11 <% include( 'elements/search.html',
12                  'title'       => 'Unused Registration Codes for '.
13                                   $agent->agent,
14                  'name'        => 'registration codes',
15                  'query'       => {  'table'   => 'reg_code',
16                                      'hashref' => { 'agentnum' => $agentnum, },
17                                   },
18                  'count_query' => $count_query,
19                  #'redirect'    => $link,
20                  'header'      => [ qw(Code Packages) ],
21                  'fields'      => [
22                    'code',
23                    sub {
24                      map { 
25                        qq!<A HREF="${p}edit/part_pkg.cgi?!. $_->pkgpart. '">'.
26                        $_->pkg. ' - '. $_->comment.
27                        '</A><BR>'
28                      } $_[0]->part_pkg
29                    },
30                  ],
31                  'links' => [
32                    '',
33                    #$plink,
34                    '',
35                  ],
36       )
37 %>