Cleaned up formatting of dewey number before returning result from Search.pm
[koha.git] / html-template / search.pl
1 #!/usr/bin/perl -w
2 use HTML::Template;
3 use strict;
4 require Exporter;
5 use C4::Database;
6 use CGI;
7 use C4::Search;
8  
9 my $query=new CGI;
10
11 my $templatename=$query->param('template');
12 my $startfrom=$query->param('startfrom');
13 ($startfrom) || ($startfrom=0);
14 ($templatename) || ($templatename='searchresults.tmpl');
15
16
17 my $dbh=&C4Connect;  
18
19
20 my $template = HTML::Template->new(filename => $templatename, die_on_bad_params => 0);
21
22 ##my @results;
23 #my $sth=$dbh->prepare("select * from biblio where author like 's%' order by author limit $startfrom,20");
24 #$sth->execute;
25 #while (my $data=$sth->fetchrow_hashref){    
26 #    push @results, $data;
27 #}
28
29 my $blah;
30 my %search;
31 my $keyword='bear';
32 $search{'keyword'}=$keyword;
33
34 my ($count, $resultshash, @results) = &KeywordSearch(\$blah, 'intra', \%search, 20, $startfrom);
35
36
37
38
39 $template->param(startfrom => $startfrom);
40 $startfrom+=20;
41 $template->param(nextstartfrom => $startfrom);
42 $template->param(template => $templatename);
43 $template->param(SEARCH_RESULTS => $resultshash);
44
45 print "Content-Type: text/html\n\n", $template->output;