1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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.
'</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 eidiot "illegal agentnum $agentnum";
$agentnum = $1;
my $agent = qsearchs('agent', { 'agentnum' => $agentnum } );
my $count_query = "SELECT COUNT(*) FROM reg_code WHERE agentnum = $agentnum";
<%init>
|