Файл: specical.php
Строк: 199
<?php
include 'inc/mysql.php';
include 'inc/check.php';
include ("inc/gzip.php");
if(isset($_SESSION['auth']) && $_SESSION['auth']==1){
include 'inc/shapka.php';
switch($_GET[mod]){
default:
echo'<img src="/pic/main/name.png" alt="*"/> Умения помогут тебе быстрее развить персонажа, поднять себе авторитет, и стать популярнее в игре...<hr>';
echo"* Каждое умение можно улучшить до <img src='/pic/main/up.png' alt='*'/> 5-го уровня<hr>";
if (('chat_clear') && isset($_GET['act']) && $_GET['act']=='clear')
{
$req = mysql_query("SELECT * FROM `specical` WHERE `id`='".mysql_real_escape_string($_GET['id'])."'");
$avto=mysql_num_rows($req);
if($avto==0){
header ("Location: specical.php?");
exit;
}
$req = mysql_query("SELECT * FROM `proffa` WHERE `id_account`='$account[id]' and `id_proffa`='".mysql_real_escape_string($_GET['id'])."'");
////////////////////////////
$avto=mysql_num_rows($req);
if($avto==1){
header ("Location: specical.php?");
exit;
}
$req = mysql_query("SELECT * FROM `specical` WHERE `id`='".mysql_real_escape_string($_GET['id'])."'");
////////////////////////////
$avto=mysql_num_rows($req);
if($avto>=1){
$mag = mysql_fetch_array($req);
if($account[zoloto]<$mag[cena]){
echo"<center><img src='/pic/main/nou.png' alt='*'/> Не хватает <img src='/pic/main/zoloto.gif' alt='*'/> золота.<hr></center>";
}else{
$req = mysql_query("SELECT `account` FROM `pahan` ");
////////////////////////////
$avto=mysql_num_rows($req);
if($avto>=1){
While($clan5 = mysql_fetch_array($req))
{
$cenas=$mag[cena]/10;
mysql_query("UPDATE `account` SET `kamen`=`kamen`+ '$cenas' WHERE `id`='$clan5[account]'");
mysql_query("UPDATE `pahan` SET `fermany`=`fermany`+ '$cenas' WHERE `account`='$clan5[account]'");
}}
if($mag[id]==3){
mysql_query("DELETE FROM `arena_boy` WHERE `account`='$account[id]'");
}
if($mag[id]==4){
$req = mysql_query("SELECT * FROM `arena_travma` WHERE `time`>'$time' and `account`='$account[id]'");
$avto=mysql_num_rows($req);
if($avto>=1){
mysql_query("UPDATE `arena_travma` SET `time`=`time` - '300' WHERE `account`='$account[id]'");
}
mysql_query("UPDATE `account` SET `travma`='5' WHERE `id`='$account[id]'");
}
mysql_query("UPDATE `account` SET `zoloto`=`zoloto`-'$mag[cena]' WHERE `id`='$account[id]'");
mysql_query("INSERT INTO `proffa` SET `id_account` = '$account[id]',`id_proffa` = '$mag[id]',`lvl` = '0',`lvl2` = '$mag[lvl]',`img` = '$mag[img]',`name` = '$mag[name]',`faq` = '$mag[faqs]',`cena` = '$mag[cena]',`priz` = '$mag[priz]'");
echo"<center><img src='/pic/main/oke.png' alt='*'/> Ништяк!<br> Умение <b>$mag[name]</b> изучено!<hr></center>";
}
}}
$req = mysql_query("SELECT * FROM `specical`ORDER by `cena` DESC");
////////////////////////////
$avto=mysql_num_rows($req);
if($avto>=1){
While($mag = mysql_fetch_array($req))
{
echo"$mag[img] <a href="specical.php?act=clear&id=$mag[id]">$mag[name]</a> ($mag[cena] <img src='/pic/main/zoloto.gif' alt='*'/>)<br>
<i>$mag[faq]</i><br>";
}
}else{
echo"<img src='/pic/main/!.png' alt='*'/> Нет умений.";
}
echo'<div class="ssl">';
echo"<a href="specical.php?mod=ymenie">  <img src="pic/menu/skola.png"> Мои умения</a></div>";
break;
case 'ymenie':
if (('chat_clear') && isset($_GET['act']) && $_GET['act']=='up')
{
$req = mysql_query("SELECT * FROM `proffa` WHERE `id_account`= '$account[id]' and `id_proffa`='".mysql_real_escape_string($_GET['id_proffa'])."' and `id`='".mysql_real_escape_string($_GET['id'])."'");
$avto=mysql_num_rows($req);
if($avto==0){
header ("Location: specical.php?mod=ymenie");
exit;
}
$req = mysql_query("SELECT * FROM `proffa` WHERE `id_account`= '$account[id]' and `id_proffa`='".mysql_real_escape_string($_GET['id_proffa'])."' and `id`='".mysql_real_escape_string($_GET['id'])."'");
////////////////////////////
$avto=mysql_num_rows($req);
if($avto>=1){
While($mag = mysql_fetch_array($req))
{
if ($mag[lvl]>="5"){
echo"<center><img src='/pic/main/nou.png' alt='*'/> Умение прокачано на максимум!<hr></center>";
}else{
if($mag[lvl]==0){
$cena=$mag[cena]/4;
}else{
if($mag[lvl]==1){
$cena=$mag[cena]/2;
}else{
if($mag[lvl]==2){
$cena=$mag[cena]/2*$mag[lvl];
}else{
if($mag[lvl]==3){
$cena=$mag[cena]/2*$mag[lvl];
}else{
if($mag[lvl]==4){
$cena=$mag[cena]/2*$mag[lvl];
}else{
if($mag[lvl]==5){
$cena=$mag[cena]/2*$mag[lvl];
}}}}}}
if($account[kamen]<$cena){
echo"<center><img src='/pic/main/nou.png' alt='*'/> Не хватает <img src='/pic/main/fermany.png' alt='*'/> фермани.<hr></center>";
}else{
$req = mysql_query("SELECT `account` FROM `pahan` ");
////////////////////////////
$avto=mysql_num_rows($req);
if($avto>=1){
While($clan5 = mysql_fetch_array($req))
{
$cenas=$mag[cena]/10;
mysql_query("UPDATE `account` SET `kamen`=`kamen`+ '$cenas' WHERE `id`='$clan5[account]'");
mysql_query("UPDATE `pahan` SET `fermany`=`fermany`+ '$cenas' WHERE `account`='$clan5[account]'");
}}
mysql_query("UPDATE `account` SET `kamen`=`kamen`- '$cena' WHERE `id`='$account[id]'");
if($mag[id_proffa]<=2){
mysql_query("UPDATE `proffa` SET `lvl`=`lvl`+ '1',`priz`=`priz`+ '5' WHERE `id`='".mysql_real_escape_string($_GET['id'])."'");
}else{
mysql_query("UPDATE `proffa` SET `lvl`=`lvl`+ '1',`priz`=`priz`+ '10' WHERE `id`='".mysql_real_escape_string($_GET['id'])."'");
mysql_query("DELETE FROM `arena_boy` WHERE `account`='$account[id]'");
}
header ("Location: specical.php?mod=ymenie");
}}}}}
$req = mysql_query("SELECT * FROM `proffa` WHERE `id_account`='$account[id]' ");
////////////////////////////
$avto=mysql_num_rows($req);
if($avto>=1){
While($mag = mysql_fetch_array($req))
{
echo"$mag[img] $mag[name] (<img src='/pic/main/up.png' alt='*'/> $mag[lvl]/$mag[lvl2])";
if($mag[lvl]==0){
$cena=$mag[cena]/4;
}else{
if($mag[lvl]==1){
$cena=$mag[cena]/2;
}else{
if($mag[lvl]==2){
$cena=$mag[cena]/2*$mag[lvl];
}else{
if($mag[lvl]==3){
$cena=$mag[cena]/2*$mag[lvl];
}else{
if($mag[lvl]==4){
$cena=$mag[cena]/2*$mag[lvl];
}else{
if($mag[lvl]==5){
$cena=$mag[cena]/2*$mag[lvl];
}}}}}}
if ($mag[lvl]<"5"){
echo"<a href="specical.php?mod=ymenie&act=up&id=$mag[id]&id_proffa=$mag[id_proffa]"> повысить</a> $cena <img src='/pic/main/fermany.png' alt='*'/>";
}
echo"<br>
<i>$mag[faq]</i><br>";
}}else{
echo"<img src='/pic/main/!.png' alt='*'/> У тебя нет умений.";
}
echo'<div class="ssl">';
echo"<a href="specical.php?">  <img src="pic/menu/skola.png"> Спецшкола</a></div>";
}
}else{
header ("Location: index.php"); exit;
}
include 'inc/nogi.php';
?>