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 print startmenu('report');
44 my @datearr = localtime(time());
45 my $todaysdate = (1900+$datearr[5]).'-'.sprintf ("%0.2d", ($datearr[4]+1)).'-'.sprintf ("%0.2d", $datearr[3]);
47 print "<FONT SIZE=6><em>Items Overdue as of $todaysdate</em></FONT><br><P>";
50 <TABLE cellspacing=0 cellpadding=5 border=0 align=center>
52 <TD bgcolor="99cc33" background="/koha/images/background-mem.gif" colspan ><b>Due Date</b></td>
53 <TD bgcolor="99cc33" background="/koha/images/background-mem.gif" colspan ><b>Patron</b></td>
54 <TD bgcolor="99cc33" background="/koha/images/background-mem.gif"><b>Phone</b></td>
55 <TD bgcolor="99cc33" background="/koha/images/background-mem.gif"><b>Title</b></td>
56 <TD bgcolor="99cc33" background="/koha/images/background-mem.gif"><b>Author</b></td>
62 my $query="select date_due,borrowernumber,itemnumber from issues where isnull(returndate) && date_due<'$todaysdate' order by date_due,borrowernumber";
63 my $sth=$dbh->prepare($query);
65 while (my $data=$sth->fetchrow_hashref) {
66 $duedate=$data->{'date_due'};
67 $bornum=$data->{'borrowernumber'};
68 $itemnum=$data->{'itemnumber'};
70 my $query="select concat(firstname,' ',surname),phone,emailaddress from borrowers where borrowernumber='$bornum'";
71 my $sth1=$dbh->prepare($query);
73 $data1=$sth1->fetchrow_hashref;
74 $name=$data1->{'concat(firstname,\' \',surname)'};
75 $phone=$data1->{'phone'};
76 $email=$data1->{'emailaddress'};
79 my $query="select biblionumber from items where itemnumber='$itemnum'";
80 my $sth2=$dbh->prepare($query);
82 $data2=$sth2->fetchrow_hashref;
83 $biblionumber=$data2->{'biblionumber'};
86 my $query="select title,author from biblio where biblionumber='$biblionumber'";
87 my $sth3=$dbh->prepare($query);
89 $data3=$sth3->fetchrow_hashref;
90 $title=$data3->{'title'};
91 $author=$data3->{'author'};
95 print "<tr><td>$duedate</td><td>$name</td><td>$phone</td><td>$title</td><td>$author</td></tr>";
97 print "<tr><td>$duedate</td><td><a href=\"mailto:$email?subject=Overdue: $title\">$name</a></td><td>$phone</td><td>$title</td><td>$author</td></tr>";
106 print endmenu('report');