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