adding a XMLgetbiblio in Biblio.pm (1st draft, to use with zebra)
[koha.git] / misc / notifys / contact_history.pl
1 #!/usr/bin/perl
2
3 # Display a history of attempts to contact this borrower
4 # regarding overdues and fines.
5 #
6 # Tony McCrae
7 # tony@katipo.co.nz     5/July/2003
8 # Copyright 2000-2002 Katipo Communications
9 #
10 # This file is part of Koha.
11 #
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
15 # version.
16 #
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.
20 #
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
24
25 #use lib ('/usr/local/koha/intranet/modules');
26 use strict;
27 use CGI;
28 use HTML::Template;
29 use C4::Database;
30 use C4::Search;
31 use C4::Circulation::Circ2;
32 use C4::Circulation::Fines;
33
34 use Data::Dumper;
35
36 my $input = new CGI;
37 my $bornum = $input->param('bornum');
38 my $date= $input->param('date');
39 my $edate=$input->param('edate');
40 print $input->header;
41 if ($bornum) {
42         my $borrower = BorType($bornum);
43         
44
45         my $querystring = "     select  date, method, address, result, message, borrowernumber
46                                         from attempted_contacts
47         where date >= ? and date < ?
48                                         ";
49         
50
51         my $dbh=C4Connect();    
52         my $sth=$dbh->prepare($querystring);
53         $sth->execute($date,$edate);
54
55         while (my $row=$sth->fetchrow_hashref()) {
56                 print "<a href=/cgi-bin/koha/moremember.pl?bornum=$row->{'borrowernumber'}>Borrwer Record</a> ";
57                 if ($row->{'method'} ne 'email'){
58                     my $tidydate=$row->{'date'};
59                     $tidydate=~ s/ /%20/g;
60                     print " &nbsp; <a href=/cgi-bin/koha/printnote.pl?bornum=$row->{'borrowernumber'}&date=$tidydate>Print Note</a><br>";
61                     }
62                 print $row->{'date'}."<br>\n";
63                 print $row->{'method'}."<br>\n";
64                 print $row->{'address'}."<br>\n";
65                 print $row->{'result'}."<br>\n";
66                 print $row->{'message'}."<br>\n";
67                 print "<p><p>";
68                 }
69
70         }
71
72
73