<?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';

	$place = sims_in($_GET['room']);
	if(!in_array($place,array('guest','room','kitchen','toilet')))
	$place = 'guest';
	$array = array('guest'=>'Гостинная','room'=>'Спальня','kitchen'=>'Кухня','toilet'=>'Туалет');
	$array2 = array('guest'=>'room_1','room'=>'room_4','kitchen'=>'room_3','toilet'=>'room_2');
	$room = $array2[$place];
	
	if(isset($_GET['buy']) && $sims_user['money']>400)
	{
		
		mysql_query("UPDATE `sims_user` SET `money`=`money`-400, `".$room."`=`".$room."`+1 WHERE `id_u`='".$user_id."'");
		header("Location:house.php");
		exit;
	
	}
	
echo '<div class="'.$diz['post_1'].'">
У вас в комнате '.$array[$place].' '.$sims_user[$room].' мест.<br/>
&raquo; <a href="buy_room.php?room='.$place.'&amp;buy">Купить место за 400 $</a>
</div>';

sims_ret($diz['ret'],'Мой дом','house.php');
sims_ret($diz['ret'],'Назад','index.php');
include_once '../sys/inc/tfoot.php';
?>
