Файл: Zvanie/chat_del.php
Строк: 67
<?
include_once '../../sys/inc/start.php';
include_once '../../sys/inc/compress.php';
include_once '../../sys/inc/sess.php';
include_once '../../sys/inc/home.php';
include_once '../../sys/inc/settings.php';
include_once '../../sys/inc/db_connect.php';
include_once '../../sys/inc/ipua.php';
include_once '../../sys/inc/fnc.php';
include_once '../../sys/inc/user.php';
$set['title']='Удаление сообщения';
include_once '../../sys/inc/thead.php';
title();
aut();
?>
<link rel="stylesheet" href="style.css" type="text/css" />
<?
echo '<div class="men"><div class="razdel2"><div class="fonlog"><img src="img/logokr.png" alt="" class="icon"/></div></div></div>';
if ($user['level']<=3)
{
header("Location: index.php?".SID);
}else{
if (isset($_GET['id']) || !is_numeric($_GET['id']))
{
$news=mysql_fetch_array(mysql_query("select * from `otrad_chat` where `id`='".intval($_GET['id'])."';"));
}else{
echo "<td class='err'>";
echo 'Нет такого комментария!';
echo "</div>";
echo "<a href='chat.php'><div class='foot'>";
echo "<img src='img/atrelka.png'> <b>В чат</b>";
echo "</div></a>";
echo "<a href='index.php'><div class='foot'>";
echo "<img src='img/sterlaka.png'> <b>Гланая</b>";
echo "</div></a>";
include_once '../sys/inc/tfoot.php';
exit;
}
if (($news==0) || (!$news))
{
echo "<div class='err'>";
echo 'Нет такого сообщения!';
echo "</div>";
echo "<a href='chat.php'><div class='foot'>";
echo "<img src='img/stralka.png'> <b>В чат</b>";
echo "</div></a>";
echo "<a href='index.php'><div class='foot'>";
echo "<img src='img/strelka.png'> <b>Гланая</b>";
echo "</div></a>";
include_once '../sys/inc/tfoot.php';
exit;
}
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `otrad_chat` WHERE `id` = '".intval($_GET['id'])."'"),0)==1)
{
$post=mysql_fetch_assoc(mysql_query("SELECT * FROM `otrad_chatt` WHERE `id` = '".intval($_GET['id'])."' LIMIT 1"));
mysql_query("DELETE FROM `otrad_chat` WHERE `id` = '".$post['id']."'");
echo "<div class='msg'>";
echo 'сообщение успешно удалено!';
echo "</div>";
}
}
echo "<a href='chat.php'><div class='foot'>";
echo "<img src='img/strelka.png'> <b>В чат</b>";
echo "</div></a>";
echo "<a href='index.php'><div class='foot'>";
echo "<img src='img/strelka.png'> <b>Гланая</b>";
echo "</div></a>";
include_once '../../sys/inc/tfoot.php';
?>