Просмотр файла modules/chat/clear_room.php

Размер файла: 1.21Kb
<?php
/**********************************
*	@package: PerfCMS			  *
*	@year: 2012					  *
*	@author: Artas				  *
*	@link: http://perfcms.pp.ua	  *
**********************************/
$locate = 'in_chat';
if(!isset($user) ||  $user['level'] < '6') { header('Location: /'); }
if(isset($_GET['room_id'])) {
if(isset($_POST['yes'])) {
$db->query("DELETE FROM `chat_p` WHERE `room_id` = '".abs(intval($_GET['room_id']))."'");
header('Location: /chat/room/'.$_GET['room_id'].'/');
	} elseif(isset($_POST['no'])) {
header('Location: /chat/room/'.$_GET['room_id'].'/');
	} 
$title = $lang->word('delete');
require_once(SYS.'/view/header.php');
$tpl->div('title', $lang->word('delete'));
echo '<form action="/chat/clear_room/?room_id='.abs(intval($_GET['room_id'])).'" method="post">
		<div class="menu">
			<b>'. $lang->word('r_sure') .'</b><br/>
			<input name="yes" type="submit" value="'. $lang->word('yyes') .'" /> <input name="no" type="submit" value="'. $lang->word('yno') .'" /><br/>
		</div>
		</form>';
		
$tpl->div('block', NAV .'<a href="/chat/">'. $lang->word('chat') .'</a><br/>' . HICO .'<a href="/">'. $lang->word('home').'</a>');
require_once(SYS.'/view/footer.php');
} else { header('Location: /'); }
?>