Файл: admin/set_ads.php
Строк: 10
<?php
///Автор: Kurama
///bymas.ru/id17706
require ('../config/func.php');
require ('../config/header.php');
if($user['adm'] != 2){
header('Location: /');
die();
}
echo ' <div class="title">Удаление рекламы </div>';
switch(htmlspecialchars($_GET['s'])) {
case 'del':
$id = row($_GET['id']);
mysql_query("DELETE FROM `ads` where `id` = '".$id."'");
$_SESSION['notif'] = 'Удалено';
header('Location: /adm/ads/sett/');
die();
break;
default:
$a = mysql_query("SELECT * FROM `ads` ORDER BY `id`");
while($ads = mysql_fetch_assoc($a)) {
echo ' <div class="menu"><a href="'.$ads['url'].'"> '.$ads['name'].' </a> <a href="?s=del&id='.$ads['id'].'">[×]</a></div>';
}
}
require ('../config/footer.php');
?>