Browse Source

*** empty log message ***

master
olwen 22 years ago
parent
commit
7f950e8428
  1. 28
      C4/Circulation/Main.pm
  2. 15
      C4/Search.pm

28
C4/Circulation/Main.pm

@ -61,14 +61,18 @@ my $priv_func = sub {
sub pastitems{
#Get list of all items borrower has currently on issue
my ($env,$bornum,$dbh)=@_;
my $sth=$dbh->prepare("Select * from issues,items,biblio,biblioitems
where (borrowernumber=$bornum
and (returndate is null)
and ((issues.itemnumber=items.itemnumber)
and items.biblionumber=biblio.biblionumber
and biblioitems.biblioitemnumber=items.biblioitemnumber))
order by date_due");
my $query1 = "select * from issues where (borrowernumber=$bornum
and (returndate is null) order by date_due";
my $sth=$dbh->prepare($query1);
$sth->execute;
#my $sth=$dbh->prepare("Select * from issues,items,biblio,biblioitems
# where (borrowernumber=$bornum
# and (returndate is null)
# and ((issues.itemnumber=items.itemnumber)
# and items.biblionumber=biblio.biblionumber
# and biblioitems.biblioitemnumber=items.biblioitemnumber))
# order by date_due");
#$sth->execute;
my $i=0;
my @items;
my @items2;
@ -76,11 +80,13 @@ sub pastitems{
#$items2[0]=" "x29;
$items[0]=" "x72;
$items2[0]=" "x72;
while (my $data=$sth->fetchrow_hashref) {
my $line = C4::Circulation::Issues::formatitem($env,$data,$data->{'date_due'},"");
$items[$i]=$line;
$i++;
while (my $data1=$sth->fetchrow_hashref) {
my $data = itemnodata($env,$data,$data1->{'itemnumber'};
my $line = C4::Circulation::Issues::formatitem($env,$data,$data1->{'date_due'},"");
$items[$i]=$line;
$i++;
}
$sth->finish();
return(\@items,\@items2);
}

15
C4/Search.pm

@ -15,7 +15,7 @@ $VERSION = 0.01;
@ISA = qw(Exporter);
@EXPORT = qw(&CatSearch &BornameSearch &ItemInfo &KeywordSearch &subsearch
&itemdata &bibdata &GetItems &borrdata &getacctlist);
&itemdata &bibdata &GetItems &borrdata &getacctlist &itemnodata);
%EXPORT_TAGS = ( ); # eg: TAG => [ qw!name1 name2! ],
# your exported package globals go here,
@ -310,6 +310,19 @@ sub bibdata {
return($data);
}
sub itemnodata {
my ($env,$dbh,$itemnumber) = @_;
my $query="Select * from biblio,items,biblioitems
where itemnumber = '$itemnumber'
and biblio.biblionumber = items.itemnumber
and biblioitems.biblio = items.biblionumber";
my $sth=$dbh->prepare($query);
$sth->execute;
my $data=$sth->fetchrow_hashref;
$sth->finish;
return($data);
}
sub BornameSearch {
my ($env,$searchstring,$type)=@_;
my $dbh = &C4Connect;

Loading…
Cancel
Save