blob: 93ce4f9f2b337966334f664b4b990e100211c3e1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
<!-- $Id: agent.cgi,v 1.3 2002-01-30 14:18:08 ivan Exp $ -->
<%
my $agentnum = $cgi->param('agentnum');
my $old = qsearchs('agent',{'agentnum'=>$agentnum}) if $agentnum;
my $new = new FS::agent ( {
map {
$_, scalar($cgi->param($_));
} fields('agent')
} );
my $error;
if ( $agentnum ) {
$error=$new->replace($old);
} else {
$error=$new->insert;
$agentnum=$new->getfield('agentnum');
}
if ( $error ) {
$cgi->param('error', $error);
print $cgi->redirect(popurl(2). "agent.cgi?". $cgi->query_string );
} else {
print $cgi->redirect(popurl(3). "browse/agent.cgi");
}
%>
|