2 #script to provide intranet (librarian) advanced search facility
3 #modified 9/11/1999 by chris@katipo.co.nz
4 #adding an extra comment to play with CVS (Si, 19/11/99)
18 #build hash of users input
21 my $keyword=validateinp
($input->param('keyword'));
22 #my $keyword=$input->param('keyword');
24 $search{'keyword'}=$keyword;
27 my $offset=$input->param('offset');
31 my $num=$input->param('num');
36 print startmenu
('opac');
37 print mkheadr
(1,"Opac Search Results for $keyword");
41 if ($search{'keyword'} ne ''){
42 ($count,@results)=&OpacSearch
(\
$blah,'loose',\
%search,$num,$offset);
44 #print "You searched on <b>$keyword</b>";
46 print " $count results found";
47 my $offset2=$num+$offset;
49 print ", Results $disp to $offset2 displayed";
52 print mktablerow
(4,'#99cccc','<b>TITLE</b>','<b>AUTHOR</b>','<b>COUNT</b>',bold
('BRANCH'));
58 my @stuff=split('\t',$results[$i]);
59 $stuff[1]=~ s/\`/\'/g;
63 $stuff[1]=mklink
("/cgi-bin/koha/detail.pl?bib=$stuff[2]&title=$title2&type=opac",$stuff[1]);
69 my $url="/cgi-bin/koha/search.pl?author=$word&type=opac";
70 $stuff[0]=mklink
($url,$stuff[0]);
71 my ($count,$lcount,$nacount,$fcount,$scount,$lostcount,$mending,$transit)=itemcount
($env,$stuff[2]);
74 $stuff[4]=$stuff[4]."On Loan";
76 $stuff[4]=$stuff[4]." ($nacount)";
81 $stuff[4]=$stuff[4]."Levin";
83 $stuff[4]=$stuff[4]." ($lcount)";
88 $stuff[4]=$stuff[4]."Foxton";
90 $stuff[4]=$stuff[4]." ($fcount)";
95 $stuff[4]=$stuff[4]."Shannon";
97 $stuff[4]=$stuff[4]." ($scount)";
102 $stuff[4]=$stuff[4]."Mending";
104 $stuff[4]=$stuff[4]." ($mending)";
109 $stuff[4]=$stuff[4]."In Transit";
111 $stuff[4]=$stuff[4]." ($transit)";
116 print mktablerow
(4,'#efe5ef',$stuff[1],$stuff[0],$stuff[3],$stuff[4]);
119 print mktablerow
(4,'white',$stuff[1],$stuff[0],$stuff[3],$stuff[4]);
124 $offset=$num+$offset;
125 if ($offset < $count){
126 $keyword=~ s/ /%20/g;
127 my $search="num=$num&offset=$offset&keyword=$keyword";
128 my $stuff=mklink
("/cgi-bin/koha/opac-search.pl?$search",'Next Results');
130 print "<tr valign=top bgcolor=#99cccc><td colspan=4>$stuff
133 print mktablerow
(4,'#99cccc',' ',' ',' ',' ');
139 print endmenu
('opac');
145 $input=~ s/\<[a-z]+\>//gi;
146 $input=~ s/\<\/[a-z]+\>//gi
;