5 # Copyright 2000-2002 Katipo Communications
7 # This file is part of Koha.
9 # Koha is free software; you can redistribute it and/or modify it under the
10 # terms of the GNU General Public License as published by the Free Software
11 # Foundation; either version 2 of the License, or (at your option) any later
14 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
15 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
16 # A PARTICULAR PURPOSE. See the GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License along with
19 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
20 # Suite 330, Boston, MA 02111-1307 USA
30 my $type = $input->param('type');
32 my $theme = $input->param('theme'); # only used if allowthemeoverride is set
34 my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
36 template_name => "circ/overdue.tmpl",
40 flagsrequired => { reports => 1 },
56 my @datearr = localtime( time() );
58 ( 1900 + $datearr[5] ) . '-'
59 . sprintf( "%0.2d", ( $datearr[4] + 1 ) ) . '-'
60 . sprintf( "%0.2d", $datearr[3] );
62 my $dbh = C4::Context->dbh;
66 "select date_due,borrowernumber,itemnumber
68 where isnull(returndate) && date_due<? order by date_due,borrowernumber"
70 $sth->execute($todaysdate);
73 while ( my $data = $sth->fetchrow_hashref ) {
74 $duedate = format_date($data->{'date_due'});
75 $borrowernumber = $data->{'borrowernumber'};
76 $itemnum = $data->{'itemnumber'};
80 "select concat(firstname,' ',surname),phone,email from borrowers where borrowernumber=?"
82 $sth1->execute($borrowernumber);
83 $data1 = $sth1->fetchrow_hashref;
84 $name = $data1->{'concat(firstname,\' \',surname)'};
85 $phone = $data1->{'phone'};
86 $email = $data1->{'email'};
90 $dbh->prepare("select biblionumber from items where itemnumber=?");
91 $sth2->execute($itemnum);
92 $data2 = $sth2->fetchrow_hashref;
93 $biblionumber = $data2->{'biblionumber'};
97 $dbh->prepare("select title,author from biblio where biblionumber=?");
98 $sth3->execute($biblionumber);
99 $data3 = $sth3->fetchrow_hashref;
100 $title = $data3->{'title'};
101 $author = $data3->{'author'};
107 borrowernumber => $borrowernumber,
112 biblionumber => $biblionumber,
120 todaysdate => $todaysdate,
121 overdueloop => \@overduedata
124 output_html_with_http_headers $input, $cookie, $template->output;