# Книга рецептов

"; echo "
"; echo "
"; if(isset($_GET['select']) && intval($_GET['select'])!=NULL && mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_plant2` WHERE `id` = '".intval($_GET['select'])."' AND (`level` < '$ku[level]' OR `level` = '$ku[level]')"),0)!=0) { $plant2=mysql_fetch_array(mysql_query("SELECT * FROM `kolhoz_plant2` WHERE `id` = '".intval($_GET['select'])."'")); $count=100; $cena=(($plant2['cena']*$count)/100)*115; $cena=floor($cena); if($ku['rubies']>=$cena) { $ku['rubies']=minus_rubies($cena); if(mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_market` WHERE `id_user` = '$ku[id]' AND `id_plant2` = '$plant2[id]' AND `arena` = '0'"),0)!=0) { $pw=mysql_fetch_array(mysql_query("SELECT * FROM `kolhoz_market` WHERE `id_user` = '$ku[id]' AND `id_plant2` = '$plant2[id]' AND `arena` = '0'"),0); mysql_query("UPDATE `kolhoz_market` SET `count` = '".($pw['count']+$count)."' WHERE `id` = '$pw[id]'"); } else mysql_query("INSERT INTO `kolhoz_market` SET `id_plant2` = '$plant2[id]', `id_user` = '$ku[id]', `count` = '$count', `arena` = '0'"); msg_game('Рецепт выбран'); } else { no_rubies($cena-$ku['rubies']); } } $k_post = mysql_result(mysql_query("SELECT COUNT(*) FROM `kolhoz_plant2`"),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_plant2` ORDER BY `level` ASC LIMIT $start, 10"); echo "

"; while($post=mysql_fetch_array($q)) { $count=100; $cena=(($post['cena']*$count)/100)*115; $cena=floor($cena); echo "
- ".($post['level']<=$ku['level']?"":"")."".hsc($post['name'])."".($post['level']<=$ku['level']?"":"").", 100 шт., цена: $cena
"; } echo "

"; if ($k_page>1)str("?buy_plant2&",$k_page,$page); // Вывод страниц echo "
"; include_once 'inc/foot.php'; ?>