% include("/elements/header.html","$action Agent", menubar( 'Main Menu' => $p, 'View all agents' => $p. 'browse/agent.cgi', )) %> % if ( $cgi->param('error') ) { Error: <% $cgi->param('error') %> % }
<% include('/elements/footer.html') %> <%init> my $agent; if ( $cgi->param('error') ) { $agent = new FS::agent ( { map { $_, scalar($cgi->param($_)) } fields('agent') } ); } elsif ( $cgi->keywords ) { my($query) = $cgi->keywords; $query =~ /^(\d+)$/; $agent = qsearchs( 'agent', { 'agentnum' => $1 } ); } else { #adding $agent = new FS::agent {}; } my $action = $agent->agentnum ? 'Edit' : 'Add'; my $conf = new FS::Conf; %init>