Файл: public_html/modules/library/delete_comment.php
Строк: 35
<?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';
$id = abs(intval($_GET['id']));
$id_note = abs(intval($_GET['id_note']));
$lib = $db->query("SELECT * FROM `library_comms` WHERE `id` = '".$id."'")->fetch();
if($user['level'] >=5 or $user['id'] == $lib['id_user']) {
if(isset($id)) {
if(isset($_POST['yes'])) {
$db->query("DELETE FROM `library_comms` WHERE `id` = '".abs(intval($_GET['id'])) ."'");
go('/library/'.$id_note.'/comments/');
} elseif(isset($_POST['no'])) {
go('/library/'.$id_note.'/comments/');
}
$title = $lang->word('delete');
require_once(SYS.'/view/header.php');
$tpl->div('title', $lang->word('delete'));
echo '<form action="/library/del_comm/?id='.$id.'&id_note='.$id_note.'" 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="/library/">'. $lang->word('library') .'</a><br/>' . HICO .'<a href="/">'. $lang->word('home').'</a>');
require_once(SYS.'/view/footer.php');
} else { go('/'); }
} else { go('/'); }
?>