This commit was generated by cvs2svn to compensate for changes in r9232,
[freeside.git] / httemplate / elements / select-user.html
1 <SELECT NAME="usernum">
2
3 % unless ( $opt{'multiple'} || $opt{'disable_empty'} ) {
4   <OPTION VALUE="">all</OPTION>
5 % }
6
7 % foreach my $otaker ( @{ $opt{'otakers'} } ) { 
8     <OPTION VALUE="<% shift(@{$opt{'usernums'}}) %>"><% $otaker %></OPTION>
9 % } 
10
11 </SELECT>
12
13 <%init>
14
15 my %opt = @_;
16
17 unless ( $opt{'otakers'} ) {
18
19   my $sth = dbh->prepare("SELECT username,usernum FROM access_user".
20                        " WHERE disabled = '' or disabled IS NULL")
21     or die dbh->errstr;
22   $sth->execute or die $sth->errstr;
23   for($sth->fetchall_arrayref) {
24     $opt{'otakers'} = [ map { $_->[0] } @$_ ];
25     $opt{'usernums'} = [ map { $_->[1] } @$_ ];
26   }
27
28 }
29
30 </%init>