From e21914e425baadea5f423f7d40ff437ab9769bbd Mon Sep 17 00:00:00 2001 From: rangi Date: Mon, 26 Nov 2001 00:41:34 +0000 Subject: [PATCH] Added a findguarantor routine to search for the guarantor of a given borrower. Probably it and findgurantees need to moved out to borrowers.pm --- C4/Search.pm | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/C4/Search.pm b/C4/Search.pm index ece95dfb01..2277dc7977 100755 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -19,7 +19,8 @@ $VERSION = 0.01; &itemdata &bibdata &GetItems &borrdata &getacctlist &itemnodata &itemcount &OpacSearch &borrdata2 &NewBorrowerNumber &bibitemdata &borrissues &getboracctrecord &ItemType &itemissues &FrontSearch &subject &subtitle -&addauthor &bibitems &barcodes &findguarantees &allissues &systemprefs); +&addauthor &bibitems &barcodes &findguarantees &allissues &systemprefs +&findguarantor); %EXPORT_TAGS = ( ); # eg: TAG => [ qw!name1 name2! ], # your exported package globals go here, @@ -71,7 +72,24 @@ sub findguarantees{ $dbh->disconnect; return($i,\@dat); } - +sub findguarantor{ + my ($bornum)=@_; + my $dbh=C4Connect; + my $query="select guarantor from borrowers where + borrowernumber='$bornum'"; + my $sth=$dbh->prepare($query); + $sth->execute; + my $data=$sth->fetchrow_hashref; + $sth->finish; + $query="Select * from borrowers where + borrowernumber='$data->{'guarantor'}'"; + $sth=$dbh->prepare($query); + $sth->execute; + $data=$sth->fetchrow_hashref; + $sth->finish; + $dbh->disconnect; + return($data); +} sub systemprefs { my %systemprefs; -- 2.39.5