diff options
author | mark <mark> | 2010-03-29 09:18:23 +0000 |
---|---|---|
committer | mark <mark> | 2010-03-29 09:18:23 +0000 |
commit | c1e2f536974812f05b8d3534ad2bf9c9ba40c24d (patch) | |
tree | ef8418e13e257532edd634ea26298cdee81be2e8 /httemplate/elements | |
parent | 3eb093c100cd3cd156ae5ddb86180f4a83fc82df (diff) |
RT#884: search customers by signup time of day
Diffstat (limited to 'httemplate/elements')
-rw-r--r-- | httemplate/elements/select-user.html | 30 | ||||
-rw-r--r-- | httemplate/elements/tr-select-user.html | 10 |
2 files changed, 40 insertions, 0 deletions
diff --git a/httemplate/elements/select-user.html b/httemplate/elements/select-user.html new file mode 100644 index 000000000..bdb92e70f --- /dev/null +++ b/httemplate/elements/select-user.html @@ -0,0 +1,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> diff --git a/httemplate/elements/tr-select-user.html b/httemplate/elements/tr-select-user.html new file mode 100644 index 000000000..a9572af8f --- /dev/null +++ b/httemplate/elements/tr-select-user.html @@ -0,0 +1,10 @@ +<TR> + <TD ALIGN="right"><% $opt{'label'} || 'Employee: ' %></TD> + <TD><% include('select-user.html', %opt) %></TD> +</TR> + +<%init> + +my %opt = @_; + +</%init> |