Файл: www/mgame/mf/add.php
Строк: 22
<?php
include '../config.php';
include 'system.php';
div('Сказать');
echo '» <a href="/mafia/">В игру</a><br/><br/>';
if(!isset($_POST['msg'])){
if(isset($_GET['to_id'])){
$to_id=intval($_GET['to_id']);
$u=mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id`='$to_id'"));
$otv=htmlspecialchars(stripslashes($u['login'])).', ';}
echo '<form action="add.php';
if(isset($_GET['to_id'])){
echo '?to_id='.$to_id.'';}
echo '" method="POST">';
if(isset($_GET['to_id'])){
echo '<b>'.$u['login'].'</b> [id='.$to_id.']<br/>';
}else{
echo 'Чего скажем?<br/>';}
echo '<textarea name="msg" rows="5" cols="22">'.$otv.'</textarea><br/>';
if($aut['m_role']>9 && $u['m_role']>9 && $aut['m_live']=='1'){
echo '<select name="maf">
<option selected="selected" value="1">Мафии</option>
<option value="0">Всем</option>
</select><br/>';}
echo '<input type="submit" value="Сказать"></form>';
echo 'Дополнительно:<br/>';
echo '1. <a href="../smile/smile.php">Список смайлов</a><br/>';
echo '2. <a href="../smile/bb_code.php">Список BB кодов</a><br/>';
echo '3. <a href="../smile/translit.php">Транслит и антитранслит</a>';
if($to_id){
echo '<div class="msg1">';
echo '<a href="../info.php?id='.$to_id.'">Анкета</a><br/>';
echo '</div>';}
}else{
$msg=mysql_real_escape_string($_POST['msg']);
if($aut['m_role']>9 && $_POST['maf']=='1' && $aut['m_live']=='1')$m='1'; else $m='0';
mysql_query("insert into `maf_chat` (`id_user`,`msg`,`time`,`maf`) values ('$aut[id]','$msg','$time','$m')");
header("Location: /mf/");}
echo '</div>';
include '../foot.php';
echo '</div>';
?>