<?php

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/user.php';

if (isset($user))$ank['id']=$user['id'];
if (isset($_GET['id']))$ank['id']=intval($_GET['id']);
$ank=mysql_fetch_array(mysql_query("SELECT * FROM `user` WHERE `id` = $ank[id] LIMIT 1"));

$set['title']=$ank['nick'].' - участок ';
error_reporting (0);
include_once '../sys/inc/thead.php';
title();
aut();
//header("Content-type: application/vnd.wap.xhtml+xml");
header("Content-type: text/html");
echo "<link rel='stylesheet' href='style.css' type='text/css' /><center>";
echo "<div class='grad32'><img src='fermer.gif'></div><div class='ferm3'><img src='shop25.gif'><div class='grad16'>Участок</div></center>";
echo'<div class="ferm3">';
$r_house=mysql_query("SELECT * FROM `k_user_house` WHERE `type`='house' AND `uid`='".$ank['id']."'");
$r_court=mysql_query("SELECT * FROM `k_user_house` WHERE `type`='court' AND `uid`='".$ank['id']."'");
$r_shed=mysql_query("SELECT * FROM `k_user_house` WHERE `type`='shed' AND `uid`='".$ank['id']."'");
$r_fence=mysql_query("SELECT * FROM `k_user_house` WHERE `type`='fence' AND `uid`='".$ank['id']."'");
$r_door=mysql_query("SELECT * FROM `k_user_house` WHERE `type`='door' AND `uid`='".$ank['id']."'");
$akses=mysql_query("SELECT * FROM `k_user_house` WHERE `type`='akses' AND `uid`='".$ank['id']."'");
$akses_two=mysql_query("SELECT * FROM `k_user_house` WHERE `type`='akses_two' AND `uid`='".$ank['id']."'");
$akses_three=mysql_query("SELECT * FROM `k_user_house` WHERE `type`='akses_three' AND `uid`='".$ank['id']."'");

if(!mysql_num_rows($r_house)){
echo 'Отделка дома: Пусто<br/>';
}else{
while($row=mysql_fetch_assoc($r_house)){
echo 'Отделка дома: <a href="reeltor.php?p=info&amp;id='.$row['vid'].'">'.$row['name'].'</a>';
if($ank['id']==$user['id']){echo ' <a href="k_storage.php?p=snt&amp;id='.$row['id'].'">[убрать]</a>';};
echo '<br/>';
};
};


if(!mysql_num_rows($r_court)){
echo 'Отделка двора: Пусто<br/>';
}else{
while($row=mysql_fetch_assoc($r_court)){
echo 'Отделка двора: <a href="reeltor.php?p=info&amp;id='.$row['vid'].'">'.$row['name'].'</a>';
if($ank['id']==$user['id']){echo ' <a href="k_storage.php?p=snt&amp;id='.$row['id'].'">[убрать]</a>';};
echo '<br/>';
};
};


if(!mysql_num_rows($r_shed)){
echo 'Отделка сарая: Пусто<br/>';
}else{
while($row=mysql_fetch_assoc($r_shed)){
echo 'Отделка сарая: <a href="reeltor.php?p=info&amp;id='.$row['vid'].'">'.$row['name'].'</a>';
if($ank['id']==$user['id']){echo ' <a href="k_storage.php?p=snt&amp;id='.$row['id'].'">[убрать]</a>';
};
echo '<br/>';
};
};


if(!mysql_num_rows($r_fence)){
echo 'Отделка ограды: Пусто<br/>';
}else{
while($row=mysql_fetch_assoc($r_fence)){
echo 'Отделка ограды: <a href="reeltor.php?p=info&amp;id='.$row['vid'].'">'.$row['name'].'</a>';
if($ank['id']==$user['id']){echo ' <a href="k_storage.php?p=snt&amp;id='.$row['id'].'">[убрать]</a>';
};
echo '<br/>';
};
};


if(!mysql_num_rows($r_door)){
echo 'Отделка калитки(вход): Пусто<br/>';
}else{
while($row=mysql_fetch_assoc($r_door)){
echo 'Отделка калитки(вход): <a href="reeltor.php?p=info&amp;id='.$row['vid'].'">'.$row['name'].'</a>';
if($ank['id']==$user['id']){echo ' <a href="k_storage.php?p=snt&amp;id='.$row['id'].'">[убрать]</a>';
};
echo '<br/>';
};
};


if(!mysql_num_rows($akses)){
echo 'Будка для собаки: Пусто<br/>';
}else{
while($row=mysql_fetch_assoc($akses)){
echo 'Будка для собаки: <a href="reeltor.php?p=info&amp;id='.$row['vid'].'">'.$row['name'].'</a>';
if($ank['id']==$user['id']){echo ' <a href="k_storage.php?p=snt&amp;id='.$row['id'].'">[убрать]</a>';
};
echo '<br/>';
};
};


if(!mysql_num_rows($akses_two)){
echo 'Клумба: Пусто<br/>';
}else{
while($row=mysql_fetch_assoc($akses_two)){
echo 'Клумба: <a href="reeltor.php?p=info&amp;id='.$row['vid'].'">'.$row['name'].'</a>';
if($ank['id']==$user['id']){echo ' <a href="k_storage.php?p=snt&amp;id='.$row['id'].'">[убрать]</a>';
};
echo '<br/>';
};
};


