Browse Source

item counts

master
chris 25 years ago
parent
commit
ac3984d63f
  1. 13
      C4/Search.pm
  2. 5
      search.pl

13
C4/Search.pm

@ -400,28 +400,29 @@ sub itemcount {
my $count=0;
my $lcount=0;
my $nacount=0;
my $fcount=0;
while (my $data=$sth->fetchrow_hashref){
$count++;
my $query2="select * from issues where itemnumber=
'$data->{'itemnumber'}' and returndate is NULL";
# print $query2;
my $sth2=$dbh->prepare($query2);
$sth2->execute;
if (my $data2=$sth2->fetchrow_hashref){
$nacount++;
} else {
if ($data->{'holdingbranch'}='L'){
if ($data->{'holdingbranch'} eq 'L'){
$lcount++;
}
if ($data->{'holdingbranch'} eq 'F'){
$fcount++;
}
}
$sth2->finish;
}
$sth->finish;
# print $lcount;
# print $nacount;
# print $count;
$dbh->disconnect;
return ($count,$lcount,$nacount);
return ($count,$lcount,$nacount,$fcount);
}

5
search.pl

@ -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)=itemcount($env,$stuff[0]);
my ($count,$lcount,$nacount,$fcount)=itemcount($env,$stuff[0]);
$stuff[3]=$count;
if ($nacount > 0){
$stuff[4]=$stuff[4]."N/A=$nacount";
@ -98,6 +98,9 @@ while ($i < $count2){
if ($lcount > 0){
$stuff[4]=$stuff[4]."L=$lcount";
}
if ($fcount > 0){
$stuff[4]=$stuff[4]."F=$fcount";
}
} else {
my $word=$stuff[1];
$word=~ s/ /%20/g;

Loading…
Cancel
Save