3 # $Id: agent.cgi,v 1.8 1999-01-18 09:22:26 ivan Exp $
5 # ivan@sisd.com 97-dec-12
7 # changes to allow pages to load from a relative location in the web tree.
8 # bmccane@maxbaud.net 98-mar-25
10 # changed 'type' to 'atype' because type is reserved word in Pg6.3
11 # bmccane@maxbaud.net 98-apr-3
13 # agent type was linking to wrong cgi ivan@sisd.com 98-jul-18
15 # lose background, FS::CGI ivan@sisd.com 98-sep-2
18 # Revision 1.8 1999-01-18 09:22:26 ivan
19 # changes to track email addresses for email invoicing
21 # Revision 1.7 1998/12/17 05:25:16 ivan
22 # fix visual and other bugs
24 # Revision 1.6 1998/11/23 05:29:46 ivan
27 # Revision 1.5 1998/11/23 05:27:31 ivan
28 # to eliminate warnings
30 # Revision 1.4 1998/11/20 08:50:36 ivan
31 # s/CGI::Base/CGI.pm, visual fixes
33 # Revision 1.3 1998/11/08 10:11:02 ivan
36 # Revision 1.2 1998/11/07 10:24:22 ivan
37 # don't use depriciated FS::Bill and FS::Invoice, other miscellania
42 use CGI::Carp qw(fatalsToBrowser);
43 use FS::UID qw(cgisuidsetup swapuid);
44 use FS::Record qw(qsearch qsearchs);
45 use FS::CGI qw(header menubar table popurl);
54 my $ui = new FS::UI::agent;
68 print $cgi->header, header('Agent Listing', menubar(
70 'Agent Types' => $p. 'browse/agent_type.cgi',
71 # 'Add new agent' => '../edit/agent.cgi'
73 Agents are resellers of your service. Agents may be limited to a subset of your
74 full offerings (via their type).<BR><BR>
78 <TH COLSPAN=2>Agent</TH>
80 <TH><FONT SIZE=-1>Freq. (unimp.)</FONT></TH>
81 <TH><FONT SIZE=-1>Prog. (unimp.)</FONT></TH>
84 # <TH><FONT SIZE=-1>Agent #</FONT></TH>
88 foreach $agent ( sort {
89 $a->getfield('agentnum') <=> $b->getfield('agentnum')
90 } qsearch('agent',{}) ) {
91 my($hashref)=$agent->hashref;
92 my($typenum)=$hashref->{typenum};
93 my($agent_type)=qsearchs('agent_type',{'typenum'=>$typenum});
94 my($atype)=$agent_type->getfield('atype');
97 <TD><A HREF="${p}edit/agent.cgi?$hashref->{agentnum}">
98 $hashref->{agentnum}</A></TD>
99 <TD><A HREF="${p}edit/agent.cgi?$hashref->{agentnum}">
100 $hashref->{agent}</A></TD>
101 <TD><A HREF="${p}edit/agent_type.cgi?$typenum">$atype</A></TD>
102 <TD>$hashref->{freq}</TD>
103 <TD>$hashref->{prog}</TD>
111 <TD COLSPAN=2><A HREF="${p}edit/agent.cgi"><I>Add new agent</I></A></TD>
112 <TD><A HREF="${p}edit/agent_type.cgi"><I>Add new agent type</I></A></TD>