From 14ccd6237e3b7fd0283a1f8e850f2c564436a294 Mon Sep 17 00:00:00 2001 From: rangi Date: Fri, 5 Mar 2004 21:23:32 +0000 Subject: [PATCH] Little script to format a letter for printing to be sent to a borrower with overdue items --- misc/notifys/printnote.pl | 100 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100755 misc/notifys/printnote.pl diff --git a/misc/notifys/printnote.pl b/misc/notifys/printnote.pl new file mode 100755 index 0000000000..434bc7e49e --- /dev/null +++ b/misc/notifys/printnote.pl @@ -0,0 +1,100 @@ +#!/usr/bin/perl + +# Display a history of attempts to contact this borrower +# regarding overdues and fines. +# +# Tony McCrae +# tony@katipo.co.nz 5/July/2003 +# Copyright 2000-2002 Katipo Communications +# +# This file is part of Koha. +# +# Koha is free software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# +# Koha is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place, +# Suite 330, Boston, MA 02111-1307 USA + +#use lib ('/usr/local/koha/intranet/modules'); +use strict; +use CGI; +use HTML::Template; +use C4::Database; +use C4::Search; +use C4::Circulation::Circ2; +use C4::Circulation::Fines; + +use Data::Dumper; + +my $input = new CGI; +my $bornum = $input->param('bornum'); +my $date= $input->param('date'); +print $input->header; +if ($bornum) { + my $borrower = BorType($bornum); + my $dbh=C4Connect(); + my $querystring = "select * from borrowers where borrowernumber = ?"; + my $sth=$dbh->prepare($querystring); + $sth->execute($bornum); + my $row=$sth->fetchrow_hashref(); +# print "

"; + print " + + + + + + "; + print "
"; + print "

 

 

\n "; + print "

$row->{'firstname'} $row->{'surname'}
+ $row->{'streetaddress'}
+ $row->{'city'}

 

"; + $sth->finish(); + + $querystring = " select date, method, address, result, message, borrowernumber + from attempted_contacts + where date = ? and borrowernumber= ? + "; + + + + $sth=$dbh->prepare($querystring); + $sth->execute($date,$bornum); + + $row=$sth->fetchrow_hashref(); +# print $row->{'date'}."
\n"; +# print $row->{'method'}."
\n"; +# print $row->{'address'}."
\n"; +# print $row->{'result'}."
\n"; + print $row->{'message'}."
\n"; + print "

"; + +#print $querystring,$date,$bornum; + } + + + -- 2.39.5