View file game/raiting.php

File size: 3.19Kb
<?php

include'inc/conf.php';
session_start();
$sql = mysql_query("SELECT * FROM `users` WHERE `id` = '".$_SESSION['id']."' ");
$row = mysql_fetch_array($sql);

$pass = mysql_real_escape_string(htmlspecialchars(stripslashes($_SESSION['pass'])));
$id = mysql_real_escape_string(htmlspecialchars(stripslashes($_SESSION['id'])));
$InterFace=mysql_real_escape_string(htmlspecialchars(stripslashes($_GET['InterFace'])));
if ($id == $row['id'] and md5($pass)==$row['pass']){


switch ($InterFace){

default:
$title='Рейтинги';
include'inc/up.php';

echo'<div class="post"><img class="ico2" src="img/pics/dir.png" alt=""><a href="?InterFace=1">Самые сильные</a></div>';
echo'<div class="post"><img class="ico2" src="img/pics/dir.png" alt=""><a href="?InterFace=2">Лучшая защита</a></div>';
echo'<div class="post"><img class="ico2" src="img/pics/dir.png" alt=""><a href="?InterFace=3">Самые скорые</a></div>';
echo'<div class="post"><img class="ico2" src="img/pics/dir.png" alt=""><a href="?InterFace=4">Большие удачники</a></div>';

break;

case 1:

$sql_rait=mysql_query("SELECT `id`,`login`,`power` FROM `users` LIMIT 30");

$title='Самые сильные';
include'inc/up.php';
echo'<div class="post">';
$num=0;
while($user=mysql_fetch_array($sql_rait)){
$num++;
echo''.$num.') <a href="info.php?ids='.$user['id'].'">'.$user['login'].'</a>, <strong>'.$user['power'].'</strong> атака.<br/>';

}
echo'</div>';
echo'<div class="rek"><img class="ico2" src="img/pics/dir.png" alt="-"><a href="raiting.php">Рейтинги</a></div>';
break;

case 2:

$sql_rait=mysql_query("SELECT `id`,`login`,`def` FROM `users` LIMIT 30");

$title='Лучшая защита';
include'inc/up.php';
echo'<div class="post">';
$num=0;
while($user=mysql_fetch_array($sql_rait)){
$num++;
echo''.$num.') <a href="info.php?ids='.$user['id'].'">'.$user['login'].'</a>, <strong>'.$user['def'].'</strong> защита.<br/>';

}
echo'</div>';
echo'<div class="rek"><img class="ico2" src="img/pics/dir.png" alt="-"><a href="raiting.php">Рейтинги</a></div>';
break;

case 3:

$sql_rait=mysql_query("SELECT `id`,`login`,`speed` FROM `users` LIMIT 30");

$title='Самые скорые';
include'inc/up.php';
echo'<div class="post">';
$num=0;
while($user=mysql_fetch_array($sql_rait)){
$num++;
echo''.$num.') <a href="info.php?ids='.$user['id'].'">'.$user['login'].'</a>, <strong>'.$user['speed'].'</strong> скорость.<br/>';

}
echo'</div>';
echo'<div class="rek"><img class="ico2" src="img/pics/dir.png" alt="-"><a href="raiting.php">Рейтинги</a></div>';
break;

case 4:

$sql_rait=mysql_query("SELECT `id`,`login`,`luck` FROM `users` LIMIT 30");

$title='Большие удачники';
include'inc/up.php';
echo'<div class="post">';
$num=0;
while($user=mysql_fetch_array($sql_rait)){
$num++;
echo''.$num.') <a href="info.php?ids='.$user['id'].'">'.$user['login'].'</a>, <strong>'.$user['luck'].'</strong> удача.<br/>';

}
echo'</div>';
echo'<div class="rek"><img class="ico2" src="img/pics/dir.png" alt="-"><a href="raiting.php">Рейтинги</a></div>';
break;


}

}

include'inc/foot.php';


?>