e9d130897ef8bb749e173253e1630ef1ecec9711
[freeside.git] / httemplate / edit / process / cust_main_county.cgi
1 <!-- $Id: cust_main_county.cgi,v 1.4 2002-02-09 18:24:01 ivan Exp $ -->
2 <%
3
4 foreach ( $cgi->param ) {
5   /^tax(\d+)$/ or die "Illegal form $_!";
6   my($taxnum)=$1;
7   my($old)=qsearchs('cust_main_county',{'taxnum'=>$taxnum})
8     or die "Couldn't find taxnum $taxnum!";
9   next unless $old->getfield('tax') ne $cgi->param("tax$taxnum");
10   my(%hash)=$old->hash;
11   $hash{tax}=$cgi->param("tax$taxnum");
12   my($new)=new FS::cust_main_county \%hash;
13   my($error)=$new->replace($old);
14   if ( $error ) {
15     $cgi->param('error', $error);
16     print $cgi->redirect(popurl(2). "cust_main_county.cgi?". $cgi->query_string );
17     myexit();
18   }
19 }
20
21 print $cgi->redirect(popurl(3). "browse/cust_main_county.cgi");
22
23 %>