Файл: setk/contests/deleted_contest.php
Строк: 75
<?php
/*
Автор: WIZART
Сайт: WizartWM.RU
E-mail автора: bi3apt@gmail.com
*/
include_once '../sys/inc/home.php';
include_once H.'sys/inc/start.php';
include_once H.'sys/inc/compress.php';
include_once H.'sys/inc/sess.php';
include_once H.'sys/inc/settings.php';
include_once H.'sys/inc/db_connect.php';
include_once H.'sys/inc/ipua.php';
include_once H.'sys/inc/fnc.php';
include_once H.'sys/inc/user.php';
$c = mysql_fetch_assoc(mysql_query("SELECT * FROM `contests` WHERE `id` = '".intval($_GET['id'])."' LIMIT 1"));
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `contests` WHERE `id` = '".intval($_GET['id'])."' LIMIT 1"),0)==0){header("Location: /index.php?".SID);exit;}
$set['title']="Удаление конкурса - ".htmlspecialchars($c['name'])."";
include_once H.'sys/inc/thead.php';
title();
aut();
only_level(3);
if (isset($_POST['ok'])){
$q=mysql_query("SELECT * FROM `contests_users` WHERE `id_contest` = '$c[id]'");
while ($post = mysql_fetch_array($q)){
if (is_file(H.'contests/img/photo/'.$post['id'].'.png'))@unlink(H."contests/img/photo/$post[id].png");
}
mysql_query("DELETE FROM `contests_golos` WHERE `id_contest` = '$c[id]' LIMIT 1");
mysql_query("DELETE FROM `contests_users` WHERE `id_contest` = '$c[id]' LIMIT 1");
mysql_query("DELETE FROM `contests` WHERE `id` = '$c[id]' LIMIT 1");
msg("Конкурс успешно удален");
echo "<div class='foot'><img src='/style/icons/str.gif' alt=''><a href='/contests/'> Конкурсы</a></div>";
include_once H.'sys/inc/tfoot.php';
}
echo "<form method='post' action='?id=$c[id]&passgen'>Вы действительно хотите удалить конкурс <b>".htmlspecialchars($c['name'])."</b> ?<br/><input type='submit' name='ok' value='Да, удалить' style='width:97%;'></form>";
echo "<div class='foot'><img src='/style/icons/str.gif' alt=''><a href='/contests/contest.php?id=$c[id]'> ".htmlspecialchars($c['name'])."</a></div>";
echo "<div class='foot'><img src='/style/icons/str.gif' alt=''><a href='/contests/'> Конкурсы</a></div>";
include_once H.'sys/inc/tfoot.php';
?>