Displaying search results count
[koha.git] / acqui / histsearch.pl
1 #!/usr/bin/perl
2 use strict;
3 require Exporter;
4 use CGI;
5 use HTML::Template;
6
7 use C4::Auth;       # get_template_and_user
8 use C4::Interface::CGI::Output;
9 use C4::Acquisition;
10
11 my $input = new CGI;
12 my $title = $input->param('title');
13 my $author = $input->param('author');
14 my $name = $input->param('name');
15
16 my $dbh = C4::Context->dbh;
17 my ($template, $loggedinuser, $cookie)
18     = get_template_and_user({template_name => "acqui/histsearch.tmpl",
19                              query => $input,
20                              type => "intranet",
21                              authnotrequired => 0,
22                              flagsrequired => {acquisition => 1},
23                              debug => 1,
24                              });
25 my $order_loop= &histsearch($title,$author,$name);
26
27 $template->param(numresults => scalar(@$order_loop),
28                                 suggestions_loop => $order_loop,
29                                 title => $title,
30                                 author => $author,
31                                 name => $name,
32 );
33 output_html_with_http_headers $input, $cookie, $template->output;