fixed a couple of bugs. Note this version of opac-reserve.pl is designed to work...
[koha.git] / opac / opac-search.pl
1 #!/usr/bin/perl
2 use strict;
3 require Exporter;
4
5 use C4::Auth;
6 use C4::Interface::CGI::Output;
7 use C4::Context;
8 use CGI;
9 use C4::Database;
10 use HTML::Template;
11
12 my $classlist='';
13
14 my $dbh=C4::Context->dbh;
15 my $sth=$dbh->prepare("select groupname,itemtypes from itemtypesearchgroups order by groupname");
16 $sth->execute;
17 while (my ($groupname,$itemtypes) = $sth->fetchrow) {
18     $classlist.="<option value=\"$itemtypes\">$groupname\n";
19 }
20
21
22 my $query = new CGI;
23
24 my ($template, $borrowernumber, $cookie) 
25     = get_template_and_user({template_name => "opac-search.tmpl",
26                              query => $query,
27                              type => "opac",
28                              authnotrequired => 1,
29                              flagsrequired => {borrow => 1},
30                          });
31
32
33 $template->param(classlist => $classlist);
34
35 output_html_with_http_headers $query, $cookie, $template->output;