<%
-#<!-- $Id: cust_main.cgi,v 1.6 2001-09-27 21:12:15 ivan Exp $ -->
+#<!-- $Id: cust_main.cgi,v 1.12 2001-10-30 15:42:33 ivan Exp $ -->
use vars qw( $cgi $custnum $action $cust_main $p1 @agents $agentnum
$last $first $ss $company $address1 $address2 $city $zip
# top
$p1 = popurl(1);
-print $cgi->header( '-expires' => 'now' ), header("Customer $action", '');
+print header("Customer $action", '');
print qq!<FONT SIZE="+1" COLOR="#ff0000">Error: !, $error, "</FONT>"
if $error;
<TR><TH ALIGN="right">${r}City</TH><TD><INPUT TYPE="text" NAME="city" VALUE="$city"></TD><TH ALIGN="right">${r}State/Country</TH><TD><SELECT NAME="state" SIZE="1">
END
-$cust_main->country( $conf->config('countrydefault') || 'US' )
- unless $cust_main->country;
+my $countrydefault = $conf->config('countrydefault') || 'US';
+$cust_main->country( $countrydefault ) unless $cust_main->country;
$cust_main->state( $conf->config('statedefault') || 'CA' )
unless $cust_main->state || $cust_main->country ne 'US';
-foreach ( qsearch('cust_main_county',{}) ) {
+foreach ( sort {
+ ( $b->country eq $countrydefault ) <=> ( $a->country eq $countrydefault )
+ or $a->country cmp $b->country
+ or $a->state cmp $b->state
+ or $a->county cmp $b->county
+} qsearch('cust_main_county',{}) ) {
print "<OPTION";
print " SELECTED" if ( $cust_main->state eq $_->state
&& $cust_main->county eq $_->county
if ( @part_pkg ) {
- print "<BR><BR>First package", &itable("#cccccc", "0 ALIGN=LEFT"), #apiabuse
+# print "<BR><BR>First package", &itable("#cccccc", "0 ALIGN=LEFT"),
+#apiabuse & undesirable wrapping
+ print "<BR><BR>First package", &itable("#cccccc"),
qq!<TR><TD COLSPAN=2><SELECT NAME="pkgpart_svcpart">!;
print qq!<OPTION VALUE="">(none)!;
$otaker = $cust_main->otaker;
print qq!<INPUT TYPE="hidden" NAME="otaker" VALUE="$otaker">!,
- qq!<BR><BR><INPUT TYPE="submit" VALUE="!,
+ qq!<BR><INPUT TYPE="submit" VALUE="!,
$custnum ? "Apply Changes" : "Add Customer", qq!">!,
"</FORM></BODY></HTML>",
;