Kumara - predecessor to Koha
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

104 lines
2.6 KiB

#script to provide intranet (librarian) advanced search facility
#modified 9/11/1999 by chris@katipo.co.nz
#adding an extra comment to play with CVS (Si, 19/11/99)
use strict;
#use DBI;
use C4::Search;
use CGI;
use C4::Output;
my $env;
my $input = new CGI;
print $input->header;
#print $input->dump;
my $blah;
my %search;
#build hash of users input
my $keyword=$input->param('keyword');
my @results;
my $offset=$input->param('offset');
if ($offset eq ''){
my $num=$input->param('num');
if ($num eq ''){
print startpage();
print startmenu('opac');
print mkheadr(1,'Opac Search Results');
print center();
my $count;
my @results;
print "You searched on ";
while ( my ($key, $value) = each %search) {
if ($value ne ''){
print bold("$key $value,");
print " $count results found";
my $offset2=$num+$offset;
print "<br> Results $offset to $offset2 displayed";
print mktablehdr;
print mktablerow(4,'#99cccc','<b>TITLE</b>','<b>AUTHOR</b>','<b>ITEM COUNT</b>',' &nbsp;');
my $count2=@results;
my $i=0;
my $colour=1;
while ($i < $count2){
my @stuff=split('\t',$results[$i]);
my $title2=$stuff[1];
$title2=~ s/ /%20/g;
my $word=$stuff[0];
$word=~ s/ //g;
$word=~ s/\,/\,%20/g;
$word=~ s/\n//g;
my $url="/cgi-bin/koha/search.pl?author=$word&type=a";
my ($count,$lcount,$nacount,$fcount,$scount)=itemcount($env,$stuff[2]);
if ($nacount > 0){
if ($lcount > 0){
if ($fcount > 0){
if ($scount > 0){
if ($colour == 1){
print mktablerow(4,'#efe5ef',$stuff[1],$stuff[0],$stuff[3],$stuff[4]);
} else{
print mktablerow(4,'white',$stuff[1],$stuff[0],$stuff[3],$stuff[4]);
print mktablerow(4,'#99cccc',' &nbsp; ',' &nbsp; ',' &nbsp;',' &nbsp;');
print mktableft();
if ($offset < $count){
my $search="num=$num&offset=$offset&keyword=$keyword";
my $stuff=mklink("/cgi-bin/koha/opac-search.pl?$search",'More');
print $stuff;
print endcenter();
print endmenu('opac');
print endpage();