Файл: mafia/whoroom.php
Строк: 30
<?
require'../includes.php';
$align='left';
$title='Кто в Мафии?';
aut();
head();
$rmmaf = check(intval($_GET['rmmaf']));
if (!ctype_digit($rmmaf)) { header("Location: index.php"); die; }
$us = $user['user'];
$mafiozi = 'Мафиози';
$mafid = 0;
$rmafaction = "mafaction".$rmmaf;
$rscores = "scores".$rmmaf;
$ringame = "ingame".$rmmaf;
$room="maf".$rmmaf;
$tm = $time-300;
$ingame = "";
$outgame = "";
$tm = $time-300;
$res=query("SELECT * FROM $room WHERE id >'".$tm."' group by who order by id desc");
$kol = mysql_affected_rows();
//if($num!=0)echo "<br/>";
echo "<b>В игре:</b><br/>";
for ($k = 0; $k < $kol; $k++){
$lines = mysql_fetch_assoc ($res);
$use = $lines["who"];
$user_id = $lines["usid"];
if($lines["who"]!=$mafiozi) $ssid = " <b>[".user_inf2($lines["who"],'sid')."]</b>";
$r = query("select * from $ringame WHERE gamer_id = '".$user_id."'");
$a = mysql_fetch_assoc($r);
$id_in_game = $a["id_in_game"];
if (mysql_affected_rows()!=0) $ingame = $ingame."$use$ssid($id_in_game), ";
else $outgame = $outgame."$use$ssid, ";
}
unset($lines);
echo "$ingame<br/>";
echo "<b>Вне игры:</b><br/>";
echo "$outgame<br/>";
echo '<br />';
echo gbinroom."<a href="maf.php?&rmmaf=1">В игру</a>".div;
echo gbinroom."<a href="../enter.php?">На Главную</a>".div;
foot();
?>