Файл: sumerki.mobi/sumerki.mobi/shopscroll.php
Строк: 94
<?
//////////////////////////////////////////////////////////////
//////////////////////Онлайн игра "Сумерки"///////////////////
//////////////////////Основатель: Mc Laren////////////////////
///////////////////Контакты: ICQ - 597687549//////////////////
/////////////////////Пример: Sumerki.Mobi/////////////////////
///////////Если ты это читаешь, значит скрипт слили :D////////
//////////////////////////////////////////////////////////////
define('PROTECTOR', 1);
$headmod = 'shopelexirs';//фикс. места
$textl='Лавка Свитков';
include('files/path.php');
include('files/gzips.php');
include($path.'files/db.php');
include($path.'files/auth.php');
include($path.'files/func.php');
going();
ryd();
place_okr();
place_zamok();
include($path.'files/core.php');
include($path.'files/head.php');
include($path.'files/zag.php');
switch($_GET[mod]){
default:
echo '<div class="zagolovok"><div class="zagolovok1"> <div class="zagolovok2"><div class="zagolovok_right"></div><div class="zagolovok_left"></div><div class="ch_name">';
echo 'Свитки';
echo '</div><div class="clearFix"></div></div></div></div>';
$req = mysql_query("SELECT * FROM `shopscroll` WHERE `city` = '$udata[city]' and `tip`='scroll'");
////////////////////////////
$avto=mysql_num_rows($req);
While($mag = mysql_fetch_array($req))
{
echo '<div class="fon bg"><div class="bg1"><div class="bg2"><div class="bg3"><div class="bg4"><div class="bg5"><div class="bg6"><div class="bg7"><div class="bg8">';
echo"<a href="shopscroll.php?mod=info&id=$mag[id]">$mag[name]</a> <br><img src="pic/tip/$mag[name].png" height=40 width=40> <br>
$mag[cena] серебра<br><a class="buuut" href="shopscroll.php?mod=sell&id=$mag[id]">Купить</a>";
echo '</div></div></div></div></div></div></div></div></div>';
}
echo "<div class='button pad_bot_5 pad'><a href="gorod.php?pl=shop_zone">    <img src='/theme/standart/images/galochka.png'/> Вернуться</a></div>";
break;
case 'info':
$req = mysql_query("SELECT * FROM `shopscroll` WHERE `city` = '$udata[city]' and `id`='".mysql_real_escape_string($_GET['id'])."'");
$avto=mysql_num_rows($req);
if($avto==0){
echo '<div class="fon bg"><div class="bg1"><div class="bg2"><div class="bg3"><div class="bg4"><div class="bg5"><div class="bg6"><div class="bg7"><div class="bg8">';
echo'Ошибка!';
echo '</div></div></div></div></div></div></div></div></div>';
include($path.'files/down.php');
include($path.'files/meny.php');
exit;
}
$mag = mysql_fetch_array($req);
switch($mag[what]){
case 'hp':
$tip='Жизнь';
break;
case 'mp':
$tip='Ману';
break;
}
echo '<div class="zagolovok"><div class="zagolovok1"> <div class="zagolovok2"><div class="zagolovok_right"></div><div class="zagolovok_left"></div><div class="ch_name">';
echo "$mag[name]";
echo '</div><div class="clearFix"></div></div></div></div>';
echo '<div class="fon bg"><div class="bg1"><div class="bg2"><div class="bg3"><div class="bg4"><div class="bg5"><div class="bg6"><div class="bg7"><div class="bg8">';
echo"<b>$mag[name]</b><br/>
<img src="pic/tip/$mag[name].png" height=40 width=40><br/>
Заточка на: ~$mag[give]<br/>
Описание: $mag[faq]";
echo '</div></div></div></div></div></div></div></div></div>';
echo "<div class='button pad_bot_5 pad'><a href="shopscroll.php">    <img src='/theme/standart/images/galochka.png'/> Вернуться</a></div>";
break;
case 'sell':
$req = mysql_query("SELECT * FROM `shopscroll` WHERE `city` = '$udata[city]' and `id`='".mysql_real_escape_string($_GET['id'])."'");
$avto=mysql_num_rows($req);
if($avto==0){
echo '<div class="fon bg"><div class="bg1"><div class="bg2"><div class="bg3"><div class="bg4"><div class="bg5"><div class="bg6"><div class="bg7"><div class="bg8">';
echo'Ошибка! Нет такой вещи!';
echo '</div></div></div></div></div></div></div></div></div>';
include($path.'files/down.php');
include($path.'files/meny.php');
exit;
}
$mag = mysql_fetch_array($req);
$nmoney=$udata[money]-$mag[cena];
if($nmoney<0){
echo '<div class="fon bg"><div class="bg1"><div class="bg2"><div class="bg3"><div class="bg4"><div class="bg5"><div class="bg6"><div class="bg7"><div class="bg8">';
echo'Не хватает серебра!';
echo '</div></div></div></div></div></div></div></div></div>';
include($path.'files/down.php');
include($path.'files/meny.php');
exit;
}
$req1 = mysql_query("SELECT * FROM `res` WHERE `usr` = '$log' and `lat_name` = '$mag[lat_name]'");
$res = mysql_fetch_array($req1);
$avto1=mysql_num_rows($req1);
if($avto1==0){
mysql_query("INSERT INTO
`res` SET
`usr` = '$log',
`name` = '$mag[name]',
`lat_name` = '$mag[lat_name]',
`tip` = '$mag[tip]',
`what` = '$mag[what]',
`give` = '$mag[give]',
`kol` = '1',
`cena` = '$mag[cena]'");
}else{
$nk=$res[kol]+1;
mysql_query("UPDATE `res` SET `kol` = '$nk' WHERE `usr` = '$log' and `lat_name` = '$mag[lat_name]'");
}
mysql_query("UPDATE users SET money = '$nmoney' WHERE usr = '$log'");
echo '<div class="zagolovok"><div class="zagolovok1"> <div class="zagolovok2"><div class="zagolovok_right"></div><div class="zagolovok_left"></div><div class="ch_name">';
echo 'Успешно!';
echo '</div><div class="clearFix"></div></div></div></div>';
echo '<div class="fon bg"><div class="bg1"><div class="bg2"><div class="bg3"><div class="bg4"><div class="bg5"><div class="bg6"><div class="bg7"><div class="bg8">';
echo"Вещь $mag[name] куплена и помещена в инвентарь!<br/>
Серебра потрачено: $mag[cena] серебра<br/>
Серебра осталось: $nmoney серебра";
echo '</div></div></div></div></div></div></div></div></div>';
echo "<div class='button pad_bot_5 pad'><a href="shopscroll.php">    <img src='/theme/standart/images/galochka.png'/> Вернуться</a></div>";
break;
}
include($path.'files/down.php');
include($path.'files/meny.php');
?>