<%def _list_devices>
<%args>
$pua_id
$device_id
%args>
<%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 "