Файл: inc/cellar/change_recipes.php
Строк: 58
<?
$title='Рецепты';
include_once '../system/config.php';
if(isset($_GET['change_recipes']))
{
echo"<div class='rzd2'></div><div class='menuin2'>";
echo '<div class="title">Рецепты</h2></div>';
echo "<div class='content'>";
echo "<div class='div'>";
if(isset($_GET['select']) && intval($_GET['select'])!=NULL && mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_recipes` WHERE `id` = '".intval($_GET['select'])."' AND (`level` = '$ku[level]' OR `level` < '$ku[level]')"),0)!=0)
{
$recipes=mysql_fetch_array(mysql_query("SELECT * FROM `kolhoz_recipes` WHERE `id` = '".intval($_GET['select'])."'"));
mysql_query("UPDATE `kolhoz_user` SET `last_recipes` = '$recipes[id]' WHERE `id` = '$ku[id]'");
header("Location:/cellar");
exit;
}
$k_post = mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_recipes`"),0);
if ($k_post==0)
{
echo "Список пуст...";
}
$k_page=k_page($k_post,$set['p_str']);
$page=page($k_page);
$start=$set['p_str']*$page-$set['p_str'];
$q=mysql_query("SELECT * FROM `kolhoz_recipes` ORDER BY `level` ASC LIMIT $start, $set[p_str]");
echo "<ul>";
while($post=mysql_fetch_array($q))
{
echo "<li style='padding-bottom:8px'>";
echo "<img style='border-radius: 5px' width='48' height='48' src='/img/polka/$post[image].png' alt='o' class='portrait'>";
echo "<div class='small'>";
echo "".($ku['level']>=$post['level']?"<a href='/cellar/prescription/select/$post[id]'>":null)."<span>".hsc($post['name'])."</span>".($ku['level']>=$post['level']?"</a>":null)." <span class='minor'>, ".($ku['level']>=$post['level']?"цена: </span><span><img src='/img/icons/money.png' alt='o'><span class='n'>$post[cena]</span></span>":"доступно с $post[level] уровня</span>")."</div><div class='small minor'> Время приготовления:
<span class='n'>".time_left($post['time'])."</span><br>Доход: <img src='/img/icons/money.png' alt='o'> <span>$post[money]</span>, Опыт: <img src='/img/icons/experience.png' alt='o'> <span>$post[rating]</span>, Количество: <span>$post[count]</span> <span>банка</span></div></li>";
}
echo "</ul>";
if ($k_page>1)str("/cellar/prescription/",$k_page,$page); // Вывод страниц
echo "</div>";
echo"</div></div><div class='rzd2'></div>";
include_once '../system/foot.php';
}
?>