3 #script to delete items
8 # Copyright 2000-2002 Katipo Communications
10 # This file is part of Koha.
12 # Koha is free software; you can redistribute it and/or modify it under the
13 # terms of the GNU General Public License as published by the Free Software
14 # Foundation; either version 2 of the License, or (at your option) any later
17 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
18 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
19 # A PARTICULAR PURPOSE. See the GNU General Public License for more details.
21 # You should have received a copy of the GNU General Public License along with
22 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
23 # Suite 330, Boston, MA 02111-1307 USA
31 use C4::Circulation::Circ2;
32 #use C4::Acquisitions;
35 #print $input->header;
36 my $member=$input->param('member');
38 $env{'nottodayissues'}=1;
40 $member2{'borrowernumber'}=$member;
41 my $issues=currentissues(\%env,\%member2);
43 foreach (sort keys %$issues) {
46 my ($bor,$flags)=getpatroninformation(\%env, $member,'');
48 my $query="Select * from borrowers where guarantor='$member'";
49 my $sth=$dbh->prepare($query);
51 my $data=$sth->fetchrow_hashref;
56 if ($i > 0 || $flags->{'CHARGES'} ne '' || $data ne ''){
58 print "<table border=1>";
60 print "<TR><TD>Items on Issue</td><td align=right>$i</td></tr>";
62 if ($flags->{'CHARGES'} ne ''){
63 print "<TR><TD>Charges</td><td>$flags->{'CHARGES'}->{'message'}</tr>";
66 print "<TR><TD>Guarantees</td></tr>";
72 print $input->redirect("/members/");
78 my $query="Select * from borrowers where borrowernumber='$member'";
79 my $sth=$dbh->prepare($query);
81 my @data=$sth->fetchrow_array;
83 $query="Insert into deletedborrowers values (";
84 foreach my $temp (@data){
85 $query=$query."'$temp',";
89 $sth=$dbh->prepare($query);
92 $query = "Delete from borrowers where borrowernumber='$member'";
93 $sth=$dbh->prepare($query);
96 $query="Delete from reserves where borrowernumber='$member'";
97 $sth=$dbh->prepare($query);