Файл: mafia/who.php
Строк: 50
<?
require'../includes.php';
$tyu="left";
$title="Мафия";
head();
list($row, $myid, $ps, $fs1, $fs2) = check_login($link);
echo $fs1;
echo "$div1<b>Кто в мафии?</b><br />$div9";
$tm = time()-300;
$res = @query ("Select * from maf1 WHERE id > '".$tm."' group by usid order by id desc");
$kol = mysql_affected_rows();
echo "<a href="maf.php?$ses&rmmaf=1">Русская братва(".($kol).")</a><br />";
echo "<b>В игре:</b><br/>";
for ($k = 0; $k < $kol; $k++){
$lines = mysql_fetch_assoc ($res);
$user = $lines["who"];
$user_id = $lines["usid"];
$r = query("select * from ingame1 WHERE gamer_id = '".$user_id."'");
$a = mysql_fetch_assoc($r);
$id_in_game = $a["id_in_game"];
if (mysql_affected_rows()!=0) $ingame = $ingame."$user($id_in_game), ";
else $outgame = $outgame."$user, ";
}
unset($lines);
echo "$ingame";
if(empty($ingame)) echo "Никого нет...<br />";
if(!empty($ingame)) echo "<br/>";
echo "<b>Вне игры:</b><br/>";
echo "$outgame";
if(empty($outgame)) echo "Никого нет...<br />";
if(!empty($ingame)) echo "<br/>";
echo $div5;
$tm = time()-300;
$res2 = @query ("Select * from maf2 WHERE id > '".$tm."' group by usid order by id desc");
$kol2 = mysql_affected_rows();
echo "<a href="maf.php?$ses&rmmaf=2">Итальянская мафия(".($kol2).")</a><br />";
echo "<b>В игре:</b><br/>";
for ($k2 = 0; $k2 < $kol2; $k2++){
$lines2 = mysql_fetch_assoc ($res2);
$user2 = $lines2["who"];
$user_id2 = $line2["usid"];
$r2 = query("select * from ingame2 WHERE gamer_id = '".$user_id2."'");
$a2 = mysql_fetch_assoc($r2);
$id_in_game2 = $a2["id_in_game"];
if (mysql_affected_rows()!=0) $ingame2 = $ingame2."$user($id_in_game), ";
else $outgame2 = $outgame2."$user, ";
}
unset($lines2);
echo "$ingame2";
if(empty($ingame2)) echo "Никого нет...<br />";
if(!empty($ingame2)) echo "<br/>";
echo "<b>Вне игры:</b><br/>";
echo "$outgame2";
if(empty($outgame2)) echo "Никого нет...<br />";
if(!empty($ingame2)) echo "<br/>";
echo $div5;
$res3 = @query ("Select * from maf3 WHERE id > '".$tm."' group by usid order by id desc");
$kol3 = mysql_affected_rows();
echo "<a href="maf.php?$ses&rmmaf=3">Колумбийский кортель(".($kol3).")</a><br />";
echo "<b>В игре:</b><br/>";
for ($k3 = 0; $k3 < $kol3; $k3++){
$lines3 = mysql_fetch_assoc ($res3);
$user3 = $lines3["who"];
$user_id3 = $lines3["usid"];
$r3 = query("select * from ingame3 WHERE gamer_id = '".$user_id."'");
$a3 = mysql_fetch_assoc($r3);
$id_in_game3 = $a3["id_in_game"];
if (mysql_affected_rows()!=0) $ingame3 = $ingame3."$user($id_in_game), ";
else $outgame3 = $outgame3."$user, ";
}
unset($lines3);
echo "$ingame3";
if(empty($ingame3)) echo "Никого нет...<br />";
if(!empty($ingame3)) echo "<br/>";
echo "<b>Вне игры:</b><br/>";
echo "$outgame3";
if(empty($outgame3)) echo "Никого нет...<br />";
if(!empty($ingame3)) echo "<br/>";
echo $div5;
echo "$div1<a href="./?$ses">Мафия</a>$div9";
echo "$div1<a href="enter.php?$ses">На Главную</a>$div9";
foot();
?>