fix double // in relative URLs, s/CGI::Base/CGI/;
[freeside.git] / htdocs / edit / svc_acct_pop.cgi
1 #!/usr/bin/perl -Tw
2 #
3 # $Id: svc_acct_pop.cgi,v 1.3 1998-12-17 06:17:10 ivan Exp $
4 #
5 # ivan@sisd.com 98-mar-8 
6 #
7 # Changes to allow page to work at a relative position in server
8 #       bmccane@maxbaud.net     98-apr-3
9 #
10 # lose background, FS::CGI ivan@sisd.com 98-sep-2
11 #
12 # $Log: svc_acct_pop.cgi,v $
13 # Revision 1.3  1998-12-17 06:17:10  ivan
14 # fix double // in relative URLs, s/CGI::Base/CGI/;
15 #
16 # Revision 1.2  1998/11/13 09:56:47  ivan
17 # change configuration file layout to support multiple distinct databases (with
18 # own set of config files, export, etc.)
19 #
20
21 use strict;
22 use CGI;
23 use CGI::Carp qw(fatalsToBrowser);
24 use FS::UID qw(cgisuidsetup);
25 use FS::Record qw(qsearch qsearchs);
26 use FS::svc_acct_pop;
27 use FS::CGI qw(header menubar);
28
29 my($cgi) = new CGI;
30
31 &cgisuidsetup($cgi);
32
33 my($svc_acct_pop,$action);
34 if ( $cgi->query_string =~ /^(\d+)$/ ) { #editing
35   $svc_acct_pop=qsearchs('svc_acct_pop',{'popnum'=>$1});
36   $action='Edit';
37 } else { #adding
38   $svc_acct_pop=create FS::svc_acct_pop {};
39   $action='Add';
40 }
41 my($hashref)=$svc_acct_pop->hashref;
42
43 my $p1 = popurl(1);
44 print $cgi->header, header("$action POP", menubar(
45   'Main Menu' => popurl(2),
46   'View all POPs' => popurl(2). "browse/svc_acct_pop.cgi",
47 )), <<END;
48     <FORM ACTION="${p1}process/svc_acct_pop.cgi" METHOD=POST>
49 END
50
51 #display
52
53 print qq!<INPUT TYPE="hidden" NAME="popnum" VALUE="$hashref->{popnum}">!,
54       "POP #", $hashref->{popnum} ? $hashref->{popnum} : "(NEW)";
55
56 print <<END;
57 <PRE>
58 City      <INPUT TYPE="text" NAME="city" SIZE=32 VALUE="$hashref->{city}">
59 State     <INPUT TYPE="text" NAME="state" SIZE=3 MAXLENGTH=2 VALUE="$hashref->{state}">
60 Area Code <INPUT TYPE="text" NAME="ac" SIZE=4 MAXLENGTH=3 VALUE="$hashref->{ac}">
61 Exchange  <INPUT TYPE="text" NAME="exch" SIZE=4 MAXLENGTH=3 VALUE="$hashref->{exch}">
62 </PRE>
63 END
64
65 print qq!<BR><INPUT TYPE="submit" VALUE="!,
66       $hashref->{popnum} ? "Apply changes" : "Add POP",
67       qq!">!;
68
69 print <<END;
70     </FORM>
71   </BODY>
72 </HTML>
73 END
74