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

$set['title']='Зоопарк'; // caaieiaie no?aieou
include_once '../../sys/inc/thead.php';

echo "<div class=\"aut\">Зоопарк</div><br />";
only_reg(); // только для зарегистрированы

////////////////////////////////////////////
$fn=file_get_contents("count.sb");
if($fn!=""){
$nd=explode('|',$fn);
$tots = $nd[0];}
if ($tots==""){$tots="0";}
///////////////////////////////////////////
$q_c = mysql_query("SELECT COUNT(*) FROM `zoo` ORDER BY id ASC;");
$k_l=mysql_result($q_c, 0);
echo"Нас посетило <b>".$tots."</b> человек<br />";
echo"Кол-Во зверей : <b>$k_l</b><br/>";
$id=intval(@$_GET['id']);

$q = mysql_query("SELECT * FROM `zoo` WHERE `id`='$id';");
while ($m = mysql_fetch_array($q))
{

echo"<div class='aut'>Kличкa живoтнoгo:</div>";
echo"<b>".$m['klichka']."</b><br />";
echo"<div class='aut'>Порода живoтнoгo:</div>";
echo"".$m['poroda']."<br />";
echo"<div class='aut'>Описание живoтнoгo:</div>";
echo"".$m['opis']."<br />";

echo"<div class='aut'>Среда обитания:</div>";
echo"".$m['sreda']."<br />";
echo"<div class='aut'>Пол живoтнoгo:</div>";
if ($m['pol']==0){echo"Женский<br />";}
if ($m['pol']==1){echo"Мужской<br />";}
if ($m['pol']==2){echo"Средний<br />";}
echo"<div class='menu'>Звepь пoceлилcя: ".vremja($m['time'])."</div>";

//$user_n=mysql_fetch_array(mysql_query("Select `nick` from `user` where `id`='".$user['id']."' LIMIT 1;"));
//mysql_query("UPDATE `zoo` SET `nickname` = '".$user_n["nick"]."' WHERE `id` = '".$user['id']."';");
//mysql_query("UPDATE `zoo` SET `id_c` = '".$m['id_c']."' WHERE `id` = '".$user['id']."';");
//$user=mysql_fetch_array(mysql_query("Select `nickname` from `zoo` where `id`='".$m['id_c']."' LIMIT 1;"));
//$nikname = $user["nickname"];
//echo"Добавил ".($nikname)."<br />";
if ($user['id']==$m['id_c']) {echo"<a href='set.php?id_zv=".$m['id']."'>Изменить даннные</a><br />";}
}
echo"<a href='index.php?'>Зоопapк</a><br />";

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