<?php
/*
* ARBS - Advanced Resource Booking System
* Copyright (C) 2005-2007 ITMC der TU Dortmund
* Based on MRBS by Daniel Gardner <http://mrbs.sourceforge.net/>
*
* This program 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.
*
* This program 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 this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
include_once("glob_inc.inc.php");
$day=(int)$_GET['day'];
$month=(int)$_GET['month'];
$year=(int)$_GET['year'];
if(!getAuthorised(getUserName(), getUserPassword(), 1)){
showAccessDenied($day, $month, $year, $area);
exit;
}
$start_date = mktime($morningstarts ,0 , 0 , $month,$day,$year);
$end_date = mktime($eveningends , 0 , 0 , $month,$day,$year);
if(isset($_GET['printed'])==1)
sql_query("UPDATE mrbs_entry SET printed=1 WHERE start_time >= $start_date AND start_time <= $end_date AND printed=0 ORDER BY name");
$result = sql_query("SELECT id FROM mrbs_entry WHERE start_time >= $start_date AND start_time <= $end_date AND printed=0 ORDER BY name");
$anz = mysql_num_rows($result);
if($anz >0){
$done=array();
for($i=0;$i<$anz;$i++){
//already printed?
if(in_array(mysql_result($result,$i,0),$done))
continue;
//if this isnt the first row, print a pagebreakers
if($i>0)
echo '<h1 style="page-break-after:always">--</h1>';
#print matching entrys and save printed id's
$done=array_merge($done,drawTicket(mysql_result($result,$i,0),false));
}
echo '<a href="javascript:window.print()">', _("Print this page"), '</a>';
echo "<br><a href=print_all.php?".$_SERVER["QUERY_STRING"]."&printed=1>", _("Mark all as printed"), "</a></body></html>";
}
else{
echo '<center><u><b><font size="5">', sprintf(_("No reservations at %s"), date("d.m.Y",$start_date)), '</font></b></u><br><br><br><a href=javascript:history.back()>', _("back"), '</a></center>';
}
?>