<?
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']='Nefes';
include_once '../sys/inc/thead.php';


echo 'Пишет:<br/>';
if (isset($_GET['ok']))
{
$id_razd = htmlspecialchars(mysql_real_escape_string($_GET['ok']));

$post = mysql_fetch_array(mysql_query("SELECT * FROM `us_guest` WHERE `id`='".$id_razd."' LIMIT 1"));
$ank = mysql_fetch_array(mysql_query("SELECT * FROM `user` WHERE `id`=$post[id_user] LIMIT 1"));
$g_adm = mysql_fetch_array(mysql_query("SELECT * FROM `user` WHERE `id`=$post[id_user_adm] LIMIT 1"));
$reply = htmlspecialchars(mysql_real_escape_string($_POST['reply']));

$msg2="Пользователь [b]$user[nick][/b] ответил(а) на ваше сообщение в своей [url=/us_guest/?id=$g_adm[id]]гостевой книге[/url]";
mysql_query("INSERT INTO `jurnal` (`id_user`, `id_kont`, `msg`, `time`) values('0', '$ank[id]', '$msg2', '$time')");
mysql_query("UPDATE `us_guest` SET `reply` = '$reply' WHERE `id` = '$post[id]' LIMIT 1");

header("Location: index.php?id=$post[id_user_adm]");
exit;
}

$id_razd = htmlspecialchars(mysql_real_escape_string($_GET['id']));

$post = mysql_fetch_array(mysql_query("SELECT * FROM `us_guest` WHERE `id`='".$id_razd."' LIMIT 1"));
$ank = mysql_fetch_array(mysql_query("SELECT * FROM `user` WHERE `id`=$post[id_user] LIMIT 1"));

echo ''.$post['msg'].'';
echo "<br/>---<br/>";
echo '<form method="post" action="reply.php?ok='.$id_razd.'">';
echo 'Ответ:<br/><textarea name="reply" rows="3" cols="17" style="width:80%"></textarea><br/>';
echo '<input type="submit" value="Ответить"/>';
echo '</form>';

echo '<span style="font-size:small">[<a href="/smiles/"><span style="color: #006666">смайлы</span></a>] [<a href="/lofes_info/translit.php"><span style="color: #006666">транслит</span></a>] [<a href="/lofes_info/tags.php"><span style="color: #006666">теги</span></a>]</span></div>';

include_once '../sys/inc/tfoot.php';


?>
