Location: PHPKode > projects > ARBS > arbs-1.5.1.78/del_entry.php
<?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");
$id=(int)$_GET['id'];
$series=(int)$_GET['series'];
if(getAuthorised(getUserName(), getUserPassword(), 1) && ($info = mrbsGetEntryInfo($id))){
	$day   = strftime("%d", $info["start_time"]);
	$month = strftime("%m", $info["start_time"]);
	$year  = strftime("%Y", $info["start_time"]);
	$area  = mrbsGetRoomArea($info["room_id"]);

	sql_begin();
	$result = mrbsDelEntry(getUserName(), $id, $series, 1);
	sql_commit();
	if ($result){
		//we came here from the admin tool?
		if(isset($_GET['fromAdmin']))
			Header("Location: ".$_GET['view']);
		else{
			$view=isset($_GET['view'])?$_GET['view']:"week.php";
			if($view=="search"){
				Header("Location: search.php?search_str=".urlencode($_GET['search_str']));
			}
			else{
				$year=(int)$_GET['year'];
				$month=(int)$_GET['month'];
				$day=(int)$_GET['day'];
				$area=(int)$_GET['area'];
				$room=(int)$_GET['room'];				
				Header("Location: ".$_GET['view'].".php?day=$day&month=$month&year=$year&area=$area&room=$room");
			}
		}
		exit;
	}
}
// If you got this far then we got an access denied.
showAccessDenied(((int)$_GET['day']), ((int)$_GET['month']), ((int)$_GET['year']), ((int)$_GET['area']));
?>
Return current item: ARBS