$bibid, now correctly $biblionumber.
[koha.git] / misc / notifys / printnote.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 print $input->header;
40 if ($bornum) {
41         my $borrower = BorType($bornum);
42         my $dbh=C4Connect();    
43         my $querystring = "select * from borrowers where borrowernumber = ?";
44         my $sth=$dbh->prepare($querystring);
45         $sth->execute($bornum);    
46        my $row=$sth->fetchrow_hashref();
47 #     print "<body background=/images/letterhead.jpg> <p> <p> <p>";
48     print "
49   <html>
50   <head>
51   <title></title>
52   <style type=\"text/css\">
53   body {
54       padding:0
55         margin:0
56         }
57 .content {
58     padding-left:30px;
59     padding-right:20px
60       }
61
62 @ media print {
63     .content {
64         padding-left:20px;
65         padding-right:20px
66           }
67     }
68 </style>
69   </head>
70   <body>";
71     print "<img src=\"/images/letterhead.jpg\"><br>";
72     print "<p> &nbsp; <p> &nbsp; <p>\n ";
73     print "<div class=\"content\">$row->{'firstname'} $row->{'surname'}<br>
74     $row->{'streetaddress'}<br>
75     $row->{'city'}<p> &nbsp; <p>";
76         $sth->finish();
77
78         $querystring = "        select  date, method, address, result, message, borrowernumber
79                                         from attempted_contacts
80         where date = ? and borrowernumber= ?
81                                         ";
82         
83
84         
85         $sth=$dbh->prepare($querystring);
86         $sth->execute($date,$bornum);
87
88         $row=$sth->fetchrow_hashref();
89 #               print $row->{'date'}."<br>\n";
90 #               print $row->{'method'}."<br>\n";
91 #               print $row->{'address'}."<br>\n";
92 #               print $row->{'result'}."<br>\n";
93                 print $row->{'message'}."<br>\n";
94                 print "<p><p>";
95
96 #print $querystring,$date,$bornum;
97         }
98
99
100