<?php
#########################################
# Скрипт онлайн игры "Симс"_____________#
# Автор: -=FеST=-_______________________#
# ICQ : 345-22-23 ______________________#
# Все права принадлежат автору(-=FeST=-)#
#########################################
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/adm_check.php';
include_once '../sys/inc/user.php';
$set['title']='The Sims';
include_once '../sys/inc/thead.php';
title();
err();
aut();

if(!isset($user)){
echo 'Вы неавторизованы';
include_once '../sys/inc/tfoot.php';
exit;
}

include_once 'inc/start.php';

$id = abs(intval($_GET['action']));		

switch($id){
default:
	
echo '<div class="'.$diz['post_1'].'"><img src="i/city.png" /> <b style="font-size:1.3em;"> Рейтинги</b><b style="font-size:1.3em;float:right;">'.date("H:i",time()).'</b></div>
<div class="'.$diz['post_2'].'"><b> По навыкам</b></div>
<div class="'.$diz['post_1'].'">
<img src="i/rating.png" /> <a href="rating.php?action=1"> Кулинария</a><br/>
<img src="i/rating.png" /> <a href="rating.php?action=2"> Обаяние</a><br/>
<img src="i/rating.png" /> <a href="rating.php?action=3"> Логика</a><br/>
<img src="i/rating.png" /> <a href="rating.php?action=4"> Медицина</a><br/>
<img src="i/rating.png" /> <a href="rating.php?action=5"> Культура тела</a><br/>
<img src="i/rating.png" /> <a href="rating.php?action=6"> Творчество</a><br/>
<img src="i/rating.png" /> <a href="rating.php?action=7"> Техника</a><br/>
<img src="i/rating.png" /> <a href="rating.php?action=8"> Уборка</a>
</div>
<div class="'.$diz['post_2'].'"><b> Активность в игре</b></div>
<div class="'.$diz['post_1'].'">
<img src="i/rating.png" /> <a href="rating.php?action=9"> Деньги</a><br/>
<img src="i/rating.png" /> <a href="rating.php?action=10"> Кредиты</a><br/>
<img src="i/rating.png" /> <a href="rating.php?action=11"> Время в игре</a>
</div>
';

break;

case'1':
echo '<div class="'.$diz['post_1'].'"><img src="i/city.png" /> <b style="font-size:1.3em;"> Топ 100</b><b style="font-size:1.3em;float:right;">'.date("H:i",time()).'</b></div>
<div class="'.$diz['post_2'].'"><b> Кулинария</b></div>';
$total=mysql_result(mysql_query("SELECT COUNT(*) FROM `sims_user` LIMIT 100"),0);
		if($total == 0)
		echo 'Нет игроков';
		else
		{
			$quert=mysql_query("SELECT * FROM `sims_user` ORDER BY `culinaria` DESC LIMIT ".$start.",5");
			
			while($array=mysql_fetch_array($quert)){
				
			
				
				echo '<div class="'.$diz['post_1'].'">
				<table cellpadding="0">
				<tr>
				<td>
				<img width="30" src="i/face_'.$array['face'].'.png" alt="." /> 
				</td>
				<td>

				 <a href="profile.php?id='.$array['id_u'].'"><b>'.$array['name'].' '.$array['fam'].'</b></a>
				<br/>
				Кулинария : '.$array['culinaria'].' ['.$array['culinaria_level'].' ур]
				</td></tr></table></div>';
			}
		
		if ($total > 5)
		echo sims_pagenav('rating.php?action='.$id.'&amp;', $start, $total, 5);
		}
		sims_ret($diz['ret'],'Рейтинг','rating.php');
	
break;

case'2':
echo '<div class="'.$diz['post_1'].'"><img src="i/city.png" /> <b style="font-size:1.3em;"> Топ 100</b><b style="font-size:1.3em;float:right;">'.date("H:i",time()).'</b></div>
<div class="'.$diz['post_2'].'"><b> Обаяние</b></div>';
$total=mysql_result(mysql_query("SELECT COUNT(*) FROM `sims_user` LIMIT 100"),0);
		if($total == 0)
		echo 'Нет игроков';
		else
		{
			$quert=mysql_query("SELECT * FROM `sims_user` ORDER BY `obayanie` DESC LIMIT ".$start.",5");
			
			while($array=mysql_fetch_array($quert)){
				
			
				
				echo '<div class="'.$diz['post_1'].'">
				<table cellpadding="0">
				<tr>
				<td>
				<img width="30" src="i/face_'.$array['face'].'.png" alt="." /> 
				</td>
				<td>

				 <a href="profile.php?id='.$array['id_u'].'"><b>'.$array['name'].' '.$array['fam'].'</b></a>
				<br/>
				Обаяние : '.$array['obayanie'].' ['.$array['obayanie_level'].' ур]
				</td></tr></table></div>';
			}
		
		if ($total > 5)
		echo sims_pagenav('rating.php?action='.$id.'&amp;', $start, $total, 5);
		}
		sims_ret($diz['ret'],'Рейтинг','rating.php');
	
break;
case'3':
echo '<div class="'.$diz['post_1'].'"><img src="i/city.png" /> <b style="font-size:1.3em;"> Топ 100</b><b style="font-size:1.3em;float:right;">'.date("H:i",time()).'</b></div>
<div class="'.$diz['post_2'].'"><b> Логика</b></div>';
$total=mysql_result(mysql_query("SELECT COUNT(*) FROM `sims_user` LIMIT 100"),0);
		if($total == 0)
		echo 'Нет игроков';
		else
		{
			$quert=mysql_query("SELECT * FROM `sims_user` ORDER BY `logika` DESC LIMIT ".$start.",5");
			
			while($array=mysql_fetch_array($quert)){
				
			
				
				echo '<div class="'.$diz['post_1'].'">
				<table cellpadding="0">
				<tr>
				<td>
				<img width="30" src="i/face_'.$array['face'].'.png" alt="." /> 
				</td>
				<td>

				 <a href="profile.php?id='.$array['id_u'].'"><b>'.$array['name'].' '.$array['fam'].'</b></a>
				<br/>
				Логика : '.$array['logika'].' ['.$array['logika_level'].' ур]
				</td></tr></table></div>';
			}
		
		if ($total > 5)
		echo sims_pagenav('rating.php?action='.$id.'&amp;', $start, $total, 5);
		}
		sims_ret($diz['ret'],'Рейтинг','rating.php');
	
break;
case'4':
echo '<div class="'.$diz['post_1'].'"><img src="i/city.png" /> <b style="font-size:1.3em;"> Топ 100</b><b style="font-size:1.3em;float:right;">'.date("H:i",time()).'</b></div>
<div class="'.$diz['post_2'].'"><b> Медицина</b></div>';
$total=mysql_result(mysql_query("SELECT COUNT(*) FROM `sims_user` LIMIT 100"),0);
		if($total == 0)
		echo 'Нет игроков';
		else
		{
			$quert=mysql_query("SELECT * FROM `sims_user` ORDER BY `medicina` DESC LIMIT ".$start.",5");
			
			while($array=mysql_fetch_array($quert)){
				
			
				
				echo '<div class="'.$diz['post_1'].'">
				<table cellpadding="0">
				<tr>
				<td>
				<img width="30" src="i/face_'.$array['face'].'.png" alt="." /> 
				</td>
				<td>

				 <a href="profile.php?id='.$array['id_u'].'"><b>'.$array['name'].' '.$array['fam'].'</b></a>
				<br/>
				Медицина : '.$array['medicina'].' ['.$array['medicina_level'].' ур]
				</td></tr></table></div>';
			}
		
		if ($total > 5)
		echo sims_pagenav('rating.php?action='.$id.'&amp;', $start, $total, 5);
		}
		sims_ret($diz['ret'],'Рейтинг','rating.php');
	
break;
case'5':
echo '<div class="'.$diz['post_1'].'"><img src="i/city.png" /> <b style="font-size:1.3em;"> Топ 100</b><b style="font-size:1.3em;float:right;">'.date("H:i",time()).'</b></div>
<div class="'.$diz['post_2'].'"><b> Культура тела</b></div>';
$total=mysql_result(mysql_query("SELECT COUNT(*) FROM `sims_user` LIMIT 100"),0);
		if($total == 0)
		echo 'Нет игроков';
		else
		{
			$quert=mysql_query("SELECT * FROM `sims_user` ORDER BY `culture` DESC LIMIT ".$start.",5");
			
			while($array=mysql_fetch_array($quert)){
				
			
				
				echo '<div class="'.$diz['post_1'].'">
				<table cellpadding="0">
				<tr>
				<td>
				<img width="30" src="i/face_'.$array['face'].'.png" alt="." /> 
				</td>
				<td>

				 <a href="profile.php?id='.$array['id_u'].'"><b>'.$array['name'].' '.$array['fam'].'</b></a>
				<br/>
				Культура тела : '.$array['culture'].' ['.$array['culture_level'].' ур]
				</td></tr></table></div>';
			}
		
		if ($total > 5)
		echo sims_pagenav('rating.php?action='.$id.'&amp;', $start, $total, 5);
		}
		sims_ret($diz['ret'],'Рейтинг','rating.php');
	
break;
case'6':
echo '<div class="'.$diz['post_1'].'"><img src="i/city.png" /> <b style="font-size:1.3em;"> Топ 100</b><b style="font-size:1.3em;float:right;">'.date("H:i",time()).'</b></div>
<div class="'.$diz['post_2'].'"><b> Творчество</b></div>';
$total=mysql_result(mysql_query("SELECT COUNT(*) FROM `sims_user` LIMIT 100"),0);
		if($total == 0)
		echo 'Нет игроков';
		else
		{
			$quert=mysql_query("SELECT * FROM `sims_user` ORDER BY `tvorchesto` DESC LIMIT ".$start.",5");
			
			while($array=mysql_fetch_array($quert)){
				
			
				
				echo '<div class="'.$diz['post_1'].'">
				<table cellpadding="0">
				<tr>
				<td>
				<img width="30" src="i/face_'.$array['face'].'.png" alt="." /> 
				</td>
				<td>

				 <a href="profile.php?id='.$array['id_u'].'"><b>'.$array['name'].' '.$array['fam'].'</b></a>
				<br/>
				Творчество : '.$array['tvorchesto'].' ['.$array['tvorchesto_level'].' ур]
				</td></tr></table></div>';
			}
		
		if ($total > 5)
		echo sims_pagenav('rating.php?action='.$id.'&amp;', $start, $total, 5);
		}
		sims_ret($diz['ret'],'Рейтинг','rating.php');
	
break;
case'7':
echo '<div class="'.$diz['post_1'].'"><img src="i/city.png" /> <b style="font-size:1.3em;"> Топ 100</b><b style="font-size:1.3em;float:right;">'.date("H:i",time()).'</b></div>
<div class="'.$diz['post_2'].'"><b> Техника</b></div>';
$total=mysql_result(mysql_query("SELECT COUNT(*) FROM `sims_user` LIMIT 100"),0);
		if($total == 0)
		echo 'Нет игроков';
		else
		{
			$quert=mysql_query("SELECT * FROM `sims_user` ORDER BY `tehnika` DESC LIMIT ".$start.",5");
			
			while($array=mysql_fetch_array($quert)){
				
			
				
				echo '<div class="'.$diz['post_1'].'">
				<table cellpadding="0">
				<tr>
				<td>
				<img width="30" src="i/face_'.$array['face'].'.png" alt="." /> 
				</td>
				<td>

				 <a href="profile.php?id='.$array['id_u'].'"><b>'.$array['name'].' '.$array['fam'].'</b></a>
				<br/>
				Техника : '.$array['tehnika'].' ['.$array['tehnika_level'].' ур]
				</td></tr></table></div>';
			}
		
		if ($total > 5)
		echo sims_pagenav('rating.php?action='.$id.'&amp;', $start, $total, 5);
		}
		sims_ret($diz['ret'],'Рейтинг','rating.php');
	
break;
case'8':
echo '<div class="'.$diz['post_1'].'"><img src="i/city.png" /> <b style="font-size:1.3em;"> Топ 100</b><b style="font-size:1.3em;float:right;">'.date("H:i",time()).'</b></div>
<div class="'.$diz['post_2'].'"><b> Уборка</b></div>';
$total=mysql_result(mysql_query("SELECT COUNT(*) FROM `sims_user` LIMIT 100"),0);
		if($total == 0)
		echo 'Нет игроков';
		else
		{
			$quert=mysql_query("SELECT * FROM `sims_user` ORDER BY `uborka` DESC LIMIT ".$start.",5");
			
			while($array=mysql_fetch_array($quert)){
				
			
				
				echo '<div class="'.$diz['post_1'].'">
				<table cellpadding="0">
				<tr>
				<td>
				<img width="30" src="i/face_'.$array['face'].'.png" alt="." /> 
				</td>
				<td>

				 <a href="profile.php?id='.$array['id_u'].'"><b>'.$array['name'].' '.$array['fam'].'</b></a>
				<br/>
				Уборка : '.$array['uborka'].' ['.$array['uborka_level'].' ур]
				</td></tr></table></div>';
			}
		
		if ($total > 5)
		echo sims_pagenav('rating.php?action='.$id.'&amp;', $start, $total, 5);
		}
		sims_ret($diz['ret'],'Рейтинг','rating.php');
	
break;
case'9':
echo '<div class="'.$diz['post_1'].'"><img src="i/city.png" /> <b style="font-size:1.3em;"> Топ 100</b><b style="font-size:1.3em;float:right;">'.date("H:i",time()).'</b></div>
<div class="'.$diz['post_2'].'"><b> Деньги</b></div>';
$total=mysql_result(mysql_query("SELECT COUNT(*) FROM `sims_user` LIMIT 100"),0);
		if($total == 0)
		echo 'Нет игроков';
		else
		{
			$quert=mysql_query("SELECT * FROM `sims_user` ORDER BY `money` DESC LIMIT ".$start.",5");
			
			while($array=mysql_fetch_array($quert)){
				
			
				
				echo '<div class="'.$diz['post_1'].'">
				<table cellpadding="0">
				<tr>
				<td>
				<img width="30" src="i/face_'.$array['face'].'.png" alt="." /> 
				</td>
				<td>

				 <a href="profile.php?id='.$array['id_u'].'"><b>'.$array['name'].' '.$array['fam'].'</b></a>
				<br/>
				Деньги : '.$array['money'].'
				</td></tr></table></div>';
			}
		
		if ($total > 5)
		echo sims_pagenav('rating.php?action='.$id.'&amp;', $start, $total, 5);
		}
		sims_ret($diz['ret'],'Рейтинг','rating.php');
	
break;
case'11':
echo '<div class="'.$diz['post_1'].'"><img src="i/city.png" /> <b style="font-size:1.3em;"> Топ 100</b><b style="font-size:1.3em;float:right;">'.date("H:i",time()).'</b></div>
<div class="'.$diz['post_2'].'"><b> Время в игре</b></div>';
$total=mysql_result(mysql_query("SELECT COUNT(*) FROM `sims_user` LIMIT 100"),0);
		if($total == 0)
		echo 'Нет игроков';
		else
		{
			$quert=mysql_query("SELECT * FROM `sims_user` ORDER BY `in_game` DESC LIMIT ".$start.",5");
			
			while($array=mysql_fetch_array($quert)){
				
			
				
				echo '<div class="'.$diz['post_1'].'">
				<table cellpadding="0">
				<tr>
				<td>
				<img width="30" src="i/face_'.$array['face'].'.png" alt="." /> 
				</td>
				<td>

				 <a href="profile.php?id='.$array['id_u'].'"><b>'.$array['name'].' '.$array['fam'].'</b></a>
				<br/>
				Время в игре : '.sims_timer($array['in_game']).'
				</td></tr></table></div>';
			}
		
		if ($total > 5)
		echo sims_pagenav('rating.php?action='.$id.'&amp;', $start, $total, 5);
		}
		sims_ret($diz['ret'],'Рейтинг','rating.php');
	
break;
case'10':
echo '<div class="'.$diz['post_1'].'"><img src="i/city.png" /> <b style="font-size:1.3em;"> Топ 100</b><b style="font-size:1.3em;float:right;">'.date("H:i",time()).'</b></div>
<div class="'.$diz['post_2'].'"><b> Кредиты</b></div>';
$total=mysql_result(mysql_query("SELECT COUNT(*) FROM `sims_user` LIMIT 100"),0);
		if($total == 0)
		echo 'Нет игроков';
		else
		{
			$quert=mysql_query("SELECT * FROM `sims_user` ORDER BY `credits` DESC LIMIT ".$start.",5");
			
			while($array=mysql_fetch_array($quert)){
				
			
				
				echo '<div class="'.$diz['post_1'].'">
				<table cellpadding="0">
				<tr>
				<td>
				<img width="30" src="i/face_'.$array['face'].'.png" alt="." /> 
				</td>
				<td>

				 <a href="profile.php?id='.$array['id_u'].'"><b>'.$array['name'].' '.$array['fam'].'</b></a>
				<br/>
				Кредиты : '.$array['credits'].'
				</td></tr></table></div>';
			}
		
		if ($total > 5)
		echo sims_pagenav('rating.php?action='.$id.'&amp;', $start, $total, 5);
		}
		sims_ret($diz['ret'],'Рейтинг','rating.php');
	
break;


}



sims_ret($diz['ret'],'В город','city.php');
sims_ret($diz['ret'],'Назад','index.php');
include_once '../sys/inc/tfoot.php';
?>
