blob: 182eeab4132300f06f1b139d0efc06aead2f6969 (
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
|
<%
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");
}
%>
|