Файл: setk/mpets/magaz.php
Строк: 865
<?php
# МОД Удивительные питомцы
# Kiper
# 383991000
error_reporting(0);
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';
only_reg();
$action=htmlspecialchars(trim($_GET['a']));
switch ($action){
default:
$titles='Магазин';
include_once 'head.php';
echo '
<div class="content">
<div class="center">
<a class="green_button_cat" href="?a=veshi_cat"><img class="cat_icon" src="img/magazin/suit1.png"><span class="button_cont_cat">Одежда</span></a><a class="green_button_cat" href="?a=bonus"><img class="cat_icon" src="img/magazin/candy3.png"><span class="button_cont_cat">Бонусы</span></a><a class="green_button_cat" href="?a=eda"><img class="cat_icon" src="img/magazin/meat.png"><span class="button_cont_cat">Еда</span></a><a class="green_button_cat" href="?a=igra"><img class="cat_icon" src="img/magazin/mouse.png"><span class="button_cont_cat">Игры</span></a><a class="green_button_cat" href="?a=pets"><img class="cat_icon" src="img/magazin/avatar.png"><span class="button_cont_cat">Питомцы</span></a>
</div></div>
';
break;
case 'eda':
$titles='Еда';
include_once 'head.php';
$veshi=mysql_fetch_array(mysql_query("SELECT * FROM `mpets_eda` WHERE `id`='$mpets[eda]'"));
if (isset($_GET['ok']))
{
$eda_ok=mysql_fetch_array(mysql_query("SELECT * FROM `mpets_eda` WHERE `id`='".intval($_GET['ok'])."'"));
if ($mpets['monet']>=$eda_ok['cena']&&$mpets['urov']>=$eda_ok['urov']){
mysql_query("UPDATE `mpets` SET `monet` = '".intval($mpets['monet']-$eda_ok['cena'])."', `eda` = '".intval($eda_ok['id'])."' WHERE `id_user` = '".$user['id']."' LIMIT 1");
header("Location: index.php?");
}else{
echo '<div class="warning-block large_orange">Недостаточно монет</div>';
}
}
echo '<div class="content">';
if (isset($_GET['vse']))
$res = mysql_query("SELECT * FROM `mpets_eda`");
else
$res = mysql_query("SELECT * FROM `mpets_eda` WHERE `urov` >= '".$veshi['urov']."' LIMIT 5");
while ($post = mysql_fetch_array($res)){
echo '<div class="simple-block"><div class="block-top"><div class="in1"> </div><div class="in2"> </div><div class="in3"> </div></div><div class="block-mid"><div class="in1"><div class="in2"><img class="item_icon" src="img/eda/'.$post['id'].'.png" /><div class="text_item"><span class="span1"><span class="disabled">';
echo ''.$post['name'].'</span></span>';
echo '<span class="span2"><span class="disabled"><span class="buy_link_level">+<img class="price_img" src="img/icons/heart.png" />'.$post['serd'].' +<img class="price_img" src="img/icons/expirience.png" />'.$post['opit'].' за действие</span>';
echo '<br />';
if($post['id']==$veshi['id'])
echo ' Текущий предмет </span>
';elseif ($mpets['urov']>=$post['urov'])
echo '
<a class="buy_link_first" href="?a=eda&ok='.$post['id'].'"><span class="button_cont">Купить за <img src="img/icons/coin.png" class="price_img"/>'.$post['cena'].'</span></a><span class="buy_link"></span>
';else
echo '
<span class="buy_link_level">Требуется '.$post['urov'].' уровень</span>
';
if($user['level']>=3)
echo '<br/> <a href="?a=edit_eda&id='.$post['id'].'">Изменить</a>';
echo ' </span>
</div>
</div>
</div>
</div>
<div class="block-bot">
<div class="in1"> </div><div class="in2"> </div><div class="in3"> </div>
</div>
</div>
';
}
if (!isset($_GET['vse']))
echo'<div class="simple-block green"><div class="block-top"><div class="in1"> </div><div class="in2"> </div><div class="in3"> </div></div><div class="block-mid"><div class="in1"><div class="in2"><a href="?a=eda&vse"><img src="img/magazin/meat.png" height="16" />Показать все</a></div></div></div><div class="block-bot"><div class="in1"> </div><div class="in2"> </div><div class="in3"> </div></div></div>';
echo'<div class="simple-block green"><div class="block-top"><div class="in1"> </div><div class="in2"> </div><div class="in3"> </div></div><div class="block-mid"><div class="in1"><div class="in2"><a href="magaz.php?"><img src="img/icons/back.png" />Назад к категориям</a></div></div></div><div class="block-bot"><div class="in1"> </div><div class="in2"> </div><div class="in3"> </div></div></div>';
break;
case 'igra':
$titles='Игры';
include_once 'head.php';
$veshi=mysql_fetch_array(mysql_query("SELECT * FROM `mpets_igra` WHERE `id`='$mpets[igra]'"));
if (isset($_GET['ok']))
{
$eda_ok=mysql_fetch_array(mysql_query("SELECT * FROM `mpets_igra` WHERE `id`='".intval($_GET['ok'])."'"));
if ($mpets['monet']>=$eda_ok['cena']&&$mpets['urov']>=$eda_ok['urov']){
mysql_query("UPDATE `mpets` SET `monet` = '".intval($mpets['monet']-$eda_ok['cena'])."', `igra` = '".intval($eda_ok['id'])."' WHERE `id_user` = '".$user['id']."' LIMIT 1");
header("Location: index.php?");
}else{
echo '<div class="warning-block large_orange">Недостаточно монет</div>';
}
}
if (isset($_GET['vse']))
$res = mysql_query("SELECT * FROM `mpets_igra`");
else
$res = mysql_query("SELECT * FROM `mpets_igra` WHERE `urov` >= '".$veshi['urov']."' LIMIT 5");
while ($post = mysql_fetch_array($res)){
echo '
<div class="simple-block">
<div class="block-top">
<div class="in1"> </div><div class="in2"> </div><div class="in3"> </div>
</div>
<div class="block-mid">
<div class="in1"><div class="in2">
<img class="item_icon" src="img/igra/'.$post['id'].'.png" />
<div class="text_item">
<span class="span1">
<span class="disabled">
'.$post['name'].' </span>
</span>
<span class="span2">
<span class="disabled">
<span class="buy_link_level">+<img class="price_img" src="img/icons/heart.png" />'.$post['serd'].' +<img class="price_img" src="img/icons/expirience.png" />'.$post['opit'].' за действие</span><br />
';
if($post['id']==$veshi['id'])
echo ' Текущий предмет </span>
';elseif ($mpets['urov']>=$post['urov'])
echo '
<a class="buy_link_first" href="?a=igra&ok='.$post['id'].'"><span class="button_cont">Купить за <img src="img/icons/coin.png" class="price_img"/>'.$post['cena'].'</span></a><span class="buy_link"></span>
';else
echo '
<span class="buy_link_level">Требуется '.$post['urov'].' уровень</span>
';
if($user['level']>=3)
echo '<br/> <a href="?a=edit_igra&id='.$post['id'].'">Изменить</a>';
echo ' </span>
</div>
</div>
</div>
</div>
<div class="block-bot">
<div class="in1"> </div><div class="in2"> </div><div class="in3"> </div>
</div>
</div>
';
}
if (!isset($_GET['vse']))
echo'<div class="simple-block green"><div class="block-top"><div class="in1"> </div><div class="in2"> </div><div class="in3"> </div></div><div class="block-mid"><div class="in1"><div class="in2"><a href="?a=igra&vse"><img src="img/magazin/mouse.png" height="16" />Показать все</a></div></div></div><div class="block-bot"><div class="in1"> </div><div class="in2"> </div><div class="in3"> </div></div></div>';
echo'<div class="simple-block green"><div class="block-top"><div class="in1"> </div><div class="in2"> </div><div class="in3"> </div></div><div class="block-mid"><div class="in1"><div class="in2"><a href="magaz.php?"><img src="img/icons/back.png" />Назад к категориям</a></div></div></div><div class="block-bot"><div class="in1"> </div><div class="in2"> </div><div class="in3"> </div></div></div>';
break;
case 'veshi_magaz':
$id_cat=mysql_fetch_array(mysql_query("SELECT * FROM `mpets_veshi_cat` WHERE `id`='".intval($_GET['id'])."'"));
$titles='Одежда';
include_once 'head.php';
if($mpets['glamur']<$id_cat['glamur'])
header("Location: info.php?");
if (isset($_GET['kypit']))
{
$kypit_veshi=mysql_fetch_array(mysql_query("SELECT * FROM `mpets_veshi_magaz` WHERE `id`='".intval($_GET['kypit'])."'"));
$kypit_veshi_my=mysql_fetch_array(mysql_query("SELECT * FROM `mpets_veshi` WHERE `nomer`='".$kypit_veshi['nomer']."' AND `id_user`='".$user['id']."' "));
if ($mpets['monet']>=$kypit_veshi['cena']&&$mpets['glamur']>=$kypit_veshi['glamur']){
mysql_query("UPDATE `mpets` SET `monet` = '".intval($mpets['monet']-$kypit_veshi['cena'])."',`krasota` = '".intval($mpets['krasota']+$kypit_veshi['krasota'])."' WHERE `id_user` = '".$user['id']."' LIMIT 1");
mysql_query("UPDATE `mpets_veshi` SET `vesh` = '".intval($kypit_veshi['id'])."' WHERE `id` = '".$kypit_veshi_my['id']."' LIMIT 1");
echo '<div class="warning-block large_orange">Вы успешно купили '.$kypit_veshi['name'].'</div>';
}else{
echo '<div class="warning-block large_orange">Недостаточно монет</div>';
}
}
$res = mysql_query("SELECT * FROM `mpets_veshi_magaz` WHERE `cat` = '".$id_cat['id']."' LIMIT 100");
while ($post = mysql_fetch_array($res)){
echo '
<div class="simple-block">
<div class="block-top">
<div class="in1"> </div><div class="in2"> </div><div class="in3"> </div>
</div>
<div class="block-mid">
<div class="in1"><div class="in2">
<img class="item_icon" src="img/veshi/'.$post['id'].'.png" />
<div class="text_item">
<span class="span1">
'.$post['name'].'
</span>
';
if($post['vid']==1)
echo '<span class="span2">Одежда,';
elseif($post['vid']==2)
echo '<span class="span2">Аксессуар,';
else echo '<span class="span2">Украшение,';
echo ' +<img class="price_img" src="img/icons/beauty.png" />'.$post['krasota'].'<br />';
$id_veshi=mysql_fetch_array(mysql_query("SELECT * FROM `mpets_veshi` WHERE `id_user`='".$user['id']."' AND `nomer`='".$post['nomer']."' "));
$id_veshi_magaz=mysql_fetch_array(mysql_query("SELECT * FROM `mpets_veshi_magaz` WHERE `id`='".$id_veshi['vesh']."' "));
if($id_veshi['nomer']==$post['nomer']&&$id_veshi['vesh']!=0&&$id_veshi_magaz['cat']>=$post['cat'])
echo '<span class="buy_link">Ваша вещь лучше</span></span>';
else
echo '<a class="buy_link" href="?a=veshi_magaz&id='.$id_cat['id'].'&kypit='.$post['id'].'">Купить</a><span class="buy_link"> за <img src="img/icons/coin.png" class="price_img"/>'.$post['cena'].'</span></span>';
echo ' </div>
</div>
</div>
</div>
<div class="block-bot">
<div class="in1"> </div><div class="in2"> </div><div class="in3"> </div>
</div>
</div>
';
}
echo'<div class="simple-block green"><div class="block-top"><div class="in1"> </div><div class="in2"> </div><div class="in3"> </div></div><div class="block-mid"><div class="in1"><div class="in2"><a href="magaz.php?a=veshi_cat"><img src="img/icons/back.png" />Назад к категориям</a></div></div></div><div class="block-bot"><div class="in1"> </div><div class="in2"> </div><div class="in3"> </div></div></div>
';
break;
case 'veshi_cat':
$titles='Одежда';
include_once 'head.php';
$res = mysql_query("SELECT * FROM `mpets_veshi_cat` WHERE `glamur` <= '".$mpets['glamur']."' ORDER BY `id` DESC LIMIT 5");
while ($post = mysql_fetch_array($res)){
echo '<div class="simple-block">
<div class="block-top">
<div class="in1"> </div><div class="in2"> </div><div class="in3"> </div>
</div>
<div class="block-mid">
<div class="in1"><div class="in2">
<div class="set_item">
<span class="span1">
<a class="green_dark" href="?a=veshi_magaz&id='.$post['id'].'">
'.$post['name'].' </a>
<span class="green_dark font_13">(лучший выбор!)</span> </span>
<span class="span2">
';
$veshi_magaz=mysql_fetch_array(mysql_query("SELECT * FROM `mpets_veshi_magaz` WHERE `cat`='".$post['id']."'"));
echo '
<a href="?a=veshi_magaz&id='.$post['id'].'"><img class="item_icon" src="img/veshi/'.$veshi_magaz['id'].'.png" /></a>
<a href="?a=veshi_magaz&id='.$post['id'].'"><img class="item_icon" src="img/veshi/'.($veshi_magaz['id']+1).'.png" /></a>
<a href="?a=veshi_magaz&id='.$post['id'].'"><img class="item_icon" src="img/veshi/'.($veshi_magaz['id']+2).'.png" /></a>
<br />
<a href="?a=veshi_magaz&id='.$post['id'].'"><img class="item_icon" src="img/veshi/'.($veshi_magaz['id']+3).'.png" /></a>
<a href="?a=veshi_magaz&id='.$post['id'].'"><img class="item_icon" src="img/veshi/'.($veshi_magaz['id']+4).'.png" /></a>
<a href="?a=veshi_magaz&id='.$post['id'].'"><img class="item_icon" src="img/veshi/'.($veshi_magaz['id']+5).'.png" /></a>
<br />
</span>
</div>
</div>
</div>
</div>
<div class="block-bot">
<div class="in1"> </div><div class="in2"> </div><div class="in3"> </div>
</div>
</div>
';
}
echo'<div class="simple-block green"><div class="block-top"><div class="in1"> </div><div class="in2"> </div><div class="in3"> </div></div><div class="block-mid"><div class="in1"><div class="in2"><a href="magaz.php?"><img src="img/icons/back.png" />Назад к категориям</a></div></div></div><div class="block-bot"><div class="in1"> </div><div class="in2"> </div><div class="in3"> </div></div></div>
';
break;
case 'bonus':
$titles='Бонусы';
include_once 'head.php';
if (isset($_GET['kypit']))
{
$kypit_veshi=mysql_fetch_array(mysql_query("SELECT * FROM `mpets_bonus` WHERE `id`='".intval($_GET['kypit'])."'"));
$kypit_time=$kypit_veshi['time']*60*60;
if ($mpets['monet']>=$kypit_veshi['cena']){
mysql_query("UPDATE `mpets` SET `monet` = '".intval($mpets['monet']-$kypit_veshi['cena'])."',`bonus` = '".intval($kypit_veshi['id'])."',`bonus_time` = '".(time()+$kypit_time)."' WHERE `id_user` = '".$user['id']."' LIMIT 1");
echo '<div class="warning-block large_orange">Вы успешно купили '.$kypit_veshi['name'].'</div>';
}else
echo '<div class="warning-block large_orange">Недостаточно монет</div>';
}
$res = mysql_query("SELECT * FROM `mpets_bonus` LIMIT 5");
while ($post = mysql_fetch_array($res)){
echo '
<div class="simple-block">
<div class="block-top">
<div class="in1"> </div><div class="in2"> </div><div class="in3"> </div>
</div>
<div class="block-mid">
<div class="in1"><div class="in2">
<img class="item_icon" src="img/bonus/'.$post['id'].'.png" />
<div class="text_item">
<span class="span1">
'.$post['name'].'
</span>
<span class="span2">
Опыт +'.$post['proc'].'% на '.$post['time'].' часов<br />
';
if($mpets['bonus_time']>=time()&&$mpets['bonus']==$post['id'])
echo ' Текущий предмет </span>
';else
echo '<a class="buy_link" href="?a=bonus&kypit='.$post['id'].'">Купить</a><span class="buy_link"> за <img src="img/icons/coin.png" class="price_img"/>'.$post['cena'].'</span> ';
echo ' </span>
</div>
</div>
</div>
</div>
<div class="block-bot">
<div class="in1"> </div><div class="in2"> </div><div class="in3"> </div>
</div>
</div>
';
}
echo '<div class="c-block">Бонусы начинают действовать сразу после покупки</div>';
echo'<div class="simple-block green"><div class="block-top"><div class="in1"> </div><div class="in2"> </div><div class="in3"> </div></div><div class="block-mid"><div class="in1"><div class="in2"><a href="magaz.php?"><img src="img/icons/back.png" />Назад к категориям</a></div></div></div><div class="block-bot"><div class="in1"> </div><div class="in2"> </div><div class="in3"> </div></div></div>
';
break;
case 'pets':
$titles='Питомцы';
include_once 'head.php';
if (isset($_GET['ok'])&&$mpets['monet']>=500)
{
if ($mpets['monet']>=500){
mysql_query("UPDATE `mpets` SET `monet` = '".intval($mpets['monet']-500)."',`vid_pets` = '".intval($_GET['ok'])."' WHERE `id_user` = '".$user['id']."' LIMIT 1");
header("Location: info.php?");
}else echo '<div class="warning-block large_orange">Недостаточно монет</div>';
}
echo '
<div class="simple-block">
<div class="block-top">
<div class="in1"> </div><div class="in2"> </div><div class="in3"> </div>
</div>
<div class="block-mid">
<div class="in1"><div class="in2">
<img class="item_icon" src="img/avatar/avatarr1.png" />
<div class="text_item">
<span class="span1">
Игривая кошечка
</span>
<span class="span2">
Милейшее создание<br />';
if ($mpets['vid_pets']!=1)echo '<a class="buy_link" href="?a=pets&ok=1">Купить</a> за <img src="img/icons/coin.png" class="price_img"/>500';
else echo 'Текуший питомец!';
echo '</span>
</div></div></div></div>
<div class="block-bot">
<div class="in1"> </div><div class="in2"> </div><div class="in3"> </div>
</div></div>
';
/////Питомец 2
echo '
<div class="simple-block">
<div class="block-top">
<div class="in1"> </div><div class="in2"> </div><div class="in3"> </div>
</div>
<div class="block-mid">
<div class="in1"><div class="in2">
<img class="item_icon" src="img/avatar/avatarr2.png" />
<div class="text_item">
<span class="span1">
Влюбленная кошечка
</span>
<span class="span2">
Люблю тебя, мррр...<br />';
if ($mpets['vid_pets']!=2)echo '<a class="buy_link" href="?a=pets&ok=2">Купить</a> за <img src="img/icons/coin.png" class="price_img"/>500';
else echo 'Текуший питомец!';
echo '</span>
</div></div></div></div>
<div class="block-bot">
<div class="in1"> </div><div class="in2"> </div><div class="in3"> </div>
</div></div>
';
/////Питомец 3
echo '
<div class="simple-block">
<div class="block-top">
<div class="in1"> </div><div class="in2"> </div><div class="in3"> </div>
</div>
<div class="block-mid">
<div class="in1"><div class="in2">
<img class="item_icon" src="img/avatar/avatarr3.png" />
<div class="text_item">
<span class="span1">
Влюбленный котик
</span>
<span class="span2">
Очаровашка и лапочка<br />';
if ($mpets['vid_pets']!=3)echo '<a class="buy_link" href="?a=pets&ok=3">Купить</a> за <img src="img/icons/coin.png" class="price_img"/>500';
else echo 'Текуший питомец!';
echo '</span>
</div></div></div></div>
<div class="block-bot">
<div class="in1"> </div><div class="in2"> </div><div class="in3"> </div>
</div></div>
';
/////Питомец 4
echo '
<div class="simple-block">
<div class="block-top">
<div class="in1"> </div><div class="in2"> </div><div class="in3"> </div>
</div>
<div class="block-mid">
<div class="in1"><div class="in2">
<img class="item_icon" src="img/avatar/avatarr4.png" />
<div class="text_item">
<span class="span1">
Игривый котик
</span>
<span class="span2">
Поиграем? Мяу!<br />';
if ($mpets['vid_pets']!=4)echo '<a class="buy_link" href="?a=pets&ok=4">Купить</a> за <img src="img/icons/coin.png" class="price_img"/>500';
else echo 'Текуший питомец!';
echo '</span>
</div></div></div></div>
<div class="block-bot">
<div class="in1"> </div><div class="in2"> </div><div class="in3"> </div>
</div></div>
';
/////Питомец 5
echo '
<div class="simple-block">
<div class="block-top">
<div class="in1"> </div><div class="in2"> </div><div class="in3"> </div>
</div>
<div class="block-mid">
<div class="in1"><div class="in2">
<img class="item_icon" src="img/avatar/avatarr5.png" />
<div class="text_item">
<span class="span1">
Сиамская кошечка
</span>
<span class="span2">
Породистая кошечка<br />';
if ($mpets['vid_pets']!=5)echo '<a class="buy_link" href="?a=pets&ok=5">Купить</a> за <img src="img/icons/coin.png" class="price_img"/>500';
else echo 'Текуший питомец!';
echo '</span>
</div></div></div></div>
<div class="block-bot">
<div class="in1"> </div><div class="in2"> </div><div class="in3"> </div>
</div></div>
';
/////Питомец 6
echo '
<div class="simple-block">
<div class="block-top">
<div class="in1"> </div><div class="in2"> </div><div class="in3"> </div>
</div>
<div class="block-mid">
<div class="in1"><div class="in2">
<img class="item_icon" src="img/avatar/avatarr6.png" />
<div class="text_item">
<span class="span1">
Британский кот
</span>
<span class="span2">
Породистый котик<br />';
if ($mpets['vid_pets']!=6)echo '<a class="buy_link" href="?a=pets&ok=6">Купить</a> за <img src="img/icons/coin.png" class="price_img"/>500';
else echo 'Текуший питомец!';
echo '</span>
</div></div></div></div>
<div class="block-bot">
<div class="in1"> </div><div class="in2"> </div><div class="in3"> </div>
</div></div>
';
/////Питомец 7
echo '
<div class="simple-block">
<div class="block-top">
<div class="in1"> </div><div class="in2"> </div><div class="in3"> </div>
</div>
<div class="block-mid">
<div class="in1"><div class="in2">
<img class="item_icon" src="img/avatar/avatarr11.png" />
<div class="text_item">
<span class="span1">
Дракончик
</span>
<span class="span2">
Крылатый дракошка<br />';
if ($mpets['vid_pets']!=6)echo '<a class="buy_link" href="?a=pets&ok=11">Купить</a> за <img src="img/icons/coin.png" class="price_img"/>500';
else echo 'Текуший питомец!';
echo '</span>
</div></div></div></div>
<div class="block-bot">
<div class="in1"> </div><div class="in2"> </div><div class="in3"> </div>
</div></div>
';
/////Питомец 8
echo '
<div class="simple-block">
<div class="block-top">
<div class="in1"> </div><div class="in2"> </div><div class="in3"> </div>
</div>
<div class="block-mid">
<div class="in1"><div class="in2">
<img class="item_icon" src="img/avatar/avatarr10.png" />
<div class="text_item">
<span class="span1">
Хомячок
</span>
<span class="span2">
Толстый и добрый<br />';
if ($mpets['vid_pets']!=6)echo '<a class="buy_link" href="?a=pets&ok=10">Купить</a> за <img src="img/icons/coin.png" class="price_img"/>500';
else echo 'Текуший питомец!';
echo '</span>
</div></div></div></div>
<div class="block-bot">
<div class="in1"> </div><div class="in2"> </div><div class="in3"> </div>
</div></div>
';
/////Питомец 9
echo '
<div class="simple-block">
<div class="block-top">
<div class="in1"> </div><div class="in2"> </div><div class="in3"> </div>
</div>
<div class="block-mid">
<div class="in1"><div class="in2">
<img class="item_icon" src="img/avatar/avatarr9.png" />
<div class="text_item">
<span class="span1">
Лисичка
</span>
<span class="span2">
Хитрая бестия<br />';
if ($mpets['vid_pets']!=6)echo '<a class="buy_link" href="?a=pets&ok=9">Купить</a> за <img src="img/icons/coin.png" class="price_img"/>500';
else echo 'Текуший питомец!';
echo '</span>
</div></div></div></div>
<div class="block-bot">
<div class="in1"> </div><div class="in2"> </div><div class="in3"> </div>
</div></div>
';
echo '<div class="c-block orange_dark2">Здесь вы можете купить новые образы вашего питомца и менять их когда захотите. Старые образы при этом сохраняются</div>';
break;
case 'edit_eda':
$titles='Изменить еду';
include_once 'head.php';
if($user['level']<3)header("Location: info.php?");
$id=mysql_fetch_array(mysql_query("SELECT * FROM `mpets_eda` WHERE `id`='".$_GET['id']."'"));
if (isset($_GET['vipolneno']))
echo '<div class="warning-block large_orange"><span class="succes">Успешно изменены</span></div>';
echo '<div class="c-block large">';
if (isset($_GET['set']) && isset($_POST['ok']))
{
mysql_query("UPDATE `mpets_eda` SET `name` = '".mysql_real_escape_string(htmlspecialchars($_POST['name']))."', `name_vid` = '".mysql_real_escape_string(htmlspecialchars($_POST['name_vid']))."', `opit` = '".intval($_POST['opit'])."', `cena` = '".intval($_POST['cena'])."', `urov` = '".intval($_POST['urov'])."', `serd` = '".intval($_POST['serd'])."' WHERE `id` = '".intval($_GET['id'])."' LIMIT 1");
header("Location: ?a=eda&vse");
}
echo "<form method='post' action='?a=edit_eda&id=".$_GET['id']."&set'>n";
echo "Название :<br/> <input type='text' name='name' value='".$id['name']."' /><br />";
echo "Название (вид) :<br/> <input type='text' name='name_vid' value='".$id['name_vid']."' /><br />";
echo "Опыт :<br/> <input type='text' name='opit' value='".$id['opit']."' /><br />";
echo "Сердец :<br/> <input type='text' name='serd' value='".$id['serd']."' /><br />";
echo "Цена :<br/> <input type='text' name='cena' value='".$id['cena']."' /><br />";
echo "Уровень :<br/> <input type='text' name='urov' value='".$id['urov']."' /><br />";
echo "<input type='submit' name='ok' value='Изменить' />n";
echo '</div><div class="c-block large">';
echo '<span class="nowrap"><img class="price_img" src="img/icons/back.png" /> <a class="darkgreen_link" href="?a=eda">Назад </a></span>';
echo '</div>';
break;
case 'edit_igra':
$titles='Изменить игрушку';
include_once 'head.php';
if($user['level']<3)header("Location: info.php?");
$id=mysql_fetch_array(mysql_query("SELECT * FROM `mpets_igra` WHERE `id`='".$_GET['id']."'"));
if (isset($_GET['vipolneno']))
echo '<div class="warning-block large_orange"><span class="succes">Успешно изменены</span></div>';
echo '<div class="c-block large">';
if (isset($_GET['set']) && isset($_POST['ok']))
{
mysql_query("UPDATE `mpets_igra` SET `name` = '".mysql_real_escape_string(htmlspecialchars($_POST['name']))."', `name_vid` = '".mysql_real_escape_string(htmlspecialchars($_POST['name_vid']))."', `opit` = '".intval($_POST['opit'])."', `cena` = '".intval($_POST['cena'])."', `urov` = '".intval($_POST['urov'])."', `serd` = '".intval($_POST['serd'])."' WHERE `id` = '".intval($_GET['id'])."' LIMIT 1");
header("Location: ?a=igra&vse");
}
echo "<form method='post' action='?a=edit_igra&id=".$_GET['id']."&set'>n";
echo "Название :<br/> <input type='text' name='name' value='".$id['name']."' /><br />";
echo "Название (вид) :<br/> <input type='text' name='name_vid' value='".$id['name_vid']."' /><br />";
echo "Опыт :<br/> <input type='text' name='opit' value='".$id['opit']."' /><br />";
echo "Сердец :<br/> <input type='text' name='serd' value='".$id['serd']."' /><br />";
echo "Цена :<br/> <input type='text' name='cena' value='".$id['cena']."' /><br />";
echo "Уровень :<br/> <input type='text' name='urov' value='".$id['urov']."' /><br />";
echo "<input type='submit' name='ok' value='Изменить' />n";
echo '</div><div class="c-block large">';
echo '<span class="nowrap"><img class="price_img" src="img/icons/back.png" /> <a class="darkgreen_link" href="?a=eda">Назад </a></span>';
echo '</div>';
break;
exit;
}
include_once 'foot.php';
?>