Файл: public_html/modules/library/add_note.php
Строк: 38
<?php
/**********************************
* @package: PerfCMS *
* @year: 2012 *
* @author: Artas *
* @link: http://perfcms.net *
* ------------------------------- *
* @package: PerfCMS Ultra *
* @year: 2013 *
* @author: wanya26ua & Tesla *
* @link: http://perfclub.ru *
**********************************/
$locate = 'in_library';
if($user['level'] < '5') { go('/'); }
$id = abs(intval($_GET['id']));
if($db->query("SELECT * FROM `library_cats` WHERE `id` = '". $id ."'")->rowCount() == 0) {
$title = $lang->word('library');
require_once(SYS.'/view/header.php');
$tpl->div('title', $lang->word('library'));
$tpl->div('menu', $lang->word('not_cat'));
$tpl->div('block', NAV.' <a href="/library/">'. $lang->word('library') .'</a><br/>' . HICO .' <a href="/">'. $lang->word('home') .'</a>');
require_once(SYS.'/view/footer.php');
exit;
}
if(isset($_POST['create']) && $_GET['act'] == 'create') {
$title = substr(input($_POST['title']), 0, 1000);
$text = substr(input($_POST['text']), 0, 300000);
$db->query("INSERT INTO `library`(`title`, `text`, `time`, `id_user`, `id_cat` ) VALUES('".$title."', '".$text."', '". time() ."', '".$user['id']."', '".$id."')");
go('/library/cat/'.$id.'/');
}
$title = $lang->word('add_note');
require_once(SYS.'/view/header.php');
$tpl->div('title', $lang->word('add_note'));
echo '<form action="/library/add/?id='.$id.'&act=create" method="post">
<div class="menu">
<b>'. $lang->word('name') .'</b>:<br/>
<input name="title" type="text" /><br/>
<b>'. $lang->word('message') .'</b>:<br/>
<textarea name="text" rows="5" cols="26"></textarea><br/>
<input name="create" type="submit" value="'. $lang->word('create') .'" /><br/>
</div>
</form>';
$tpl->div('block', NAV .'<a href="/library/">'. $lang->word('library') .'</a><br/>' . HICO .'<a href="/">'. $lang->word('home').'</a>');
require_once(SYS.'/view/footer.php');
?>