3 # svc_acct_pop.cgi: Add/Edit pop (output form)
5 # ivan@sisd.com 98-mar-8
7 # Changes to allow page to work at a relative position in server
8 # bmccane@maxbaud.net 98-apr-3
10 # lose background, FS::CGI ivan@sisd.com 98-sep-2
14 use CGI::Carp qw(fatalsToBrowser);
15 use FS::UID qw(cgisuidsetup);
16 use FS::Record qw(qsearch qsearchs);
18 use FS::CGI qw(header menubar);
20 my($cgi) = new CGI::Base;
25 SendHeaders(); # one guess.
27 my($svc_acct_pop,$action);
28 if ( $cgi->var('QUERY_STRING') =~ /^(\d+)$/ ) { #editing
29 $svc_acct_pop=qsearchs('svc_acct_pop',{'popnum'=>$1});
32 $svc_acct_pop=create FS::svc_acct_pop {};
35 my($hashref)=$svc_acct_pop->hashref;
37 print header("$action POP", menubar(
39 'View all POPs' => "../browse/svc_acct_pop.cgi",
41 <FORM ACTION="process/svc_acct_pop.cgi" METHOD=POST>
46 print qq!<INPUT TYPE="hidden" NAME="popnum" VALUE="$hashref->{popnum}">!,
47 "POP #", $hashref->{popnum} ? $hashref->{popnum} : "(NEW)";
51 City <INPUT TYPE="text" NAME="city" SIZE=32 VALUE="$hashref->{city}">
52 State <INPUT TYPE="text" NAME="state" SIZE=3 MAXLENGTH=2 VALUE="$hashref->{state}">
53 Area Code <INPUT TYPE="text" NAME="ac" SIZE=4 MAXLENGTH=3 VALUE="$hashref->{ac}">
54 Exchange <INPUT TYPE="text" NAME="exch" SIZE=4 MAXLENGTH=3 VALUE="$hashref->{exch}">
58 print qq!<BR><INPUT TYPE="submit" VALUE="!,
59 $hashref->{popnum} ? "Apply changes" : "Add POP",