4 # Copyright 2000-2002 Katipo Communications
6 # This file is part of Koha.
8 # Koha is free software; you can redistribute it and/or modify it under the
9 # terms of the GNU General Public License as published by the Free Software
10 # Foundation; either version 2 of the License, or (at your option) any later
13 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
14 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
15 # A PARTICULAR PURPOSE. See the GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License along with
18 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
19 # Suite 330, Boston, MA 02111-1307 USA
28 my $type=$input->param('type');
30 my $theme = $input->param('theme'); # only used if allowthemeoverride is set
31 my %tmpldata = pathtotemplate ( template => 'overdue.tmpl', theme => $theme);
32 my $template = HTML::Template->new( filename => $tmpldata{'path'},
33 die_on_bad_params => 0);
46 my @datearr = localtime(time());
47 my $todaysdate = (1900+$datearr[5]).'-'.sprintf ("%0.2d", ($datearr[4]+1)).'-'.sprintf ("%0.2d", $datearr[3]);
51 my $query="select date_due,borrowernumber,itemnumber from issues where isnull(returndate) && date_due<'$todaysdate' order by date_due,borrowernumber";
52 my $sth=$dbh->prepare($query);
56 while (my $data=$sth->fetchrow_hashref) {
57 $duedate=$data->{'date_due'};
58 $bornum=$data->{'borrowernumber'};
59 $itemnum=$data->{'itemnumber'};
61 my $query="select concat(firstname,' ',surname),phone,emailaddress from borrowers where borrowernumber='$bornum'";
62 my $sth1=$dbh->prepare($query);
64 $data1=$sth1->fetchrow_hashref;
65 $name=$data1->{'concat(firstname,\' \',surname)'};
66 $phone=$data1->{'phone'};
67 $email=$data1->{'emailaddress'};
70 my $query="select biblionumber from items where itemnumber='$itemnum'";
71 my $sth2=$dbh->prepare($query);
73 $data2=$sth2->fetchrow_hashref;
74 $biblionumber=$data2->{'biblionumber'};
77 my $query="select title,author from biblio where biblionumber='$biblionumber'";
78 my $sth3=$dbh->prepare($query);
80 $data3=$sth3->fetchrow_hashref;
81 $title=$data3->{'title'};
82 $author=$data3->{'author'};
84 push (@overduedata, { duedate => $duedate,
90 biblionumber => $biblionumber,
99 $template->param( startmenureport => join ('', startmenu('report')),
100 endmenureport => join ('', endmenu('report')),
101 todaysdate => $todaysdate,
102 overdueloop => \@overduedata );
104 print "Content-Type: text/html\n\n", $template->output;