Browse Source

more counts

master
chris 22 years ago
parent
commit
846e4b194c
  1. 10
      C4/Search.pm
  2. 9
      search.pl

10
C4/Search.pm

@ -401,6 +401,7 @@ sub itemcount {
my $lcount=0;
my $nacount=0;
my $fcount=0;
my $scount=0;
while (my $data=$sth->fetchrow_hashref){
$count++;
my $query2="select * from issues where itemnumber=
@ -410,19 +411,22 @@ sub itemcount {
if (my $data2=$sth2->fetchrow_hashref){
$nacount++;
} else {
if ($data->{'holdingbranch'} eq 'L'){
if ($data->{'holdingbranch'} eq 'C'){
$lcount++;
}
if ($data->{'holdingbranch'} eq 'F'){
$fcount++;
}
if ($data->{'holdingbranch'} eq 'S'){
$scount++;
}
}
$sth2->finish;
}
$sth->finish;
$dbh->disconnect;
return ($count,$lcount,$nacount,$fcount);
return ($count,$lcount,$nacount,$fcount,$scount);
}

9
search.pl

@ -73,7 +73,7 @@ print mktablehdr;
if ($subject ne ''){
print mktablerow(1,'#cccc99','<b>SUBJECT</b>');
} else {
print mktablerow(3,'#cccc99','<b>TITLE</b>','<b>AUTHOR</b>','<b>ITEM COUNT</b>');
print mktablerow(4,'#cccc99','<b>TITLE</b>','<b>AUTHOR</b>','<b>ITEM COUNT</b>',' &nbsp;');
}
my $count2=@results;
my $i=0;
@ -90,7 +90,7 @@ while ($i < $count2){
$word=~ s/\n//g;
my $url="/cgi-bin/kumara/search.pl?author=$word&type=a";
$stuff[2]=mklink($url,$stuff[2]);
my ($count,$lcount,$nacount,$fcount)=itemcount($env,$stuff[0]);
my ($count,$lcount,$nacount,$fcount,$scount)=itemcount($env,$stuff[0]);
$stuff[3]=$count;
if ($nacount > 0){
$stuff[4]=$stuff[4]."N/A=$nacount";
@ -101,6 +101,9 @@ while ($i < $count2){
if ($fcount > 0){
$stuff[4]=$stuff[4]."F=$fcount";
}
if ($scount > 0){
$stuff[4]=$stuff[4]."S=$scount";
}
} else {
my $word=$stuff[1];
$word=~ s/ /%20/g;
@ -116,7 +119,7 @@ while ($i < $count2){
$i++;
}
$offset=$num+$offset;
print mktablerow(3,'#cccc99',' &nbsp; ',' &nbsp; ',' &nbsp;');
print mktablerow(4,'#cccc99',' &nbsp; ',' &nbsp; ',' &nbsp;',' &nbsp;');
print mktableft();
if ($offset < $count){
my $search="num=$num&offset=$offset";

Loading…
Cancel
Save