Browse Source

Class search working with title, and by itself now

master
chris 22 years ago
parent
commit
2da14bc1bb
  1. 11
      C4/Search.pm

11
C4/Search.pm

@ -185,16 +185,19 @@ sub CatSearch {
my @key=split(' ',$search->{'title'});
my $count=@key;
my $i=1;
$query="select count(*) from biblio
where (title like '%$key[0]%'";
$query="select count(*) from biblio,biblioitems
where biblioitems.biblionumber=biblio.biblionumber and (title like '%$key[0]%'";
while ($i<$count){
$query=$query." and title like '%$key[$i]%'";
$i++;
}
$query=$query.")";
if ($search->{'class'} ne ''){
$query.=" and biblioitems.itemtype='$search->{'class'}'";
}
} elsif ($search->{'class'} ne ''){
$query="select count(*) from biblioitems where classification
like '%$search->{'class'}%'";
$query="select count(*) from biblioitems,biblio where itemtype =
'$search->{'class'}' and biblio.biblionumber=biblioitems.biblionumber";
}
}

Loading…
Cancel
Save