1 <SELECT NAME="<% $opt{'field'} || 'serviceid' %>">
3 % unless ( $opt{'multiple'} || $opt{'disable_empty'} ) {
4 <OPTION VALUE="">Select serviceid</OPTION>
7 % foreach my $serviceid ( keys %serviceid ) {
8 <OPTION VALUE="<%$serviceid%>"
9 <% $serviceid eq $value ? 'SELECTED' : '' %>
10 ><% $serviceid %></OPTION>
19 my $value = $opt{'curr_value'} || $opt{'value'};
21 #is this going to get too slow or will the index make it okay?
22 my $sth = dbh->prepare("SELECT DISTINCT(serviceid) FROM srvexport")
24 $sth->execute or die $sth->errstr;
26 while ( my $row = $sth->fetchrow_arrayref ) {
27 my $serviceid = $row->[0];
28 $serviceid =~ s/_(IN|OUT)$//;
29 $serviceid{$serviceid}=1;