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

Размер файла: 1.24Kb
<?php
/**********************************
*	@package: PerfCMS			  *
*	@year: 2012					  *
*	@author: Artas				  *
*	@link: http://perfcms.pp.ua	  *
**********************************/
$locate = 'in_chat';
if(!isset($user) ||  $user['level'] < '6') { header('Location: /'); }
$title = $lang->word('add_room');
require_once(SYS.'/view/header.php');
$tpl->div('title', $lang->word('add_room'));
if(isset($_POST['create']) && $_GET['act'] == 'create') {
$name = substr(input($_POST['name']), 0, 25);
$db->query("INSERT INTO `chat`(`name`) VALUES('".$name."')");
$tpl->div('menu', $lang->word('succ_add'));
$tpl->div('block', img('chat.png') .'<a href="/padmin/">'. $lang->word('chat') .'</a><br/>'. HICO .'<a href="/">'. $lang->word('home') .'</a>');
require_once(SYS.'/view/footer.php');
exit;
}
echo '<form action="/chat/add_room/?act=create" method="post">
		<div class="menu">
			<b>'. $lang->word('name') .'</b>:<br/>
			<input name="name" type="text" /><br/>
			<input name="create" type="submit" value="'. $lang->word('create') .'" /><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');
?>