Location: PHPKode > projects > ARBS > arbs-
 * 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
 * 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.

# If we don't know the right date then use today:
if (!isset($_GET['day']) or !isset($_GET['month']) or !isset($_GET['year'])){
	$day   = date("d",time());
	$month = date("m",time());
	$year  = date("Y",time());
else {
# Make the date valid if day is more then number of days in month:
	while (!checkdate($month, $day, $year))

if (isset($_GET['best'])){
	#parse list of all booked entrys and pass them to confirmpopup
        #this is better then extracting the entry in confirmpopup.php and destroyin the session there
        #because the user may reload confirmpoup.php this way
	foreach($_SESSION['session_booking_ids'] as $val){
	Header("Location: confirmpopup.php?confirm=".urlencode($confirm));
	exit ;
if (isset($_GET['abbruch'])){
	foreach($_SESSION['session_booking_ids'] as $key=>$val){
		if ($_SESSION['session_booking_rid'][$key]> 0){
			sql_query("DELETE FROM mrbs_repeat WHERE id=".$_SESSION['session_booking_rid'][$key]);
			sql_query("DELETE FROM mrbs_entry WHERE repeat_id="+$_SESSION['session_booking_rid'][$key]);
		sql_query("DELETE FROM mrbs_entry WHERE id=".$val);
	Header("Location: week.php");

if (isset($_GET['loeschen'])) {
		if ($_SESSION['session_booking_rid'][$nr]> 0){
			sql_query("DELETE FROM mrbs_repeat WHERE id=".$_SESSION['session_booking_rid'][$nr]);
			sql_query("DELETE FROM mrbs_entry WHERE repeat_id=".$_SESSION['session_booking_rid'][$nr]);
		sql_query("DELETE FROM mrbs_entry WHERE id=".$_SESSION['session_booking_ids'][$nr]);
		#remove entry from session_booking_ids,$session_booking_rid
		foreach($_SESSION['session_booking_ids'] as $key=>$val){

print_header($day, $month, $year, $area);

//form title
        foreach($titleformat as $val){//titleformat is a config value

echo "<br><br><table bgcolor=#000000 cellspacing=0 cellpadding=2 align=center><tr><td>
		<table bgcolor=#ffffff width=720 align=center cellspacing=0 cellpadding=0><tr><td bgcolor=#ffffff align=center>
		<font color=#cc0000><b>",
		_("You're logged in as Mr/Mrs:"),
		" $eetitle</b><br><u>",
		_("Please don't forget to confirm your order!"),

if (count($_SESSION['session_booking_ids']) <1){
	echo "<tr><td><table bgcolor=#ffffff width=720 align=center cellspacing=0 cellpadding=0><tr><td bgcolor=#C0E0FF align=center>";
	echo "<h3>",_("You didn't place a reservation."),"</h3></td></tr></table>";
foreach($_SESSION['session_booking_ids'] as $key=>$id){
	echo "<tr><td><table bgcolor=#ffffff width=720 align=center cellspacing=0 cellpadding=2>";
	$res=sql_query("SELECT r.room_name from mrbs_room as r left join mrbs_entry as e on r.id=e.room_id where e.id='$id'");
	echo "<tr><td bgcolor=#C0E0FF><h3>$room_name:</h3></td></tr><tr><td><font color=#009900 size=3><b><br>";
		$sql="SELECT start_time,end_time FROM mrbs_entry WHERE id='$id' ORDER BY start_time";
		echo "<li>".date("d.m.y, G:i",$zeile[0])," ", _("till"), " ", date("d.m.y, G:i",$zeile[1]);
		echo "&nbsp;&nbsp;&nbsp;";
		echo "<a href=\"korb_kompl.php?loeschen=j&nr=$key&year=$year&month=$month&day=$day\">",
			"</a>&nbsp;&nbsp;&nbsp;<a href=edit_entry.php?id=$id>",
		$sql="SELECT start_time,end_time,id FROM mrbs_entry WHERE repeat_id='".$_SESSION['session_booking_rid'][$key]."' ORDER BY start_time";
			#get first mrbs_entry.id in this series. only this id may be passed to edit_entry.php to change the series
			echo "<li>", date("d.m.y, G:i",$zeile[0]), " ", _("till"), " ", date("d.m.y, G:i",$zeile[1]);
		echo "&nbsp;&nbsp;&nbsp;";
		echo "<a href=korb_kompl.php?nr=$key&loeschen=j&year=$year&month=$month&day=$day>",
			_("Delete the series"),
			"</a>&nbsp;&nbsp;&nbsp;<a href=edit_entry.php?edit_type=series&id=",$change_id,">",
			_("Change the series"),
	echo "<br><br></td></tr></table></tr></td><tr><td>";

<table bgcolor=#ffffff width=100%><tr><td colspan=2>

echo "<form method=GET action=\"week.php\">
<input type=hidden name=year value=\"".$year."\">
<input type=hidden name=month value=\"".$month."\">
<input type=hidden name=day value=\"".$day."\">
<input type=hidden name=room value=\"".$_SESSION['session_last_room_id']."\">";

<input type=submit value="<?php echo(_("Add another reservation")); ?>"></form>
<form method=GET action=korb_kompl.php>
<input type=hidden name=best value=1>
<input style=font-weight:bold;color:#ff0000; type=submit value="<?php echo(_("Confirm reservation")); ?>"></form>

Return current item: ARBS