Файл: vkolhoze.com/inc/shop2.php
Строк: 163
<?
require_header ('Магазин вещей');
echo '<div class="block">';
echo '<center><a href="?shoping">Оружие</a> | <a href="?shoping&armor">Броня</a> | <a href="?shoping&magic">Магическое</a> | <a href="?shoping&others">Дополнительное</a></center> ';
if(!isset($_GET['armor']) && !isset($_GET['magic']) && !isset($_GET['others'])){
if(!empty($_GET['buy']))
{
$resultat = mysql_query("SELECT * FROM `shop2` WHERE `id` = '".intval($_GET['buy'])."' AND `value` = '1'");
$result = mysql_num_rows($resultat);
$resultat = mysql_fetch_array($resultat);
if($result!=0)
{
if($ku['rubies']>=$resultat['cost'] && $ku['euro']>=$resultat['cost2']){
mysql_query("INSERT INTO `mspit` SET `user` = '".$ku['id']."', `id_wmot` = '".$resultat['id']."', `attack` = '".$resultat['attack']."', `defense`
= '".$resultat['defense']."', `health` = '".$resultat['health']."', `critical` = '".$resultat['critical']."', `value` = '1' ");
mysql_query("UPDATE `kolhoz_user` SET `rubies` = `rubies` - '".$resultat['cost']."',`euro` = `euro` - '".$resultat['cost2']."' WHERE `id` = '".$ku['id']."'");
header("Location:?shoping");
}
}
echo $result;
}
$weap = mysql_num_rows(mysql_query("SELECT * FROM `shop2` WHERE `value` = '1'"));
if($weap == '0')
{
echo 'Тут пусто';
}
$k_page=k_page($weap,$set['p_str']);
$page=page($k_page);
$start=$set['p_str']*$page-$set['p_str'];
$weapons = mysql_query("SELECT * FROM `shop2` WHERE `value` = '1' LIMIT $start, $set[p_str]");
while($q = mysql_fetch_array($weapons))
{
echo '<hr color="green"><img width="50" height="50" src="/images/shop/'.$q['id'].'.png" class="portrait"> '.$q['name'].'<div class="small minor"> '.($q['level']>=$PetMy['level']?'<div class="small minor"> Цена <img width="16" height="16" src="/images/icons/ruby.png"> '.$q['cost'].' '.($q['cost2']!=0?'<img width="16" height="16" src="/images/list.png"> '.$q['cost2'].'':null).'':'с '.$q['level'].' уровня').'';
echo "<br><img src='/images/icons/sword.png'>: <span class='title'>",$q['attack']," </span> | <img width='16' height='16' src='/images/icons/crit.png'>: <span class='title'>", $q['critical'],"% </span></div>";
echo '<br><center><a href="?shoping&weapon&buy='.$q['id'].'"><div class="knopka1"><img width="16" height="16" src="images/icons/money.png"> Приобрести</div></a></center></div>';
}
if($k_page>1)str("?shoping&weapon&",$k_page,$page);
}
if(isset($_GET['armor']))
{
if(!empty($_GET['buy']))
{
$resultat = mysql_query("SELECT * FROM `shop2` WHERE `id` = '".intval($_GET['buy'])."' AND `value` = '2'");
$result = mysql_num_rows($resultat);
$resultat = mysql_fetch_array($resultat);
if($result!=0)
{
if($ku['rubies']>=$resultat['cost'] && $ku['euro']>=$resultat['cost2']){
mysql_query("INSERT INTO `mspit` SET `user` = '".$ku['id']."', `id_wmot` = '".$resultat['id']."', `attack` = '".$resultat['attack']."', `defense`
= '".$resultat['defense']."', `health` = '".$resultat['health']."', `critical` = '".$resultat['critical']."',`value` = '2' ");
mysql_query("UPDATE `kolhoz_user` SET `rubies` = `rubies` - '".$resultat['cost']."',`euro` = `euro` - '".$resultat['cost2']."' WHERE `id` = '".$ku['id']."'");
header("Location:?shoping");
}
}
echo $result;
}
$weap = mysql_num_rows(mysql_query("SELECT * FROM `shop2` WHERE `value` = '2'"));
if($weap == '0')
{
echo 'Тут пусто';
}
$k_page=k_page($weap,$set['p_str']);
$page=page($k_page);
$start=$set['p_str']*$page-$set['p_str'];
$weapons = mysql_query("SELECT * FROM `shop2` WHERE `value` = '2' LIMIT $start, $set[p_str]");
while($q = mysql_fetch_array($weapons))
{
echo '<hr color="green"><img width="50" height="50" src="/images/shop/'.$q['id'].'.png" class="portrait"> '.$q['name'].'<div class="small minor"> '.($q['level']>=$PetMy['level']?'<div class="small minor"> Цена <img width="16" height="16" src="/images/icons/ruby.png"> '.$q['cost'].' '.($q['cost2']!=0?'<img width="16" height="16" src="/images/list.png"> '.$q['cost2'].'':null).'':'с '.$q['level'].' уровня').'';
echo "<br><img src='/images/icons/shield.png'>: <span class='title'>", $q['defense'],"</span> </div>";
echo '<br><center><a href="?shoping&armor&buy='.$q['id'].'"><div class="knopka1"><img width="16" height="16" src="images/icons/money.png"> Приобрести</div></a></center></div>';
}
if($k_page>1)str("?shoping&weapon&",$k_page,$page);
}
if(isset($_GET['magic']))
{
if(!empty($_GET['buy']))
{
$resultat = mysql_query("SELECT * FROM `shop2` WHERE `id` = '".intval($_GET['buy'])."' AND `value` = '3'");
$result = mysql_num_rows($resultat);
$resultat = mysql_fetch_array($resultat);
if($result!=0)
{
if($ku['rubies']>=$resultat['cost'] && $ku['euro']>=$resultat['cost2']){
mysql_query("INSERT INTO `mspit` SET `user` = '".$ku['id']."', `id_wmot` = '".$resultat['id']."', `attack` = '".$resultat['attack']."', `defense`
= '".$resultat['defense']."', `health` = '".$resultat['health']."', `critical` = '".$resultat['critical']."',`value` = '3'");
mysql_query("UPDATE `kolhoz_user` SET `rubies` = `rubies` - '".$resultat['cost']."',`euro` = `euro` - '".$resultat['cost2']."' WHERE `id` = '".$ku['id']."'");
header("Location:?shoping");
}
}
echo $result;
}
$weap = mysql_num_rows(mysql_query("SELECT * FROM `shop2` WHERE `value` = '3'"));
if($weap == '0')
{
echo 'Тут пусто';
}
$k_page=k_page($weap,$set['p_str']);
$page=page($k_page);
$start=$set['p_str']*$page-$set['p_str'];
$weapons = mysql_query("SELECT * FROM `shop2` WHERE `value` = '3' LIMIT $start, $set[p_str]");
while($q = mysql_fetch_array($weapons))
{
echo '<hr color="green"><img width="50" height="50" src="/images/shop/'.$q['id'].'.png" class="portrait"> '.$q['name'].'<div class="small minor"> '.($q['level']>=$PetMy['level']?'<div class="small minor"> Цена <img width="16" height="16" src="/images/icons/ruby.png"> '.$q['cost'].' '.($q['cost2']!=0?'<img width="16" height="16" src="/images/list.png"> '.$q['cost2'].'':null).'':'с '.$q['level'].' уровня').'';
echo "<br><img src='/images/icons/sword.png'>: <span class='title'>",$q['attack']," </span> | <img src='/images/icons/shield.png'>: <span class='title'>", $q['defense'],"</span> | <img src='/images/icons/heart.png'>: <span class='title'>", $q['health'], "</span> | <img width='16' height='16' src='/images/icons/crit.png'>: <span class='title'>", $q['critical'],"% </span></div>";
echo '<br><center><a href="?shoping&magic&buy='.$q['id'].'"><div class="knopka1"><img width="16" height="16" src="images/icons/money.png"> Приобрести</div></a></center></div>';
}
}
if(isset($_GET['others']))
{
if(!empty($_GET['buy']))
{
$resultat = mysql_query("SELECT * FROM `shop2` WHERE `id` = '".intval($_GET['buy'])."' AND `value` = '4'");
$result = mysql_num_rows($resultat);
$resultat = mysql_fetch_array($resultat);
if($result!=0)
{
if($ku['rubies']>=$resultat['cost'] && $ku['euro']>=$resultat['cost2']){
mysql_query("INSERT INTO `mspit` SET `user` = '".$ku['id']."', `id_wmot` = '".$resultat['id']."', `attack` = '".$resultat['attack']."', `defense`
= '".$resultat['defense']."', `health` = '".$resultat['health']."', `critical` = '".$resultat['critical']."',`value` = '4'");
mysql_query("UPDATE `kolhoz_user` SET `rubies` = `rubies` - '".$resultat['cost']."',`euro` = `euro` - '".$resultat['cost2']."' WHERE `id` = '".$ku['id']."'");
header("Location:?shoping");
}}
echo $result;
}
$PetMy = mysql_fetch_array(mysql_query("SELECT * FROM `mspit_user` WHERE `user` = '".$ku['id']."'"));
$weap = mysql_num_rows(mysql_query("SELECT * FROM `shop2` WHERE `value` = '4'"));
if($weap == '0')
{
echo 'Тут пусто';
}
$k_page=k_page($weap,$set['p_str']);
$page=page($k_page);
$start=$set['p_str']*$page-$set['p_str'];
$weapons = mysql_query("SELECT * FROM `shop2` WHERE `value` = '4' LIMIT $start, $set[p_str]");
while($q = mysql_fetch_array($weapons))
{
echo '<hr color="green"><img width="50" height="50" src="/images/shop/'.$q['id'].'.png" class="portrait"> '.$q['name'].'<div class="small minor">'.($q['level']>=$PetMy['level']?' Цена <img width="16" height="16" src="/images/icons/ruby.png"> '.$q['cost'].' '.($q['cost2']!=0?'<img width="16" height="16" src="/images/list.png"> '.$q['cost2'].'':null).'':'с '.$q['level'].' уровня').'';
echo "<br><img src='/images/icons/sword.png'>: <span class='title'>",$q['attack']," </span> | <img src='/images/icons/shield.png'>: <span class='title'>", $q['defense'],"</span> | <img src='/images/icons/heart.png'>: <span class='title'>", $q['health'], "</span> | <img width='16' height='16' src='/images/icons/crit.png'>: <span class='title'>", $q['critical'],"% </span></div>";
echo '<br><center><a href="?shoping&others&buy='.$q['id'].'"><div class="knopka1"><img width="16" height="16" src="images/icons/money.png"> Приобрести</div></a></center></div>';
}
}
echo '<a class="loc" href="?pvp"><img src="/images/icons/sword.png"> PvP Бои</a>';
echo '</div>';
include_once 'inc/foot.php';
?>