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,'');
47 my $dbh = C4::Context->dbh;
48 my $query="Select * from borrowers where guarantor='$member'";
49 my $sth=$dbh->prepare($query);
51 my $data=$sth->fetchrow_hashref;
55 if ($i > 0 || $flags->{'CHARGES'} ne '' || $data ne ''){
57 print "<table border=1>";
59 print "<TR><TD>Items on Issue</td><td align=right>$i</td></tr>";
61 if ($flags->{'CHARGES'} ne ''){
62 print "<TR><TD>Charges</td><td>$flags->{'CHARGES'}->{'message'}</tr>";
65 print "<TR><TD>Guarantees</td></tr>";
71 print $input->redirect("/members/");
76 my $dbh = C4::Context->dbh;
77 my $query="Select * from borrowers where borrowernumber='$member'";
78 my $sth=$dbh->prepare($query);
80 my @data=$sth->fetchrow_array;
82 $query="Insert into deletedborrowers values (";
83 foreach my $temp (@data){
84 $query=$query."'$temp',";
88 # FIXME - Use $dbh->do()
89 $sth=$dbh->prepare($query);
92 # FIXME - Use $dbh->do()
93 $query = "Delete from borrowers where borrowernumber='$member'";
94 $sth=$dbh->prepare($query);
97 # FIXME - Use $dbh->do()
98 $query="Delete from reserves where borrowernumber='$member'";
99 $sth=$dbh->prepare($query);