if(!mysql_num_rows($akses_three)){
echo 'Клумба: Пусто<br/>';
}else{
while($row=mysql_fetch_assoc($akses_three)){
echo 'Клумба: <a href="reeltor.php?p=info&amp;id='.$row['vid'].'">'.$row['name'].'</a>';
if($ank['id']==$user['id']){echo ' <a href="k_storage.php?p=snt&amp;id='.$row['id'].'">[убрать]</a>';
};
echo '<br/>';
};
};


echo '<div class="grad16">Внешний вид участка :</div></div><div class="ferm2">';

$r_house=mysql_query("SELECT * FROM `k_user_house` WHERE `type`='house' AND `uid`='".$ank['id']."'");
$r_court=mysql_query("SELECT * FROM `k_user_house` WHERE `type`='court' AND `uid`='".$ank['id']."'");
$r_shed=mysql_query("SELECT * FROM `k_user_house` WHERE `type`='shed' AND `uid`='".$ank['id']."'");
$r_fence=mysql_query("SELECT * FROM `k_user_house` WHERE `type`='fence' AND `uid`='".$ank['id']."'");
$r_door=mysql_query("SELECT * FROM `k_user_house` WHERE `type`='door' AND `uid`='".$ank['id']."'");
$akses=mysql_query("SELECT * FROM `k_user_house` WHERE `type`='akses' AND `uid`='".$ank['id']."'");

echo '<br /><center>';
if(!mysql_num_rows($akses)){
echo '<a href="reeltor.php?p=akses"><img src="imghouse/akses.gif" alt=""/></a>';
}else{
while($row=mysql_fetch_assoc($akses)){
echo '<a href="reeltor.php?p=akses"><img src="imghouse/'.$row['path'].'" alt=""/></a>';
};
};

if(!mysql_num_rows($r_house)){
echo '<a href="reeltor.php?p=house"><img src="imghouse/house.gif" alt=""/></a><br />';
}else{
while($row=mysql_fetch_assoc($r_house)){
echo '<a href="reeltor.php?p=house"><img src="imghouse/'.$row['path'].'" alt=""/></a><br />';
};
};

if(!mysql_num_rows($r_court)){
echo '<a href="reeltor.php?p=court"><img src="imghouse/court.gif" alt=""/></a>';
}else{
while($row=mysql_fetch_assoc($r_court)){
echo '<a href="reeltor.php?p=court"><img src="imghouse/'.$row['path'].'" alt=""/></a>';
};
};


echo '</center><br />';
echo '<center>';
if(!mysql_num_rows($akses_two)){
echo '<a href="reeltor.php?p=akses_two"><img src="imghouse/akses_two.gif" alt=""/></a>';
}else{
while($row=mysql_fetch_assoc($akses_two)){
echo '<br /><a href="reeltor.php?p=akses_two"><img src="imghouse/'.$row['path'].'" alt=""/></a>';
};
};

if(!mysql_num_rows($akses_three)){
echo '<a href="reeltor.php?p=akses_three"><img src="imghouse/akses_three.gif" alt=""/></a>';
}else{
while($row=mysql_fetch_assoc($akses_three)){
echo '<a href="reeltor.php?p=akses_three"><img src="imghouse/'.$row['path'].'" alt=""/></a>';
};
};
echo'</center>';
if(!mysql_num_rows($r_fence)){
echo '<br /><center><a href="reeltor.php?p=fence"><img src="imghouse/fence.gif" alt=""/></a>';
}else{
while($row=mysql_fetch_assoc($r_fence)){
echo '<br /><center><a href="reeltor.php?p=fence"><img src="imghouse/'.$row['path'].'" alt=""/></a>';
};
};

if(!mysql_num_rows($r_shed)){
echo '<a href="reeltor.php?p=shed"><img src="imghouse/shed.gif" alt=""/></a>';
}else{
while($row=mysql_fetch_assoc($r_shed)){
echo '<a href="reeltor.php?p=shed"><img src="imghouse/'.$row['path'].'" alt=""/></a>';
};
};
if(!mysql_num_rows($r_door)){
echo '<a href="reeltor.php?p=door"><img src="imghouse/door.gif" alt=""/></a></center><br />';
}else{
while($row=mysql_fetch_assoc($r_door)){
echo '<br /><center><a href="reeltor.php?p=door"><img src="imghouse/'.$row['path'].'" alt=""/></a></center><br />';
};
};

echo '<div class="grad16">Рейтинг участка '.$ank[nick].'</div></div><div class="ferm3">';
include_once 'inc/popul.php';
echo "Обеспеченность: <span class=\"ank_d\">$ank_shikk</span><br />\n";
echo "Деловитость: <span class=\"ank_d\">$ank_delov</span><br />\n";
echo "Красота: <span class=\"ank_d\">$ank_glamur</span><br />\n";

if($socstatus>=0 && $socstatus<=499){echo 'Соц.статус : Колхозник ('.$socstatus.' %)<br />';}
elseif($socstatus>=500 && $socstatus<=999){echo 'Соц.статус : Продвинутый ('.$socstatus.' %)<br />';}
elseif($socstatus>=1000 && $socstatus<=1499){echo 'Соц.статус : Первый на деревне ('.$socstatus.' %)<br />';}



echo'<div class=\'foot\'>';
echo'<a href="k_storage.php"><img src="egg.png"> Мой склад</a><br>';
echo '<a href="reeltor.php"><img src="egg.png"> Магазин недвижимости</a><br />';
echo "<a href='my.php'><img src='egg.png'> На ферму</a><br/>";
echo "<a href='index.php'><img src='egg.png'> В игру</a>";
echo'</div></div>';

include_once '../sys/inc/tfoot.php';
?>