Файл: transformerss/pages/admin/tp.php
Строк: 57
<?
if(isset($_POST['go_ot'])){
$otvet = $_POST['otvet'];
$id = $_POST['id_s'];
$date = time();
$db->Query("INSERT INTO `ot_sup` (`id_mes`,`user`,`text`,`date`)VALUES('$id','Support','$otvet','$date')") or die(mysql_error());
$db->Query("UPDATE support SET status='1' WHERE id='$id'");
echo "<span id='erorr' class='msgbox-error'>Тикет отправлен.</span>";
}
?>
<div align='center'>
<br>
<hr>
<div class="container">
<div class="row-fluid">
<div class="span12 well well-white">
<center>Тех. поддержка
</center>
</div>
</div>
</div>
<div class="container">
<div class="row-fluid">
<div class="span12 well well-white">
<?if(empty($_GET['id'])){
?>
<table width="100%" border="1" cellspacing="0" cellpadding="5" class="table table-bordered table-striped table-hover table25">
<tr class='lineb'>
<td width="30px" align="center">#</td>
<td align="center">Заголовок</td>
<td width="120px" align="center">От кого</td>
<td width="100px" align="center">Статус</td>
<td width="120px" align="center">Дата</td>
<td width="20px" align="center"></td>
</tr>
<?
$sql6 = $db->Query("SELECT id,user,title,date FROM support WHERE status='0' ORDER BY id DESC")or die(mysql_error());
while($_sql6=$db->FetchArray($sql6)){
$idd = $_sql6['id'];
$user = $_sql6['user'];
$title = $_sql6['title'];
$data = $_sql6['date'];
?>
<tr class='liney ell' style="border-bottom:1px solid #000;">
<td align="center"><?=$idd?></td>
<td><a href="?menu=adminka&sel=tp&id=<?=$idd?>" title="Дорогие инвесторы!"><?=$title?></a></td>
<td align="center"><?=$user?></td>
<td align="center">
Ожидает ответа</td>
<td align="center"><?=$data?></td>
</tr>
<?}?>
</table>
<?}if(isset($_GET['id'])){
$db->Query("UPDATE support SET status='1' WHERE id='$_GET[id]'");
$sql7 = $db->Query("SELECT id,user,title,text,date FROM support WHERE id='$_GET[id]' ORDER BY id DESC")or die(mysql_error());
$_sql7=$db->FetchArray($sql7);
$id_i = $_sql7['id'];
$user = $_sql7['user'];
$title = $_sql7['title'];
$text = $_sql7['text'];
?>
<hr>
<div style='border:1px solid #660066;border-radius:5px; padding:3px; background:#fff;'>
<div><b><?=$user?></b> (<?=date('M-d-Y h:i',$_sql7['date'])?>)</div>
<hr>
<div style='min-height:40px;'><?=$text?></div>
</div><br>
<hr><br>
<?
$sql8 = $db->Query("SELECT user,text,date FROM ot_sup WHERE id_mes='$id_i' ORDER BY id ASC")or die(mysql_error());
while($_sql8=$db->FetchArray($sql8)){
$user2 = $_sql8['user'];
$text2 = $_sql8['text'];
$title2 = $_sql8['date'];
?>
<hr>
<div style='border:1px solid #660066;border-radius:5px; padding:3px; background:#fff;'>
<div><b><?=$user2?></b> (<?=date('M-d-Y h:i',$title2)?>)</div>
<hr>
<div style='min-height:40px;'><?=$text2?></div>
</div><br>
<hr><br>
<?}?>
<form method="post" action="">
<textarea name="otvet" rows="5" style="width:90%"></textarea><br><br>
<input type="hidden" value="<?=$id_i?>" name="id_s">
<input type="submit" value="Ответить" name='go_ot' onclick=""><br>
</form>
<?}?>