Файл: inc/cellar/mycellar.php
Строк: 159
<?
$title='Погреб';
$link='cellar';
include_once '../system/config.php';
echo '<img src="http://'.$_SERVER['HTTP_HOST'].'/img/general.jpg">';
if(isset($_GET['gos']))
{
if(isset($mc))
{
mysql_query("UPDATE `kolhoz_user` SET `last_recipes` = '$gos[id_plant2]' WHERE `id` = '$ku[id]'");
header("Location:/cellar");
exit;
}
else err_game("Для начала вступите в колхоз.");
}
echo"<div class='rzd2'></div><div class='menuin2'>";
echo "<div class='title'>Погреб</h2></div>";
if(isset($_SESSION['cp']))
{
echo "<div class='feedback'><ul class='feedbackPanel'><li class='feedbackPanelINFO'><span class='feedbackPanelINFO'>Полки теперь свободны, но сначала протрите их</span></li></ul></div>";
unset($_SESSION['cp']);
}
echo "<div class='content'>";
echo "<div class='div'>";
if($ku['str'] == 5) echo "<div><img src='/img/icons/up.png' alt='o'> <a href='/garden/LinkUserGoUpProfileGetSetting/'>Компактный вид</a></div>"; if($ku['str'] == 50) echo "<div><img src='/img/icons/down.png' alt='o'> <a href='/garden/LinkUserGoDownProfileGetSetting/'>Компактный вид</a></div>";
if($ku['str'] == 5) { echo "<a href='/cellar/'><img src='/img/icons/refresh.png' alt='o'></a> "; }else{ echo "<div><img src='/img/icons/refresh.png' alt='o'> <a href='/cellar/'>Обновить</a></div>"; }
if($ku['str'] == 5) {
if($ku['scarecrow_time']>$time)echo "<a class='epic' href='/shop/scarecrow'><img src='/img/icons/scarecrow.png' alt='o'></a> "; }else{ if($ku['scarecrow_time']>$time)echo "<li><img src='/img/icons/scarecrow.png' alt='o'> <a class='epic' href='/shop/scarecrow'>Пугало</a><span class='minor'> на <span>".time_left($ku['scarecrow_time']-$time)."</span></span></li>"; }
if($ku['str'] == 5) {
if($ku['time_shmel']>$time)echo "<a class='epic' href='/shop/helicopter/1'><img alt='o' src='/img/icons/heli1n.png'></a> "; }else{ if($ku['time_shmel']>$time)echo "<li><img alt='o' src='/img/icons/heli1n.png'> <a class='epic' href='/shop/helicopter/1'>Шмель</a><span class='minor'> на <span>".time_left($ku['time_shmel']-$time)."</span></span></li>"; }
if($ku['str'] == 5) {
if($ku['time_drakon']>$time)echo "<a class='epic' href='/shop/helicopter/3'><img alt='o' src='/img/icons/heli3n.png'></a> "; }else{ if($ku['time_drakon']>$time)echo "<li><img alt='o' src='/img/icons/heli3n.png'> <a class='epic' href='/shop/helicopter/3'>Дракон</a><span class='minor'> на <span>".time_left($ku['time_drakon']-$time)."</span></span></li>"; }
if($ku['str'] == 5)
{
if($ku['garden_vnuchka_time']>$time)echo "<a class='epic' href='/shop/garden/id/2'><img alt='o' width='16' height='16' src='/img/icons/garden2.png'></a> ";
}
else
{
if($ku['garden_vnuchka_time']>$time)echo "<li><img alt='o' width='16' height='16' src='/img/icons/garden2.png'> <a class='epic' href='/shop/garden/id/2'>Работник Внучка</a><span class='minor'> на <span>".time_left($ku['garden_vnuchka_time']-$time)."</span></span></li>";
}
echo "<ul>";
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_polka` WHERE `id_user` = '$ku[id]' AND (`time` < '$time' OR `time` = '$time') AND `id_recipes` != '0'"),0)!=0 && $ku['level']>1)echo "<div><img src='/img/icons/money.png' alt='o'> <a href='/cellar/SellAll/'>Продать всё</a></div>";
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_polka` WHERE `id_user` = '$ku[id]' AND `id_recipes` = '0' AND `clean` = '1'"),0)!=0 && $ku['level']>1)echo "<div><img src='/img/icons/cellar_put.png' alt='o'> <a href='/cellar/PutAll'>Заготовить все</a></div>";
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_polka` WHERE `id_user` = '$ku[id]' AND `id_recipes` = '0' AND (`time` = '$time' OR `time` < '$time') AND `clean` = '0'"),0)!=0 && $ku['level']>1)echo "<div><img src='/img/icons/clear.png' alt='o'> <a href='/cellar/ClearAll'>Протереть всё</a></div>";
////Полки
$k_post = mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_polka` WHERE `id_user` = '$ku[id]'"),0);
if ($k_post==0)
{
echo "Список пуст...";
}
$k_page=k_page($k_post,$ku['str']);
$page=page($k_page);
$start=$ku['str']*$page-$ku['str'];
$num=($page-1)*$ku['str'];
$q=mysql_query("SELECT * FROM `kolhoz_polka` WHERE `id_user` = '$ku[id]' ORDER BY `id` DESC LIMIT $start, $ku[str]");
while($post=mysql_fetch_array($q))
{
echo "<li>";
if($post['id_recipes']!=0 && mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_recipes` WHERE `id` = '$post[id_recipes]'"),0)!=0)$recipes=mysql_fetch_array(mysql_query("SELECT * FROM `kolhoz_recipes` WHERE `id` = '$post[id_recipes]'"));
echo "<li><img style='border-radius: 5px' width='48' height='48' src='/img/".(!isset($recipes)?"".($post['clean']==1?"polka.png":"polka.png")."":"polka/$recipes[image].png")."' alt='o' class='portrait'>";
echo "<div>";
echo "".(!isset($recipes)?"<span class='n'>".($post['clean']==1?"Чистая полка":"Пыльная полка")."</span>":"<span class='n'>".hsc($recipes['name'])."</span>".($post['time']>$time?"<span class='small minor'> (Будет готово через <span> ".time_left($post['time']-$time)."</span>)</span>":null)."")."";
echo "</div>";
echo "<div>";
if(isset($recipes))
{
if($post['time']<=$time)
{
echo "<img src='/img/icons/money.png' alt='o'> <a href='/cellar/sell/$post[id]'>Продать</a>";
}
else
{
}
}
else
{
echo "<span>";
if($ku['last_recipes']!=0 && mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_recipes` WHERE `id` = '$ku[last_recipes]'"),0)!=0)$lp=mysql_fetch_array(mysql_query("SELECT * FROM `kolhoz_recipes` WHERE `id` = '$ku[last_recipes]'"));
echo "".($post['clean']==1?"<img src='/img/icons/cellar_put.png' alt='o'> ".(isset($lp)?"<a href='/cellar/put/$post[id]/select/$lp[id]'>Заготовить <span>".hsc($lp['name'])."</span></a> <a href='/cellar/put/$post[id]'><span></span></a>":"<a href='/cellar/put/$post[id]'>Заготовить</a>")."":"<img src='/img/icons/clear.png' alt='o'> <a href='/cellar/clean/$post[id]'><span style='n'>Протереть</span></a>")."";
echo "</span>";
}
if(isset($recipes))unset($recipes);
echo "</div><div style='clear:both'></div></li>";
}
if ($k_page>1)str("/cellar/",$k_page,$page); // Вывод страниц
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_polka` WHERE `id_user` = '$ku[id]'"),0)<40)echo "<li><img style='border-radius: 5px' width='48' height='48' src='/img/polka.png' alt='o' class='portrait'><div><span class='n'>Новая полка</span></div><div><img src='/img/icons/cart.png' alt='o'> <a href='/cellar/NewShelf/'>Купить</a> за <span class='n'><img src='/img/icons/ruby.png' alt='o'><span>".cpg(mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_polka` WHERE `id_user` = '$ku[id]'"),0))."</span> рубинов</span></div><div style='clear:both'></div></li>";
//echo "</ul>";
if($ku['last_recipes']!=0 && mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_recipes` WHERE `id` = '$ku[last_recipes]'"),0)!=0)$lp=mysql_fetch_array(mysql_query("SELECT * FROM `kolhoz_recipes` WHERE `id` = '$ku[last_recipes]'"));
echo"<li><img src='/img/icons/cross.png' alt='o'> <a href='/cellar/ClearShelf/'>Очистить полки</a></li></ul>";
echo " <li><img src='/img/icons/last_recipes.png' alt='o'> <a href='/cellar/prescription/'>Последняя заготовка</a>: <span>".(isset($lp)?"".hsc($lp['name'])."":"отсутствует")."</span></li>";
echo ''.heliCall($link).'';
echo '</ul></div></div>';
echo"</div></div><div class='rzd2'></div>";
include_once '../system/foot.php';
?>