Просмотр файла chat/manage.php

Размер файла: 1.48Kb
<?php

/*********************************************************************/
#---------------------------KokirCMS Соц сети-------------------------#
#---------------------Kiriyan и kokir Сайт kiriyan.org----------------#
#-------------------------------2012 г.-------------------------------#
#------------------Связь ICQ 455002004. [email protected]#
#----------------------------Пример ewwap.ru--------------------------#
/*********************************************************************/

require('../inc/head.php');

if($user['rights'] < 1)
  header("Location: index.php");

if(empty($_GET['id']) || !ctype_digit($_GET['id']))
  header("Location: index.php");

$id = $_GET['id'];

switch($mode)
{
  case 'delete':
    $path = 'index.php';
    if($httpReferer)
        $path = $httpReferer;

    mysql_query("DELETE FROM `chat` WHERE `id` = $id;");
    header("Location: $path");
  break;

/*********************************************************************/

  default:
    if(isset($_GET['accept']))
    {
        mysql_query("DELETE FROM `chat` WHERE `room` = $id;");
        header("Location: room.php?id={$id}");
    }

    echo '<div class="menu adm">';
    echo 'Вы уверены, что хотите очистить комнату?<br/>';
    echo '<a href="?id=' . $id . '&amp;accept">Да</a> | <a href="room.php?id=' . $id . '">Нет</a>';
    echo '</div>';
}

require('../inc/end.php');

?>