-<HTML><BODY>
-%
-%
-%my $router;
-%if ( $cgi->keywords ) {
-% my($query) = $cgi->keywords;
-% $query =~ /^(\d+)$/;
-% $router = qsearchs('router', { routernum => $1 })
-% or print $cgi->redirect(popurl(2)."browse/router.cgi") ;
-%} else {
-% $router = new FS::router ( {
-% map { $_, scalar($cgi->param($_)) } fields('router')
-% } );
-%}
-%
-%my $routernum = $router->routernum;
-%my $action = $routernum ? 'Edit' : 'Add';
-%
-%print header("$action Router", menubar(
-% 'Main Menu' => "$p",
-% 'View all routers' => "${p}browse/router.cgi",
-%));
-%
-%my $p3 = popurl(3);
-%
-%if($cgi->param('error')) {
-%
- <FONT SIZE="+1" COLOR="#ff0000">Error: <%$cgi->param('error')%></FONT>
-% }
+<% include('elements/edit.html',
+ 'post_url' => popurl(1).'process/router.cgi',
+ 'name' => 'router',
+ 'table' => 'router',
+ 'viewall_url' => "${p}browse/router.cgi",
+ 'labels' => { 'routernum' => 'Router',
+ 'routername' => 'Name',
+ 'svc_part' => 'Service',
+ 'agentnum' => 'Agent',
+ 'manual_addr' => 'Assign IP addresses manually',
+ },
+ 'fields' => [
+ { 'field'=>'routername', 'type'=>'text', 'size'=>32 },
+ { 'field'=>'agentnum', 'type'=>'select-agent' },
+ { 'field'=>'svcnum', 'type'=>'hidden' },
+ { 'field'=>'manual_addr','type'=>'checkbox','value'=>'Y'},
+ ],
+ 'error_callback' => $callback,
+ 'edit_callback' => $callback,
+ 'new_callback' => $callback,
+ 'html_table_bottom' => $html_table_bottom,
+ )
+%>
+<%init>