From 69b3b149f2a83cf280022388b1cd37e62990c721 Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 24 Jan 2011 02:56:02 +0000 Subject: torrus, RT#10574 --- httemplate/elements/select-torrus_serviceid.html | 28 ++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 httemplate/elements/select-torrus_serviceid.html (limited to 'httemplate/elements') diff --git a/httemplate/elements/select-torrus_serviceid.html b/httemplate/elements/select-torrus_serviceid.html new file mode 100644 index 000000000..a8cfca8b8 --- /dev/null +++ b/httemplate/elements/select-torrus_serviceid.html @@ -0,0 +1,28 @@ + + +<%init> + +my %opt = @_; + +#is this going to get too slow or will the index make it okay? +my $sth = dbh->prepare("SELECT DISTINCT(serviceid) FROM srvexport") + or die dbh->errstr; +$sth->execute or die $sth->errstr; +my %serviceid = (); +while ( my $row = $sth->fetchrow_arrayref ) { + my $serviceid = $row->[0]; + $serviceid =~ s/_(IN|OUT)$//; + $serviceid{$serviceid}=1; +} + + -- cgit v1.2.1