4 if ( $cgi->param('showdisabled')
5 || !dbdef->table('agent')->column('disabled') ) {
8 %search = ( 'disabled' => '' );
12 <%= header('Agent Listing', menubar(
14 'Agent Types' => $p. 'browse/agent_type.cgi',
15 # 'Add new agent' => '../edit/agent.cgi'
17 Agents are resellers of your service. Agents may be limited to a subset of your
18 full offerings (via their type).<BR><BR>
19 <A HREF="<%= $p %>edit/agent.cgi"><I>Add a new agent</I></A><BR><BR>
21 <% if ( dbdef->table('agent')->column('disabled') ) { %>
22 <%= $cgi->param('showdisabled')
23 ? do { $cgi->param('showdisabled', 0);
24 '( <a href="'. $cgi->self_url. '">hide disabled agents</a> )'; }
25 : do { $cgi->param('showdisabled', 1);
26 '( <a href="'. $cgi->self_url. '">show disabled agents</a> )'; }
32 <TH COLSPAN=<%= ( $cgi->param('showdisabled') || !dbdef->table('agent')->column('disabled') ) ? 2 : 3 %>>Agent</TH>
36 <TH>Registration Codes</TH>
37 <TH>Prepaid cards</TH>
38 <TH><FONT SIZE=-1>Freq.</FONT></TH>
39 <TH><FONT SIZE=-1>Prog.</FONT></TH>
42 # <TH><FONT SIZE=-1>Agent #</FONT></TH>
45 foreach my $agent ( sort {
46 #$a->getfield('agentnum') <=> $b->getfield('agentnum')
47 $a->getfield('agent') cmp $b->getfield('agent')
48 } qsearch('agent', \%search ) ) {
50 my $cust_main_link = $p. 'search/cust_main.cgi?agentnum_on=1&'.
51 'agentnum='. $agent->agentnum;
56 <TD><A HREF="<%=$p%>edit/agent.cgi?<%= $agent->agentnum %>">
57 <%= $agent->agentnum %></A></TD>
58 <% if ( dbdef->table('agent')->column('disabled')
59 && !$cgi->param('showdisabled') ) { %>
60 <TD><%= $agent->disabled ? 'DISABLED' : '' %></TD>
63 <TD><A HREF="<%=$p%>edit/agent.cgi?<%= $agent->agentnum %>">
64 <%= $agent->agent %></A></TD>
65 <TD><A HREF="<%=$p%>edit/agent_type.cgi?<%= $agent->typenum %>"><%= $agent->agent_type->atype %></A></TD>
69 <TABLE CELLSPACING=0 CELLPADDING=0>
71 <TH ALIGN="right" WIDTH="40%">
72 <%= my $num_prospect = $agent->num_prospect_cust_main %>
75 <% if ( $num_prospect ) { %>
76 <A HREF="<%= $cust_main_link %>&prospect=1"><% } %>prospects<% if ($num_prospect ) { %></A><% } %>
80 <TH ALIGN="right" WIDTH="40%">
81 <FONT COLOR="#00CC00">
82 <%= my $num_active = $agent->num_active_cust_main %>
86 <% if ( $num_active ) { %>
87 <A HREF="<%= $cust_main_link %>&active=1"><% } %>active<% if ( $num_active ) { %></A><% } %>
91 <TH ALIGN="right" WIDTH="40%">
92 <FONT COLOR="#FF9900">
93 <%= my $num_susp = $agent->num_susp_cust_main %>
97 <% if ( $num_susp ) { %>
98 <A HREF="<%= $cust_main_link %>&suspended=1"><% } %>suspended<% if ( $num_susp ) { %></A><% } %>
102 <TH ALIGN="right" WIDTH="40%">
103 <FONT COLOR="#FF0000">
104 <%= my $num_cancel = $agent->num_cancel_cust_main %>
108 <% if ( $num_cancel ) { %>
109 <A HREF="<%= $cust_main_link %>&showcancelledcustomers=1&cancelled=1"><% } %>cancelled<% if ( $num_cancel ) { %></A><% } %>
116 <A HREF="<%= $p %>search/report_cust_pay.html?agentnum=<%= $agent->agentnum %>">Payments</A>
117 <BR><A HREF="<%= $p %>search/report_cust_credit.html?agentnum=<%= $agent->agentnum %>">Credits</A>
118 <BR><A HREF="<%= $p %>search/report_receivables.cgi?agentnum=<%= $agent->agentnum %>">A/R Aging</A>
119 <!--<BR><A HREF="<%= $p %>search/money_time.cgi?agentnum=<%= $agent->agentnum %>">Sales/Credits/Receipts</A>-->
124 <%= my $num_reg_code = $agent->num_reg_code %>
125 <% if ( $num_reg_code ) { %>
126 <A HREF="<%=$p%>search/reg_code.html?agentnum=<%= $agent->agentnum %>"><% } %>Unused<% if ( $num_reg_code ) { %></A><% } %>
127 <BR><A HREF="<%=$p%>edit/reg_code.cgi?agentnum=<%= $agent->agentnum %>">Generate codes</A>
131 <%= my $num_prepay_credit = $agent->num_prepay_credit %>
132 <% if ( $num_prepay_credit ) { %>
133 <A HREF="<%=$p%>search/prepay_credit.html?agentnum=<%= $agent->agentnum %>"><% } %>Unused<% if ( $num_prepay_credit ) { %></A><% } %>
134 <BR><A HREF="<%=$p%>edit/prepay_credit.cgi?agentnum=<%= $agent->agentnum %>">Generate cards</A>
137 <TD><%= $agent->freq %></TD>
138 <TD><%= $agent->prog %></TD>