<?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_user = abs(intval($_GET['id_user']));		
$id = abs(intval($_GET['room']));		

	$count = mysql_result(mysql_query("SELECT COUNT(*) FROM `sims_user` WHERE `id_u`='".$id_user."'"),0);
	if($count == 0)
	$ank = $sims_user;
	else
	$ank = mysql_fetch_array(mysql_query("SELECT * FROM `sims_user` WHERE `id_u`='".$id_user."'"));
	
echo '<div class="'.$diz['post_1'].'">'.($ank['pol']=='Муж' ? '<img src="i/city_man.png" />' : '<img src="i/city_woman.png" />' ).' <b style="font-size:1.3em;"> '.$ank['name'].'</b><b style="font-size:1.3em;float:right;">'.date("H:i",time()).'</b></div>
<div class="'.$diz['post_1'].'"><table>
';
switch($id)
{
case'1':
	$all = mysql_query("SELECT * FROM `sims_i` WHERE `id_u`='".$ank['id_u']."' AND `place`='guest'");
	while($arr = mysql_fetch_array($all))
	{
	echo "<tr class='sims_post_1'>

				<td colspan='2'>

				<img src='i/b_".$arr['id_i'].".png' />

				</td>

				<td><b>".$arr['name']."</b><br/><div style='font-size:11px'>

				<img src='i/repair.png' />Износ : ".$arr['iznos']."%</div></td></tr>";
	}			
	break;
case'2':
	$all = mysql_query("SELECT * FROM `sims_i` WHERE `id_u`='".$ank['id_u']."' AND `place`='toilet'");
	while($arr = mysql_fetch_array($all))
	{
	echo "<tr class='sims_post_1'>

				<td colspan='2'>

				<img src='i/b_".$arr['id_i'].".png' />

				</td>

				<td><b>".$arr['name']."</b><br/><div style='font-size:11px'>

				<img src='i/repair.png' />Износ : ".$arr['iznos']."%</div></td></tr>";
	}			
	break;
case'3':
	$all = mysql_query("SELECT * FROM `sims_i` WHERE `id_u`='".$ank['id_u']."' AND `place`='kitchen'");
	while($arr = mysql_fetch_array($all))
	{
	echo "<tr class='sims_post_1'>

				<td colspan='2'>

				<img src='i/b_".$arr['id_i'].".png' />

				</td>

				<td><b>".$arr['name']."</b><br/><div style='font-size:11px'>

				<img src='i/repair.png' />Износ : ".$arr['iznos']."%</div></td></tr>";
	}			
	break;
case'4':
	$all = mysql_query("SELECT * FROM `sims_i` WHERE `id_u`='".$ank['id_u']."' AND `place`='room'");
	while($arr = mysql_fetch_array($all))
	{
	echo "<tr class='sims_post_1'>

				<td colspan='2'>

				<img src='i/b_".$arr['id_i'].".png' />

				</td>

				<td><b>".$arr['name']."</b><br/><div style='font-size:11px'>

				<img src='i/repair.png' />Износ : ".$arr['iznos']."%</div></td></tr>";
	}			
	break;

	
	
	}	
	

echo '</table></div>
';

sims_ret($diz['ret'],'В анкету','profile.php?id='.$ank['id_u']);
sims_ret($diz['ret'],'Назад','index.php');
include_once '../sys/inc/tfoot.php';
?>
