diff options
Diffstat (limited to 'httemplate/browse')
-rwxr-xr-x | httemplate/browse/agent.cgi | 138 | ||||
-rwxr-xr-x | httemplate/browse/agent_type.cgi | 109 | ||||
-rwxr-xr-x | httemplate/browse/cust_main_county.cgi | 108 | ||||
-rwxr-xr-x | httemplate/browse/nas.cgi | 95 | ||||
-rwxr-xr-x | httemplate/browse/part_pkg.cgi | 114 | ||||
-rwxr-xr-x | httemplate/browse/part_referral.cgi | 92 | ||||
-rwxr-xr-x | httemplate/browse/part_svc.cgi | 60 | ||||
-rwxr-xr-x | httemplate/browse/svc_acct_pop.cgi | 101 |
8 files changed, 817 insertions, 0 deletions
diff --git a/httemplate/browse/agent.cgi b/httemplate/browse/agent.cgi new file mode 100755 index 000000000..209043744 --- /dev/null +++ b/httemplate/browse/agent.cgi @@ -0,0 +1,138 @@ +<% +# +# $Id: agent.cgi,v 1.1 2001-07-30 07:36:03 ivan Exp $ +# +# ivan@sisd.com 97-dec-12 +# +# changes to allow pages to load from a relative location in the web tree. +# bmccane@maxbaud.net 98-mar-25 +# +# changed 'type' to 'atype' because type is reserved word in Pg6.3 +# bmccane@maxbaud.net 98-apr-3 +# +# agent type was linking to wrong cgi ivan@sisd.com 98-jul-18 +# +# lose background, FS::CGI ivan@sisd.com 98-sep-2 +# +# $Log: agent.cgi,v $ +# Revision 1.1 2001-07-30 07:36:03 ivan +# templates!!! +# +# Revision 1.13 1999/04/09 04:22:34 ivan +# also table() +# +# Revision 1.12 1999/04/09 03:52:55 ivan +# explicit & for table/itable/ntable +# +# Revision 1.11 1999/01/20 09:43:16 ivan +# comment out future UI code (but look at it, it's neat!) +# +# Revision 1.10 1999/01/19 05:13:24 ivan +# for mod_perl: no more top-level my() variables; use vars instead +# also the last s/create/new/; +# +# Revision 1.9 1999/01/18 09:41:14 ivan +# all $cgi->header calls now include ( '-expires' => 'now' ) for mod_perl +# (good idea anyway) +# +# Revision 1.8 1999/01/18 09:22:26 ivan +# changes to track email addresses for email invoicing +# +# Revision 1.7 1998/12/17 05:25:16 ivan +# fix visual and other bugs +# +# Revision 1.6 1998/11/23 05:29:46 ivan +# use CGI::Carp +# +# Revision 1.5 1998/11/23 05:27:31 ivan +# to eliminate warnings +# +# Revision 1.4 1998/11/20 08:50:36 ivan +# s/CGI::Base/CGI.pm, visual fixes +# +# Revision 1.3 1998/11/08 10:11:02 ivan +# CGI.pm +# +# Revision 1.2 1998/11/07 10:24:22 ivan +# don't use depriciated FS::Bill and FS::Invoice, other miscellania +# + +use strict; +use vars qw( $ui $cgi $p $agent ); +use CGI; +use CGI::Carp qw(fatalsToBrowser); +use FS::UID qw(cgisuidsetup swapuid); +use FS::Record qw(qsearch qsearchs); +use FS::CGI qw(header menubar table popurl); +use FS::agent; +use FS::agent_type; + +#Begin silliness +# +#use FS::UI::CGI; +#use FS::UI::agent; +# +#$ui = new FS::UI::agent; +#$ui->browse; +#exit; +#__END__ +#End silliness + +$cgi = new CGI; + +&cgisuidsetup($cgi); + +$p = popurl(2); + +print $cgi->header( '-expires' => 'now' ), header('Agent Listing', menubar( + 'Main Menu' => $p, + 'Agent Types' => $p. 'browse/agent_type.cgi', +# 'Add new agent' => '../edit/agent.cgi' +)), <<END; +Agents are resellers of your service. Agents may be limited to a subset of your +full offerings (via their type).<BR><BR> +END +print &table(), <<END; + <TR> + <TH COLSPAN=2>Agent</TH> + <TH>Type</TH> + <TH><FONT SIZE=-1>Freq. (unimp.)</FONT></TH> + <TH><FONT SIZE=-1>Prog. (unimp.)</FONT></TH> + </TR> +END +# <TH><FONT SIZE=-1>Agent #</FONT></TH> +# <TH>Agent</TH> + +foreach $agent ( sort { + $a->getfield('agentnum') <=> $b->getfield('agentnum') +} qsearch('agent',{}) ) { + my($hashref)=$agent->hashref; + my($typenum)=$hashref->{typenum}; + my($agent_type)=qsearchs('agent_type',{'typenum'=>$typenum}); + my($atype)=$agent_type->getfield('atype'); + print <<END; + <TR> + <TD><A HREF="${p}edit/agent.cgi?$hashref->{agentnum}"> + $hashref->{agentnum}</A></TD> + <TD><A HREF="${p}edit/agent.cgi?$hashref->{agentnum}"> + $hashref->{agent}</A></TD> + <TD><A HREF="${p}edit/agent_type.cgi?$typenum">$atype</A></TD> + <TD>$hashref->{freq}</TD> + <TD>$hashref->{prog}</TD> + </TR> +END + +} + +print <<END; + <TR> + <TD COLSPAN=2><A HREF="${p}edit/agent.cgi"><I>Add new agent</I></A></TD> + <TD><A HREF="${p}edit/agent_type.cgi"><I>Add new agent type</I></A></TD> + </TR> + </TABLE> + + </BODY> +</HTML> +END + +%> diff --git a/httemplate/browse/agent_type.cgi b/httemplate/browse/agent_type.cgi new file mode 100755 index 000000000..9d51a37e6 --- /dev/null +++ b/httemplate/browse/agent_type.cgi @@ -0,0 +1,109 @@ +<% +# +# $Id: agent_type.cgi,v 1.1 2001-07-30 07:36:03 ivan Exp $ +# +# ivan@sisd.com 97-dec-10 +# +# Changes to allow page to work at a relative position in server +# Changes to make "Packages" display 2-wide in table (old way was too vertical) +# bmccane@maxbaud.net 98-apr-3 +# +# lose background, FS::CGI ivan@sisd.com 98-sep-2 +# +# $Log: agent_type.cgi,v $ +# Revision 1.1 2001-07-30 07:36:03 ivan +# templates!!! +# +# Revision 1.8 1999/04/09 04:22:34 ivan +# also table() +# +# Revision 1.7 1999/04/09 03:52:55 ivan +# explicit & for table/itable/ntable +# +# Revision 1.6 1999/04/07 11:10:46 ivan +# harmless typo +# +# Revision 1.5 1999/01/19 05:13:25 ivan +# for mod_perl: no more top-level my() variables; use vars instead +# also the last s/create/new/; +# +# Revision 1.4 1999/01/18 09:41:15 ivan +# all $cgi->header calls now include ( '-expires' => 'now' ) for mod_perl +# (good idea anyway) +# +# Revision 1.3 1998/12/17 05:25:17 ivan +# fix visual and other bugs +# +# Revision 1.2 1998/11/21 07:39:52 ivan +# visual +# + +use strict; +use vars qw( $cgi $p $agent_type ); +use CGI; +use CGI::Carp qw(fatalsToBrowser); +use FS::UID qw(cgisuidsetup swapuid); +use FS::Record qw(qsearch qsearchs); +use FS::CGI qw(header menubar popurl table); +use FS::agent_type; +use FS::type_pkgs; +use FS::part_pkg; + +$cgi = new CGI; + +&cgisuidsetup($cgi); + +$p = popurl(2); +print $cgi->header( '-expires' => 'now' ), header("Agent Type Listing", menubar( + 'Main Menu' => $p, +)), "Agent types define groups of packages that you can then assign to". + " particular agents.<BR><BR>", &table(), <<END; + <TR> + <TH COLSPAN=2>Agent Type</TH> + <TH COLSPAN="2">Packages</TH> + </TR> +END + +foreach $agent_type ( sort { + $a->getfield('typenum') <=> $b->getfield('typenum') +} qsearch('agent_type',{}) ) { + my($hashref)=$agent_type->hashref; + my(@type_pkgs)=qsearch('type_pkgs',{'typenum'=> $hashref->{typenum} }); + my($rowspan)=scalar(@type_pkgs); + $rowspan = int($rowspan/2+0.5) ; + print <<END; + <TR> + <TD ROWSPAN=$rowspan><A HREF="${p}edit/agent_type.cgi?$hashref->{typenum}"> + $hashref->{typenum} + </A></TD> + <TD ROWSPAN=$rowspan><A HREF="${p}edit/agent_type.cgi?$hashref->{typenum}">$hashref->{atype}</A></TD> +END + + my($type_pkgs); + my($tdcount) = -1 ; + foreach $type_pkgs ( @type_pkgs ) { + my($pkgpart)=$type_pkgs->getfield('pkgpart'); + my($part_pkg) = qsearchs('part_pkg',{'pkgpart'=> $pkgpart }); + print qq!<TR>! if ($tdcount == 0) ; + $tdcount = 0 if ($tdcount == -1) ; + print qq!<TD><A HREF="${p}edit/part_pkg.cgi?$pkgpart">!, + $part_pkg->getfield('pkg'),"</A></TD>"; + $tdcount ++ ; + if ($tdcount == 2) + { + print qq!</TR>\n! ; + $tdcount = 0 ; + } + } + + print "</TR>"; +} + +print <<END; + <TR><TD COLSPAN=2><I><A HREF="${p}edit/agent_type.cgi">Add new agent type</A></I></TD></TR> + </TABLE> + </BODY> +</HTML> +END + +%> diff --git a/httemplate/browse/cust_main_county.cgi b/httemplate/browse/cust_main_county.cgi new file mode 100755 index 000000000..96541502c --- /dev/null +++ b/httemplate/browse/cust_main_county.cgi @@ -0,0 +1,108 @@ +<% +# +# $Id: cust_main_county.cgi,v 1.1 2001-07-30 07:36:03 ivan Exp $ +# +# ivan@sisd.com 97-dec-13 +# +# Changes to allow page to work at a relative position in server +# bmccane@maxbaud.net 98-apr-3 +# +# lose background, FS::CGI ivan@sisd.com 98-sep-2 +# +# $Log: cust_main_county.cgi,v $ +# Revision 1.1 2001-07-30 07:36:03 ivan +# templates!!! +# +# Revision 1.7 1999/04/09 04:22:34 ivan +# also table() +# +# Revision 1.6 1999/04/09 03:52:55 ivan +# explicit & for table/itable/ntable +# +# Revision 1.5 1999/01/19 05:13:26 ivan +# for mod_perl: no more top-level my() variables; use vars instead +# also the last s/create/new/; +# +# Revision 1.4 1999/01/18 09:41:16 ivan +# all $cgi->header calls now include ( '-expires' => 'now' ) for mod_perl +# (good idea anyway) +# +# Revision 1.3 1998/12/17 05:25:18 ivan +# fix visual and other bugs +# +# Revision 1.2 1998/11/18 09:01:34 ivan +# i18n! i18n! +# + +use strict; +use vars qw( $cgi $p $cust_main_county ); +use CGI; +use CGI::Carp qw(fatalsToBrowser); +use FS::UID qw(cgisuidsetup swapuid); +use FS::Record qw(qsearch qsearchs); +use FS::CGI qw(header menubar popurl table); +use FS::cust_main_county; + +$cgi = new CGI; + +&cgisuidsetup($cgi); + +$p = popurl(2); + +print $cgi->header( '-expires' => 'now' ), header("Tax Rate Listing", menubar( + 'Main Menu' => $p, + 'Edit tax rates' => $p. "edit/cust_main_county.cgi", +)),<<END; + Click on <u>expand country</u> to specify a country's tax rates by state. + <BR>Click on <u>expand state</u> to specify a state's tax rates by county. + <BR><BR> +END +print &table(), <<END; + <TR> + <TH><FONT SIZE=-1>Country</FONT></TH> + <TH><FONT SIZE=-1>State</FONT></TH> + <TH>County</TH> + <TH><FONT SIZE=-1>Tax</FONT></TH> + </TR> +END + +foreach $cust_main_county ( qsearch('cust_main_county',{}) ) { + my($hashref)=$cust_main_county->hashref; + print <<END; + <TR> + <TD>$hashref->{country}</TD> +END + print "<TD>", $hashref->{state} + ? $hashref->{state} + : qq!(ALL) <FONT SIZE=-1>!. + qq!<A HREF="${p}edit/cust_main_county-expand.cgi?!. $hashref->{taxnum}. + qq!">expand country</A></FONT>! + , "</TD>"; + print "<TD>"; + if ( $hashref->{county} ) { + print $hashref->{county}; + } else { + print "(ALL)"; + if ( $hashref->{state} ) { + print qq!<FONT SIZE=-1>!. + qq!<A HREF="${p}edit/cust_main_county-expand.cgi?!. $hashref->{taxnum}. + qq!">expand state</A></FONT>!; + } + } + print "</TD>"; + + print <<END; + <TD>$hashref->{tax}%</TD> + </TR> +END + +} + +print <<END; + </TABLE> + </CENTER> + </BODY> +</HTML> +END + +%> diff --git a/httemplate/browse/nas.cgi b/httemplate/browse/nas.cgi new file mode 100755 index 000000000..89d5e4650 --- /dev/null +++ b/httemplate/browse/nas.cgi @@ -0,0 +1,95 @@ +<% + +use strict; +use vars qw( $cgi $p ); +use CGI; +use CGI::Carp qw(fatalsToBrowser); +use Date::Format; +use FS::UID qw(cgisuidsetup); +use FS::Record qw(qsearch); # qsearchs); +use FS::CGI qw(header menubar table popurl); +use FS::nas; +use FS::port; +use FS::session; + +$cgi = new CGI; +&cgisuidsetup($cgi); + +$p=popurl(2); + +print $cgi->header( '-expires' => 'now' ), header('NAS ports', menubar( + 'Main Menu' => $p, +)); + +my $now = time; + +foreach my $nas ( sort { $a->nasnum <=> $b->nasnum } qsearch( 'nas', {} ) ) { + print $nas->nasnum. ": ". $nas->nas. " ". + $nas->nasfqdn. " (". $nas->nasip. ") ". + "as of ". time2str("%c",$nas->last). + " (". &pretty_interval($now - $nas->last). " ago)<br>". + &table(). "<TR><TH>Nas<BR>Port #</TH><TH>Global<BR>Port #</BR></TH>". + "<TH>IP address</TH><TH>User</TH><TH>Since</TH><TH>Duration</TH><TR>", + ; + foreach my $port ( sort { + $a->nasport <=> $b->nasport || $a->portnum <=> $b->portnum + } qsearch( 'port', { 'nasnum' => $nas->nasnum } ) ) { + my $session = $port->session; + my($user, $since, $pretty_since, $duration); + if ( ! $session ) { + $user = "(empty)"; + $since = 0; + $pretty_since = "(never)"; + $duration = ''; + } elsif ( $session->logout ) { + $user = "(empty)"; + $since = $session->logout; + } else { + my $svc_acct = $session->svc_acct; + $user = "<A HREF=\"$p/view/svc_acct.cgi?". $svc_acct->svcnum. "\">". + $svc_acct->username. "</A>"; + $since = $session->login; + } + $pretty_since = time2str("%c", $since) if $since; + $duration = pretty_interval( $now - $since ). " ago" + unless defined($duration); + print "<TR><TD>". $port->nasport. "</TD><TD>". $port->portnum. "</TD><TD>". + $port->ip. "</TD><TD>$user</TD><TD>$pretty_since". + "</TD><TD>$duration</TD></TR>" + ; + } + print "</TABLE><BR>"; +} + +sub pretty_interval { + my $interval = shift; + my %howlong = ( + '604800' => 'week', + '86400' => 'day', + '3600' => 'hour', + '60' => 'minute', + '1' => 'second', + ); + + my $pretty = ""; + foreach my $key ( sort { $b <=> $a } keys %howlong ) { + my $value = int( $interval / $key ); + if ( $value ) { + if ( $value == 1 ) { + $pretty .= + ( $howlong{$key} eq 'hour' ? 'an ' : 'a ' ). $howlong{$key}. " " + } else { + $pretty .= $value. ' '. $howlong{$key}. 's '; + } + } + $interval -= $value * $key; + } + $pretty =~ /^\s*(\S.*\S)\s*$/; + $1; +} + +#print &table(), <<END; +#<TR> +# <TH>#</TH> +# <TH>NAS</ +%> diff --git a/httemplate/browse/part_pkg.cgi b/httemplate/browse/part_pkg.cgi new file mode 100755 index 000000000..1d51f8145 --- /dev/null +++ b/httemplate/browse/part_pkg.cgi @@ -0,0 +1,114 @@ +<% +#!/usr/bin/perl -Tw +# +# $Id: part_pkg.cgi,v 1.1 2001-07-30 07:36:03 ivan Exp $ +# +# ivan@sisd.com 97-dec-5,9 +# +# Changes to allow page to work at a relative position in server +# bmccane@maxbaud.net 98-apr-3 +# +# lose background, FS::CGI ivan@sisd.com 98-sep-2 +# +# $Log: part_pkg.cgi,v $ +# Revision 1.1 2001-07-30 07:36:03 ivan +# templates!!! +# +# Revision 1.8 1999/04/09 04:22:34 ivan +# also table() +# +# Revision 1.7 1999/04/09 03:52:55 ivan +# explicit & for table/itable/ntable +# +# Revision 1.6 1999/01/19 05:13:27 ivan +# for mod_perl: no more top-level my() variables; use vars instead +# also the last s/create/new/; +# +# Revision 1.5 1999/01/18 09:41:17 ivan +# all $cgi->header calls now include ( '-expires' => 'now' ) for mod_perl +# (good idea anyway) +# +# Revision 1.4 1998/12/17 05:25:19 ivan +# fix visual and other bugs +# +# Revision 1.3 1998/11/21 07:23:45 ivan +# visual +# +# Revision 1.2 1998/11/21 07:00:32 ivan +# visual +# + +use strict; +use vars qw( $cgi $p $part_pkg ); +use CGI; +use CGI::Carp qw(fatalsToBrowser); +use FS::UID qw(cgisuidsetup swapuid); +use FS::Record qw(qsearch qsearchs); +use FS::CGI qw(header menubar popurl table); +use FS::part_pkg; +use FS::pkg_svc; +use FS::part_svc; + +$cgi = new CGI; + +&cgisuidsetup($cgi); + +$p = popurl(2); + +print $cgi->header( '-expires' => 'now' ), header("Package Part Listing",menubar( + 'Main Menu' => $p, +)), "One or more services are grouped together into a package and given", + " pricing information. Customers purchase packages, not services.<BR><BR>", + &table(), <<END; + <TABLE BORDER> + <TR> + <TH COLSPAN=2>Package</TH> + <TH>Comment</TH> + <TH><FONT SIZE=-1>Setup Fee</FONT></TH> + <TH><FONT SIZE=-1>Freq.</FONT></TH> + <TH><FONT SIZE=-1>Recur. Fee</FONT></TH> + <TH>Service</TH> + <TH><FONT SIZE=-1>Quan.</FONT></TH> + </TR> +END + +foreach $part_pkg ( sort { + $a->getfield('pkgpart') <=> $b->getfield('pkgpart') +} qsearch('part_pkg',{}) ) { + my($hashref)=$part_pkg->hashref; + my(@pkg_svc)=grep $_->getfield('quantity'), + qsearch('pkg_svc',{'pkgpart'=> $hashref->{pkgpart} }); + my($rowspan)=scalar(@pkg_svc); + print <<END; + <TR> + <TD ROWSPAN=$rowspan><A HREF="${p}edit/part_pkg.cgi?$hashref->{pkgpart}"> + $hashref->{pkgpart} + </A></TD> + <TD ROWSPAN=$rowspan><A HREF="${p}edit/part_pkg.cgi?$hashref->{pkgpart}">$hashref->{pkg}</A></TD> + <TD ROWSPAN=$rowspan>$hashref->{comment}</TD> + <TD ROWSPAN=$rowspan>$hashref->{setup}</TD> + <TD ROWSPAN=$rowspan>$hashref->{freq}</TD> + <TD ROWSPAN=$rowspan>$hashref->{recur}</TD> +END + + my($pkg_svc); + my($n)=""; + foreach $pkg_svc ( @pkg_svc ) { + my($svcpart)=$pkg_svc->getfield('svcpart'); + my($part_svc) = qsearchs('part_svc',{'svcpart'=> $svcpart }); + print $n,qq!<TD><A HREF="${p}edit/part_svc.cgi?$svcpart">!, + $part_svc->getfield('svc'),"</A></TD><TD>", + $pkg_svc->getfield('quantity'),"</TD></TR>\n"; + $n="<TR>"; + } + + print "</TR>"; +} + +print <<END; + <TR><TD COLSPAN=2><I><A HREF="${p}edit/part_pkg.cgi">Add new package</A></I></TD></TR> + </TABLE> + </BODY> +</HTML> +END +%> diff --git a/httemplate/browse/part_referral.cgi b/httemplate/browse/part_referral.cgi new file mode 100755 index 000000000..408d63003 --- /dev/null +++ b/httemplate/browse/part_referral.cgi @@ -0,0 +1,92 @@ +<% +# +# $Id: part_referral.cgi,v 1.1 2001-07-30 07:36:03 ivan Exp $ +# +# ivan@sisd.com 98-feb-23 +# +# Changes to allow page to work at a relative position in server +# bmccane@maxbaud.net 98-apr-3 +# +# lose background, FS::CGI ivan@sisd.com 98-sep-2 +# +# $Log: part_referral.cgi,v $ +# Revision 1.1 2001-07-30 07:36:03 ivan +# templates!!! +# +# Revision 1.9 1999/04/09 04:22:34 ivan +# also table() +# +# Revision 1.8 1999/04/09 03:52:55 ivan +# explicit & for table/itable/ntable +# +# Revision 1.7 1999/01/19 05:13:28 ivan +# for mod_perl: no more top-level my() variables; use vars instead +# also the last s/create/new/; +# +# Revision 1.6 1999/01/18 09:41:18 ivan +# all $cgi->header calls now include ( '-expires' => 'now' ) for mod_perl +# (good idea anyway) +# +# Revision 1.5 1998/12/17 05:25:20 ivan +# fix visual and other bugs +# +# Revision 1.4 1998/12/17 04:32:55 ivan +# print $cgi->header +# +# Revision 1.3 1998/12/17 04:31:36 ivan +# use CGI::Carp +# +# Revision 1.2 1998/12/17 04:26:04 ivan +# use CGI; no relative URLs +# + +use strict; +use vars qw( $cgi $p $part_referral ); +use CGI; +use CGI::Carp qw(fatalsToBrowser); +use FS::UID qw(cgisuidsetup swapuid); +use FS::Record qw(qsearch); +use FS::CGI qw(header menubar popurl table); +use FS::part_referral; + +$cgi = new CGI; + +&cgisuidsetup($cgi); + +$p = popurl(2); + +print $cgi->header( '-expires' => 'now' ), header("Referral Listing", menubar( + 'Main Menu' => $p, +# 'Add new referral' => "../edit/part_referral.cgi", +)), "Where a customer heard about your service. Tracked for informational purposes.<BR><BR>", &table(), <<END; + <TR> + <TH COLSPAN=2>Referral</TH> + </TR> +END + +foreach $part_referral ( sort { + $a->getfield('refnum') <=> $b->getfield('refnum') +} qsearch('part_referral',{}) ) { + my($hashref)=$part_referral->hashref; + print <<END; + <TR> + <TD><A HREF="${p}edit/part_referral.cgi?$hashref->{refnum}"> + $hashref->{refnum}</A></TD> + <TD><A HREF="${p}edit/part_referral.cgi?$hashref->{refnum}"> + $hashref->{referral}</A></TD> + </TR> +END + +} + +print <<END; + <TR> + <TD COLSPAN=2><A HREF="${p}edit/part_referral.cgi"><I>Add new referral</I></A></TD> + </TR> + </TABLE> + </CENTER> + </BODY> +</HTML> +END + +%> diff --git a/httemplate/browse/part_svc.cgi b/httemplate/browse/part_svc.cgi new file mode 100755 index 000000000..84d8a3566 --- /dev/null +++ b/httemplate/browse/part_svc.cgi @@ -0,0 +1,60 @@ +<!-- $Id: part_svc.cgi,v 1.1 2001-07-30 07:36:03 ivan Exp $ --> +<%= header('Service Part Listing', menubar( 'Main Menu' => $p) ) %> + + Services are items you offer to your customers.<BR><BR> +<TABLE BORDER=1> + <TR> + <TH COLSPAN=2>Service</TH> + <TH>Table</TH> + <TH>Field</TH> + <TH COLSPAN=2>Modifier</TH> + </TR> + +<% foreach my $part_svc ( sort { + $a->getfield('svcpart') <=> $b->getfield('svcpart') + } qsearch('part_svc',{}) ) { + my($hashref)=$part_svc->hashref; + my($svcdb)=$hashref->{svcdb}; + my(@rows)= + grep $hashref->{${svcdb}.'__'.$_.'_flag'}, + map { /^${svcdb}__(.*)$/; $1 } + grep ! /_flag$/, + grep /^${svcdb}__/, + fields('part_svc') + ; + my($rowspan)=scalar(@rows) || 1; + my $url = "${p}edit/part_svc.cgi?$hashref->{svcpart}"; +%> + + <TR> + <TD ROWSPAN=<%= $rowspan %>><A HREF="<%= $url %>"> + <%= $hashref->{svcpart} %></A></TD> + <TD ROWSPAN=<%= $rowspan %>><A HREF="<%= $url %>"> + <%= $hashref->{svc} %></A></TD> + <TD ROWSPAN=<%= $rowspan %>> + <%= $hashref->{svcdb} %></TD> + +<% my($n1)=''; + my($row); + foreach $row ( @rows ) { + my($flag)=$part_svc->getfield($svcdb.'__'.$row.'_flag'); +%> + <%= $n1 %><TD>$row</TD><TD> + +<% if ( $flag eq "D" ) { print "Default"; } + elsif ( $flag eq "F" ) { print "Fixed"; } + else { print "(Unknown!)"; } +%> + </TD><TD><%= $part_svc->getfield($svcdb."__".$row) %></TD> +<% $n1="</TR><TR>"; + } +%> + </TR> +<% } %> + + <TR> + <TD COLSPAN=2><A HREF="<%= $p %>edit/part_svc.cgi"><I>Add new service</I></A></TD> + </TR> +</TABLE> +</BODY> +</HTML> diff --git a/httemplate/browse/svc_acct_pop.cgi b/httemplate/browse/svc_acct_pop.cgi new file mode 100755 index 000000000..05f8a3031 --- /dev/null +++ b/httemplate/browse/svc_acct_pop.cgi @@ -0,0 +1,101 @@ +<% +# +# $Id: svc_acct_pop.cgi,v 1.1 2001-07-30 07:36:03 ivan Exp $ +# +# ivan@sisd.com 98-mar-8 +# +# Changes to allow page to work at a relative position in server +# bmccane@maxbaud.net 98-apr-3 +# +# lose background, FS::CGI ivan@sisd.com 98-sep-2 +# +# $Log: svc_acct_pop.cgi,v $ +# Revision 1.1 2001-07-30 07:36:03 ivan +# templates!!! +# +# Revision 1.8 2000/01/28 22:56:13 ivan +# track full phone number +# +# Revision 1.7 1999/04/09 04:22:34 ivan +# also table() +# +# Revision 1.6 1999/04/09 03:52:55 ivan +# explicit & for table/itable/ntable +# +# Revision 1.5 1999/01/19 05:13:30 ivan +# for mod_perl: no more top-level my() variables; use vars instead +# also the last s/create/new/; +# +# Revision 1.4 1999/01/18 09:41:20 ivan +# all $cgi->header calls now include ( '-expires' => 'now' ) for mod_perl +# (good idea anyway) +# +# Revision 1.3 1998/12/17 05:25:22 ivan +# fix visual and other bugs +# +# Revision 1.2 1998/12/17 04:36:59 ivan +# use CGI;, use CGI::Carp, visual changes, relative URLs +# + +use strict; +use vars qw( $cgi $p $svc_acct_pop ); +use CGI; +use CGI::Carp qw(fatalsToBrowser); +use FS::UID qw(cgisuidsetup swapuid); +use FS::Record qw(qsearch qsearchs); +use FS::CGI qw(header menubar table popurl); +use FS::svc_acct_pop; + +$cgi = new CGI; + +&cgisuidsetup($cgi); + +$p = popurl(2); + +print $cgi->header( '-expires' => 'now' ), header('POP Listing', menubar( + 'Main Menu' => $p, +)), "Points of Presence<BR><BR>", &table(), <<END; + <TR> + <TH></TH> + <TH>City</TH> + <TH>State</TH> + <TH>Area code</TH> + <TH>Exchange</TH> + <TH>Local</TH> + </TR> +END + +foreach $svc_acct_pop ( sort { + $a->getfield('popnum') <=> $b->getfield('popnum') +} qsearch('svc_acct_pop',{}) ) { + my($hashref)=$svc_acct_pop->hashref; + print <<END; + <TR> + <TD><A HREF="${p}edit/svc_acct_pop.cgi?$hashref->{popnum}"> + $hashref->{popnum}</A></TD> + <TD><A HREF="${p}edit/svc_acct_pop.cgi?$hashref->{popnum}"> + $hashref->{city}</A></TD> + <TD><A HREF="${p}edit/svc_acct_pop.cgi?$hashref->{popnum}"> + $hashref->{state}</A></TD> + <TD><A HREF="${p}edit/svc_acct_pop.cgi?$hashref->{popnum}"> + $hashref->{ac}</A></TD> + <TD><A HREF="${p}edit/svc_acct_pop.cgi?$hashref->{popnum}"> + $hashref->{exch}</A></TD> + <TD><A HREF="${p}edit/svc_acct_pop.cgi?$hashref->{popnum}"> + $hashref->{loc}</A></TD> + </TR> +END + +} + +print <<END; + <TR> + <TD COLSPAN=5><A HREF="${p}edit/svc_acct_pop.cgi"><I>Add new POP</I></A></TD> + </TR> + </TABLE> + </CENTER> + </BODY> +</HTML> +END + +%> |