File size: 2.88Kb
<?
/**
* @ PACKAGE = DCMS-SOCIAL
* @ AUTHOR = DARIK
*/
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';
// Только для пользователей
if (!isset($user))header("location: /index.php?");
// только для админов
if ($user['level'] == 0)header("location: /index.php?");
// ID
define ('id', isset( $_GET['id'] ) ? abs(intval($_GET['id'])) : 0);
$act = mysql_fetch_assoc(mysql_query("SELECT id,st,reason FROM `tickets` WHERE `id` = '".id."' LIMIT 1"));
// если только существует
if (!empty($act)) {
// только если не установлена причина
if($act['reason'] == null) {
// только для статусов закрыт и отклонено
if($act['st'] == 1 || $act['st'] == 2) {
// Отправка заявки
if (isset($_POST['reason']) && isset($user))
{
$reason = htmlspecialchars( $_POST['reason'] );
$mat = antimat($reason);
if ($mat)$err[] = 'В тексте сообщения обнаружен мат: ' . $mat;
if (strlen2($reason) > 501){ $err[] = 'Причина слишком длинная'; }
if (strlen2($reason) < 3){ $err[] = 'Короткая Причина'; }
if(!isset($err))
{
mysql_query("UPDATE `tickets` SET `reason` = '" .$reason. "' WHERE `id` = '" . id. "' LIMIT 1");
$_SESSION['message'] = 'Причина успешна установлена';
header("Location: /tickets/view/?id=".id."");exit;
}
}
// заголовок страницы
$set['title'] = 'Тех.поддержка : admin_panel : установка причины ';
// head
include_once '../../../sys/inc/thead.php';
title();
aut();
err();
// style
echo'
<link rel="stylesheet" href="/tickets/style.css" type="text/css" />
<form action="" method="post">
<div class="block_y">
<b>Причина отказа:</b><br>
<textarea name="reason" rows="5" cols="17" style="width:95%"></textarea><br>
<input type="submit" value="Установить">
</br>
Для того что бы убрать причину отказала установите статус на рассмотрение
</div>
</form>
<div class="block_y"><a href="/tickets/view/?id='.id.'"> Назад</a></div>
';
// foot
include_once '../../../sys/inc/tfoot.php';
//error
} else { header("Location: /tickets/view/?id=".id."");exit;}
} else { header("Location: /tickets/view/?id=".id."");exit;}
} else { header("Location: /tickets/");exit;}
?>