10 my $type=$input->param('type');
12 print startmenu('report');
26 my @datearr = localtime(time());
27 my $todaysdate = (1900+$datearr[5]).'-'.sprintf ("%0.2d", ($datearr[4]+1)).'-'.sprintf ("%0.2d", $datearr[3]);
29 print "<FONT SIZE=6><em>Items Overdue as of $todaysdate</em></FONT><br><P>";
32 <TABLE cellspacing=0 cellpadding=5 border=0 align=center>
34 <TD bgcolor="99cc33" background="/koha/images/background-mem.gif" colspan ><b>Due Date</b></td>
35 <TD bgcolor="99cc33" background="/koha/images/background-mem.gif" colspan ><b>Patron</b></td>
36 <TD bgcolor="99cc33" background="/koha/images/background-mem.gif"><b>Phone</b></td>
37 <TD bgcolor="99cc33" background="/koha/images/background-mem.gif"><b>Title</b></td>
38 <TD bgcolor="99cc33" background="/koha/images/background-mem.gif"><b>Author</b></td>
44 my $query="select date_due,borrowernumber,itemnumber from issues where isnull(returndate) && date_due<'$todaysdate' order by date_due,borrowernumber";
45 my $sth=$dbh->prepare($query);
47 while (my $data=$sth->fetchrow_hashref) {
48 $duedate=$data->{'date_due'};
49 $bornum=$data->{'borrowernumber'};
50 $itemnum=$data->{'itemnumber'};
52 my $query="select concat(firstname,' ',surname),phone,emailaddress from borrowers where borrowernumber='$bornum'";
53 my $sth1=$dbh->prepare($query);
55 $data1=$sth1->fetchrow_hashref;
56 $name=$data1->{'concat(firstname,\' \',surname)'};
57 $phone=$data1->{'phone'};
58 $email=$data1->{'emailaddress'};
61 my $query="select biblionumber from items where itemnumber='$itemnum'";
62 my $sth2=$dbh->prepare($query);
64 $data2=$sth2->fetchrow_hashref;
65 $biblionumber=$data2->{'biblionumber'};
68 my $query="select title,author from biblio where biblionumber='$biblionumber'";
69 my $sth3=$dbh->prepare($query);
71 $data3=$sth3->fetchrow_hashref;
72 $title=$data3->{'title'};
73 $author=$data3->{'author'};
77 print "<tr><td>$duedate</td><td>$name</td><td>$phone</td><td>$title</td><td>$author</td></tr>";
79 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>";
88 print endmenu('report');