<%args> $pua_id $edit => 'f' $device_id => -1 <%once> use DBI; Personal User Agent
  PUA Interface - Electronic Numbering System InternetNZ  
 

 
 
<& nav.html, pua_id => $pua_id, current_page => 'pua_details.html' &>

Devices

<& _list_devices, pua_id => $pua_id, device_id => $device_id &>

New device

Device name:
Device uri:

Contact Methods

% if ($edit eq 't') {
<& _get_device_methods, pua_id => $pua_id, device_id => $device_id &>
% }

 
Powered by Catalyst IT
<%def _list_devices> <%args> $pua_id $device_id <%init> my $dbh = DBI->connect('dbi:Pg:dbname=pua', 'pua', 'pua') or die "Couldn't connect to database: " . DBI->errstr; my $sth = $dbh->prepare("SELECT * from owner_device WHERE pua_id=$pua_id ORDER BY device_name;"); $sth->execute or die "Execute failed $pua_id: " . $sth->errstr; my $rv = ""; my @current; while (@current = $sth->fetchrow_array()) { if ($rv eq "") { print "\n"; } $rv .= " \n"; my $class = $current[0] == $device_id ? ' class="active"' : ''; $rv .= " $current[2]\n"; $rv .= " [delete]\n"; $rv .= "\n"; } print $rv; if ($rv ne "") { print "
\n"; } <%def _get_device_methods> <%args> $pua_id $device_id <%init> my $dbh = DBI->connect('dbi:Pg:dbname=pua', 'pua', 'pua') or die "Couldn't connect to database: " . DBI->errstr; my $sth = $dbh->prepare("SELECT * from owner_contact_method WHERE device_id=$device_id ORDER BY owner_contact_method_id;"); $sth->execute or die "Execute failed: " . $sth->errstr; my $rv = ""; my @current; my $count = 1; while (@current = $sth->fetchrow_array()) { $rv .= "
\n"; $count++; } $rv .= " " . "
" . " " . " "; print $rv;