update database for :
[koha.git] / search-test.pl
1 #!/usr/bin/perl 
2
3 # simple script to test cql searching
4 # written by chris@katipo.co.nz 17/2/06
5
6 use C4::Search;
7 use C4::Auth;
8 use C4::Interface::CGI::Output;
9
10 use CGI;
11 use Smart::Comments;
12 use strict;
13 use warnings;
14
15 my $input = new CGI;
16
17 my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
18     {
19         template_name   => "search-test.tmpl",
20         type            => "opac",
21         query           => $input,
22         authnotrequired => 1,
23         flagsrequired   => { borrow => 1 },
24     }
25 );
26
27 my $cql=$input->param('cql');
28 if ($cql){
29     my %search;
30     $search{'cql'} = $cql;
31     my $results = search( \%search, 'CQL' , 10);
32     $template->param(CQL => 'yes'       
33     );
34     $template->param(results => $results);
35 }
36 #my $record = get_record($result);
37
38
39
40  
41
42 output_html_with_http_headers $input, $cookie, $template->output;