blob: bdb92e70f7d29cd4894d0f07d4fd125bea103fd0 (
plain)
| 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
 | <SELECT NAME="usernum">
% unless ( $opt{'multiple'} || $opt{'disable_empty'} ) {
  <OPTION VALUE="">all</OPTION>
% }
% foreach my $otaker ( @{ $opt{'otakers'} } ) { 
    <OPTION VALUE="<% shift(@{$opt{'usernums'}}) %>"><% $otaker %></OPTION>
% } 
</SELECT>
<%init>
my %opt = @_;
unless ( $opt{'otakers'} ) {
  my $sth = dbh->prepare("SELECT username,usernum FROM access_user".
                       " WHERE disabled = '' or disabled IS NULL")
    or die dbh->errstr;
  $sth->execute or die $sth->errstr;
  for($sth->fetchall_arrayref) {
    $opt{'otakers'} = [ map { $_->[0] } @$_ ];
    $opt{'usernums'} = [ map { $_->[1] } @$_ ];
  }
}
</%init>
 |