Browse Source

tidying up search results

master
chris 25 years ago
parent
commit
a8eb513c5f
  1. 27
      C4/Search.pm
  2. 19
      detail.pl
  3. 9
      request.pl

27
C4/Search.pm

@ -250,8 +250,15 @@ sub CatSearch {
#print $query;
my $sth=$dbh->prepare($query);
$sth->execute;
my $count=0;
if ($type eq 'subject'){
while (my $data=$sth->fetchrow_arrayref){
$count++;
}
} else {
my $data=$sth->fetchrow_arrayref;
my $count=$data->[0];
$count=$data->[0];
}
$sth->finish;
$query=~ s/count\(\*\)/\*/g;
if ($type ne 'precise' && $type ne 'subject'){
@ -462,13 +469,21 @@ sub itemnodata {
sub BornameSearch {
my ($env,$searchstring,$type)=@_;
my $dbh = &C4Connect;
my @data=split(' ',$searchstring);
my $count=@data;
my $query="Select * from borrowers
where surname like '%$searchstring%'
or firstname like '%$searchstring%'
or othernames like '%$searchstring%'
or cardnumber = '$searchstring'
where ((surname like '%$data[0]%'
or firstname like '%$data[0]%'
or othernames like '%$data[0]%')
";
for (my $i=1;$i<$count;$i++){
$query=$query." and (surname like '%$data[$i]%'
or firstname like '%$data[$i]%'
or othernames like '%$data[$i]%')";
}
$query=$query.") or cardnumber = '$searchstring'
order by surname,firstname";
#print $query,"\n";
print $query,"\n";
my $sth=$dbh->prepare($query);
$sth->execute;
my @results;

19
detail.pl

@ -29,12 +29,13 @@ my $blah;
my $bib=$input->param('bib');
my $title=$input->param('title');
print "<a href=request.pl?bib=$bib><img height=42 WIDTH=120 BORDER=0 src=\"/images/requests.gif\" align=right border=0></a>";
print mkheadr(3,$title);
my @items=ItemInfo(\$blah,$bib,$title);
my $dat=bibdata($bib);
my $count=@items;
print mkheadr(3,$dat->{'title'});
print <<printend
<TABLE CELLSPACING=0 CELLPADDING=5 border=1 align=left width="220">
@ -45,24 +46,24 @@ print <<printend
<TR VALIGN=TOP>
<td bgcolor="99cc33" background="/images/background-mem.gif"><B>BIBLIO RECORD</TD></TR>
<td bgcolor="99cc33" background="/images/background-mem.gif"><B>BIBLIO RECORD $bib</TD></TR>
<tr VALIGN=TOP >
<TD>
<br>
<FONT SIZE=2 face="arial, helvetica">
Biblio Number: $bib<br>
Subtitle: $dat->{'subtitle'}<br>
Author: $dat->{'author'}<br>
Title: $title<br>
Additional Author: <br>
Seriestitle: $dat->{'seriestitle'}<br>
Subject: $dat->{'subject'}<br>
Copyright:$dat->{'copyrightdate'}<br>
Subtitle: $dat->{'subtitle'}<br>
Unititle: $dat->{'unititle'}<br>
Notes: $dat->{'notes'}<br>
Unititle: $dat->{'unititle'}<br>
Analytical Author: <br>
Analytical Title: <br>
Serial: $dat->{'serial'}<br>
Seriestitle: $dat->{'seriestitle'}<br>
Subject: $dat->{'subject'}<br>
Groups: $dat->{'classification'}<br>
Total Number of Items: $count
<p>
<INPUT TYPE="image" name="submit" VALUE="modify" height=42 WIDTH=93 BORDER=0 src="/images/modify-mem.gif">

9
request.pl

@ -139,7 +139,12 @@ print <<printend
printend
;
$count--;
for ($i=0;$i<$count;$i++){
my $bor=$reserves->[$i]{'firstname'}."%20".$reserves->[$i]{'surname'};
$bor=~ s/ /%20/g;
my @temp=split('-',$reserves->[$i]{'reservedate'});
$date="$temp[2]/$temp[1]/$temp[0]";
print "<tr VALIGN=TOP >
<TD><select name=rank-request>
<option value=1>1
@ -148,8 +153,8 @@ print "<tr VALIGN=TOP >
<option value=\"\">Del
</select>
</td>
<TD><a href=/cgi-bin/koha/members.pl>$reserves->[$i]{'firstname'} $reserves->[$i]{'surname'}</a></td>
<TD>$reserves->[$i]{'reservedate'}</td>
<TD><a href=/cgi-bin/koha/member.pl?member=$bor>$reserves->[$i]{'firstname'} $reserves->[$i]{'surname'}</a></td>
<TD>$date</td>
<TD><select name=pickup>
<option value=levin>Levin
<option value=foxton>Foxton

Loading…
Cancel
Save