View file modules/news/delete_news.php

File size: 1.1Kb
<?php
/**********************************
*	@package: PerfCMS			  *
*	@year: 2012					  *
*	@author: Artas				  *
*	@link: http://perfcms.pp.ua	  *
**********************************/
$locate = 'in_news';
if(!isset($user) ||  $user['level'] < '6') { go('/'); }
if(isset($_GET['news_id'])) {
if(isset($_POST['yes'])) {
$db->query("DELETE FROM `news` WHERE `id` = '".abs(intval($_GET['news_id'])) ."'");
go('/news/');
	} elseif(isset($_POST['no'])) {
go('/news/');
	} 
$title = $lang->word('delete');
require_once(SYS.'/view/header.php');
$tpl->div('title', $lang->word('delete'));
echo '<form action="/news/del_news/?news_id='.abs(intval($_GET['news_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="/news/">'. $lang->word('news') .'</a><br/>' . HICO .'<a href="/">'. $lang->word('home').'</a>');
require_once(SYS.'/view/footer.php');
} else { go('/'); }
?>