fix payment and refund searches by otaker (now usernum), RT#9555
[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 $usernum ( keys %{ $opt{'access_user'} } ) { 
8     <OPTION VALUE="<%$usernum%>"><% $opt{'access_user'}->{$usernum} %></OPTION>
9 % } 
10
11 </SELECT>
12
13 <%init>
14
15 my %opt = @_;
16
17 unless ( $opt{'access_user'} ) {
18
19   tie %{ $opt{'access_user'} }, 'Tie::IxHash';
20
21   my $sth = dbh->prepare("
22     SELECT usernum, username FROM access_user
23       WHERE disabled = '' or disabled IS NULL
24         ORDER BY username
25   ") or die dbh->errstr;
26   $sth->execute or die $sth->errstr;
27   while ( my $row = $sth->fetchrow_arrayref ) {
28     $opt{'access_user'}->{$row->[0]} = $row->[1];
29   }
30
31 }
32
33 </%init>