removed <!-- $Id$ --> from all files to fix any redirects, whew
[freeside.git] / httemplate / edit / svc_acct_pop.cgi
1 <%
2
3 my $svc_acct_pop;
4 if ( $cgi->param('error') ) {
5   $svc_acct_pop = new FS::svc_acct_pop ( {
6     map { $_, scalar($cgi->param($_)) } fields('svc_acct_pop')
7   } );
8 } elsif ( $cgi->keywords ) { #editing
9   my($query)=$cgi->keywords;
10   $query =~ /^(\d+)$/;
11   $svc_acct_pop=qsearchs('svc_acct_pop',{'popnum'=>$1});
12 } else { #adding
13   $svc_acct_pop = new FS::svc_acct_pop {};
14 }
15 my $action = $svc_acct_pop->popnum ? 'Edit' : 'Add';
16 my $hashref = $svc_acct_pop->hashref;
17
18 my $p1 = popurl(1);
19 print header("$action POP", menubar(
20   'Main Menu' => popurl(2),
21   'View all POPs' => popurl(2). "browse/svc_acct_pop.cgi",
22 ));
23
24 print qq!<FONT SIZE="+1" COLOR="#ff0000">Error: !, $cgi->param('error'),
25       "</FONT>"
26   if $cgi->param('error');
27
28 print qq!<FORM ACTION="${p1}process/svc_acct_pop.cgi" METHOD=POST>!;
29
30 #display
31
32 print qq!<INPUT TYPE="hidden" NAME="popnum" VALUE="$hashref->{popnum}">!,
33       "POP #", $hashref->{popnum} ? $hashref->{popnum} : "(NEW)";
34
35 print <<END;
36 <PRE>
37 City      <INPUT TYPE="text" NAME="city" SIZE=32 VALUE="$hashref->{city}">
38 State     <INPUT TYPE="text" NAME="state" SIZE=16 MAXLENGTH=16 VALUE="$hashref->{state}">
39 Area Code <INPUT TYPE="text" NAME="ac" SIZE=4 MAXLENGTH=3 VALUE="$hashref->{ac}">
40 Exchange  <INPUT TYPE="text" NAME="exch" SIZE=4 MAXLENGTH=3 VALUE="$hashref->{exch}">
41 Local     <INPUT TYPE="text" NAME="loc" SIZE=5 MAXLENGTH=4 VALUE="$hashref->{loc}">
42 </PRE>
43 END
44
45 print qq!<BR><INPUT TYPE="submit" VALUE="!,
46       $hashref->{popnum} ? "Apply changes" : "Add POP",
47       qq!">!;
48
49 print <<END;
50     </FORM>
51   </BODY>
52 </HTML>
53 END
54
55 %>