<?@session_start();?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ru">

<head><meta http-equiv='content-type' content='application/xhtml+xml; charset=windows-1251'/>
<link rel="shortcut icon" href="../ico1.ico" type="image/x-icon" />
<title>Рудник</title>
<link rel="stylesheet" href="../styleN.css" type="text/css" />
</head>
<body>

<?

#У вас должна быть одета кирка
#вы должны находится возле рудника с жилой
#в рудной жиле должна быть руда

@include("../db.php");
//подключаем файл аккаунта

$db->openDB();
$vremya=time();
$ruda = rand(2,9);
$dob = $_GET['dob'];

$rTI=mysql_query("UPDATE gornoe_delo SET kol_vo=\"$ruda\",g_time=\"$vremya\" WHERE kol_vo=\"0\" AND $vremya-g_time>600");

$nnick=mysql_query("SELECT * FROM users WHERE NICK=\"$_SESSION[s]\"");
$nnick2=mysql_fetch_assoc($nnick);
if($vremya-$nnick2[gametime]>600){
include ("accaunt.php");
$AC->ACCAUNT();//Проверка Аккаунта
}
@$kirk = mysql_query("SET NAMES cp1251");
$kirk=mysql_query("SELECT * FROM inv WHERE IL_KEY=\"i.kirka\" AND ID_USERS=\"$_SESSION[s]\" AND IL_NO=\"1\"");
$PRlc=mysql_query("SELECT * FROM users WHERE NICK=\"$_SESSION[s]\"");
$PRlc2=mysql_fetch_assoc($PRlc);
$RUSI=mysql_query("SELECT * FROM inv WHERE IL_KEY=\"i.kirka\" AND ID_USERS=\"$_SESSION[s]\"");
$RUSI2=mysql_fetch_assoc($RUSI);
if($RUSI2[IL_MIN_PROCH]<1 AND $RUSI2[IL_NO]==1){
#Снижаем урон от оружия
#снимаем сломанное оружие
@$userDMG = mysql_query("SET NAMES cp1251");
$userDMG=mysql_query("SELECT * FROM users WHERE NICK=\"$_SESSION[s]\"");
$invDMG=mysql_query("SELECT * FROM inv WHERE ID_USERS=\"$_SESSION[s]\" AND IL_ALL_CLASS=\"weapon\" AND IL_NO=\"1\"");
$userDMG2=mysql_fetch_assoc($userDMG);
if($userDMG2[statys]==1){echo"вы призрак и не можете добывать руду";die;}
$invDMG2=mysql_fetch_assoc($invDMG);
$USDMGm=$userDMG2[DAMAGEmin]-$invDMG2[IL_MIN_DMG];
$USDMGma=$userDMG2[DAMAGEmax]-$invDMG2[IL_MAX_DMG];
$USDMGma2=$userDMG2[MG_DMGmin]-$invDMG2[IL_MAGD_MIN];
$USDMGma2=$userDMG2[MG_DMGmax]-$invDMG2[IL_MAGD_MAX];
$updUSERd=mysql_query("UPDATE users SET DAMAGEmin=\"$USDMGm\",DAMAGEmax=\"$USDMGma\",MG_DMGmin=\"$USDMGm2\",MG_DMGmax=\"$USDMGma2\" WHERE NICK=\"$_SESSION[s]\"");//обновляем урон
$updWEAP=mysql_query("UPDATE inv SET IL_NO=\"0\" WHERE IL_ALL_CLASS=\"weapon\"");//снимаем оружие
?>
<table width="450" align="center" border="1px">
<tr><td width="171" height="35" align="center" bgcolor="#A23232" ><b><font color="#FFE7BA">
Рудник</font></b>
</td></tr>
<tr><td width="171" height="35" align="left" bgcolor="#FFE7BA"><b><font color="#A23232">
<div class="menu"><li><a href="../game.php"><img src="../img/attck.png">
В игру</a></li></div></font></b>
</td></tr>

<tr>
<td height="10" align="center" valign="top"  bgcolor="#A23232">
<b><font color="#FFE7BA">  невозможно добывать руду сломанной киркой </font></b>
</td></tr>
<tr>
<td>
<?include("footer.php");?>
</td></tr>

</table>
<?
die;?>

<?
echo"<img src=\"../img/attck.png\"> <a href=\"../game.php?NICK=$_SESSION[s]&pass=$pass\">в игру</a>
<br/>невозможно добывать руду сломанной киркой";die;}

if(mysql_num_rows($kirk)<1){
?>
<table width="450" align="center" border="1px">
<tr><td width="171" height="35" align="center" bgcolor="#A23232" ><b><font color="#FFE7BA">
Рудник</font></b>
</td></tr>
<tr><td width="171" height="35" align="left" bgcolor="#FFE7BA"><b><font color="#A23232">
<div class="menu"><li><a href="../game.php"><img src="../img/attck.png">
В игру</a></li></div></font></b>
</td></tr>

<tr>
<td height="10" align="center" valign="top"  bgcolor="#A23232">
<b><font color="#FFE7BA">  Для добычи руды у вас должна быть одета кирка </font></b>
</td></tr>
<tr>
<td>
<?include("footer.php");
die;?>
</td></tr>

</table>
<?
}


?>
<table width="450" align="center" border="1px">
<tr><td width="171" height="35" align="center" bgcolor="#A23232" ><b><font color="#FFE7BA">
Рудник</font></b>
</td></tr>
<tr><td width="171" height="35" align="left" bgcolor="#FFE7BA"><b><font color="#A23232">
<div class="menu"><li><a href="../game.php"><img src="../img/attck.png">
В игру</a></li></div></font></b>
</td></tr>
<tr><td width="171" height="35" align="left" bgcolor="#FFE7BA"><b><font color="#A23232">
<div class="menu">
<?
#ОК кирка есть 1 из 3 пунктов выполненно
if(mysql_num_rows($kirk)>0){
$src=$_GET['src'];
$pmin=rand(0,100);
###НАЧАЛО EXP профессии
@$LVLP = mysql_query("SET NAMES cp1251");
$LVLP=mysql_query("SELECT * FROM USER_PROF WHERE PROF_NICK=\"$_SESSION[s]\" AND PROF_LVL AND PROF_CLASS=\"gd\"");
$LVLP2=mysql_fetch_assoc($LVLP);
#Проверяем владеет ли игрок данной профессией
@$pr_r = mysql_query("SET NAMES cp1251");
$pr_r=mysql_query("SELECT * FROM USER_PROF WHERE PROF_NICK=\"$_SESSION[s]\" AND PROF_LVL AND PROF_CLASS=\"gd\"");
if(mysql_num_rows($pr_r)<1){echo'вы не владеете данной профессии!';}
#Конец проверки владеет ли игрок данной профессией

#Если игрок владеет данной профессией,то продолжаем выполнять скрипт.
#Проверяем есть ли рядом с игроком рудная жила
#Если игрок ввел вручную название рудной жилы,то проверяем есть ли она в текущей локации!!!!
@$pr_rud = mysql_query("SET NAMES cp1251");
$pr_rud=mysql_query("SELECT * FROM npc_world WHERE npcALL_src=\"rudnik\" AND npc_src=\"$src\" AND npc_loc=\"$PRlc2[loc]\"");
if(mysql_num_rows($pr_rud)<1){
?>
<table width="450" align="center" border="1px">
<tr><td width="171" height="35" align="center" bgcolor="#A23232" ><b><font color="#FFE7BA">
Рудник</font></b>
</td></tr>
<tr><td width="171" height="35" align="left" bgcolor="#FFE7BA"><b><font color="#A23232">
<div class="menu"><li><a href="../game.php"><img src="../img/attck.png">
В игру</a></li></div></font></b>
</td></tr>

<tr>
<td height="10" align="center" valign="top"  bgcolor="#A23232">
<b><font color="#FFE7BA">  рядом с вами нет рудной жилы </font></b>
</td></tr>
<tr>
<td>
<?include("footer.php");?>
</td></tr>

</table>
<?
die;?>
<?
}
if(mysql_num_rows($pr_rud)>0){
#Проверякм есть ли в текущей рудной жилы руда
#ОТ бага защита нужно указать локацию!!!!
$rudP = mysql_query("SET NAMES cp1251");
$rudP=mysql_query("SELECT * FROM gornoe_delo WHERE rudnik_src=\"$src\" AND g_loc=\"$PRlc2[loc]\"");
$rudP2=mysql_fetch_assoc($rudP);
if(mysql_num_rows($rudP)<1){

?>
<table width="450" align="center" border="1px">
<tr><td width="171" height="35" align="center" bgcolor="#A23232" ><b><font color="#FFE7BA">
Рудник</font></b>
</td></tr>
<tr><td width="171" height="35" align="left" bgcolor="#FFE7BA"><b><font color="#A23232">
<div class="menu"><li><a href="../game.php"><img src="../img/attck.png">
В игру</a></li></div></font></b>
</td></tr>

<tr>
<td height="10" align="center" valign="top"  bgcolor="#A23232">
<b><font color="#FFE7BA">  произошла ошибка,сообщите о данной ошибки администрации </font></b>
</td></tr>
<tr>
<td>
<?include("footer.php");?>
</td></tr>

</table><?
die;
}

if($rudP2[kol_vo]==0 AND mysql_num_rows($rudP)>0){echo"<center><img src=\"../img/bad.png\" width=\"12\" height=\"12\"> в рудной жиле нет руды,ждите пока появится</center>";}
if($rudP2[kol_vo]>0 AND mysql_num_rows($rudP)>0){
if($LVLP2[PROF_LVL]*9<$pmin){
echo"<div style=\"padding:4px\"><img src=\"../img/bad.png\" width=\"12\" height=\"12\"> вы ничего не добыли</div>";}
if($LVLP2[PROF_LVL]*9>=$pmin){
$k=$rudP2[kol_vo]-1;
$minR=mysql_query("UPDATE gornoe_delo SET kol_vo=\"$k\"");
echo"<img src=\"../img/ruda.png\" width=\"24\" height=\"24\"> вы добыли 1 руда<br/>";
@$PRru = mysql_query("SET NAMES cp1251");
$PRru=mysql_query("SELECT * FROM inv WHERE IL_KEY=\"i.ruda\" AND ID_USERS=\"$_SESSION[s]\"");
$res1=rand(0,5000);
$res2=rand(0,5000);
$res3=rand(0,5000);
$res4=rand(0,5000);
$res5=rand(0,5000);
$res6=rand(0,5000);
$res7=rand(0,5000);
$res8=rand(0,5000);
$res9=rand(0,5000);
$res10=rand(0,5000);
$res11=rand(0,5000);
$res12=rand(0,5000);
$res13=rand(0,5000);
$res14=rand(0,5000);
$res15=rand(0,5000);
$res16=rand(0,5000);
$res17=rand(0,5000);
$res18=rand(0,5000);
$res19=rand(0,5000);
$res20=rand(0,5000);
@$PRkh = mysql_query("SET NAMES cp1251");
@$PRkh=mysql_query("SELECT * FROM inv WHERE IL_KEY=\"i.stonehp1\" AND ID_USERS=\"$_SESSION[s]\"");
@$PRkh2 = mysql_query("SET NAMES cp1251");
@$PRkh2=mysql_query("SELECT * FROM inv WHERE IL_KEY=\"i.stonehp2\" AND ID_USERS=\"$_SESSION[s]\"");
@$PRkh3 = mysql_query("SET NAMES cp1251");
@$PRkh3=mysql_query("SELECT * FROM inv WHERE IL_KEY=\"i.stonehp3\" AND ID_USERS=\"$_SESSION[s]\"");
@$PRkh4 = mysql_query("SET NAMES cp1251");
@$PRkh4=mysql_query("SELECT * FROM inv WHERE IL_KEY=\"i.stonehp4\" AND ID_USERS=\"$_SESSION[s]\"");
@$PRkh5 = mysql_query("SET NAMES cp1251");
@$PRkh5=mysql_query("SELECT * FROM inv WHERE IL_KEY=\"i.stonehp5\" AND ID_USERS=\"$_SESSION[s]\"");
@$PRkm = mysql_query("SET NAMES cp1251");
@$PRkm=mysql_query("SELECT * FROM inv WHERE IL_KEY=\"i.stonemp1\" AND ID_USERS=\"$_SESSION[s]\"");
$PRkm2=mysql_query("SELECT * FROM inv WHERE IL_KEY=\"i.stonemp2\" AND ID_USERS=\"$_SESSION[s]\"");
$PRkm3=mysql_query("SELECT * FROM inv WHERE IL_KEY=\"i.stonemp3\" AND ID_USERS=\"$_SESSION[s]\"");
$PRkm4=mysql_query("SELECT * FROM inv WHERE IL_KEY=\"i.stonemp4\" AND ID_USERS=\"$_SESSION[s]\"");
$PRkm5=mysql_query("SELECT * FROM inv WHERE IL_KEY=\"i.stonemp5\" AND ID_USERS=\"$_SESSION[s]\"");
$PRkme=mysql_query("SELECT * FROM inv WHERE IL_KEY=\"i.stoneme1\" AND ID_USERS=\"$_SESSION[s]\"");
$PRkme2=mysql_query("SELECT * FROM inv WHERE IL_KEY=\"i.stoneme2\" AND ID_USERS=\"$_SESSION[s]\"");
$PRkme3=mysql_query("SELECT * FROM inv WHERE IL_KEY=\"i.stoneme3\" AND ID_USERS=\"$_SESSION[s]\"");
$PRkme4=mysql_query("SELECT * FROM inv WHERE IL_KEY=\"i.stoneme4\" AND ID_USERS=\"$_SESSION[s]\"");
$PRkme5=mysql_query("SELECT * FROM inv WHERE IL_KEY=\"i.stoneme5\" AND ID_USERS=\"$_SESSION[s]\"");
$PRkko=mysql_query("SELECT * FROM inv WHERE IL_KEY=\"i.stoneko1\" AND ID_USERS=\"$_SESSION[s]\"");
$PRkko2=mysql_query("SELECT * FROM inv WHERE IL_KEY=\"i.stoneko2\" AND ID_USERS=\"$_SESSION[s]\"");
$PRkko3=mysql_query("SELECT * FROM inv WHERE IL_KEY=\"i.stoneko3\" AND ID_USERS=\"$_SESSION[s]\"");
$PRkko4=mysql_query("SELECT * FROM inv WHERE IL_KEY=\"i.stoneko4\" AND ID_USERS=\"$_SESSION[s]\"");
$PRkko5=mysql_query("SELECT * FROM inv WHERE IL_KEY=\"i.stoneko5\" AND ID_USERS=\"$_SESSION[s]\"");
$PRkh6=mysql_fetch_assoc($PRkh);
$PRkh7=mysql_fetch_assoc($PRkh2);
$PRkh8=mysql_fetch_assoc($PRkh3);
$PRkh9=mysql_fetch_assoc($PRkh4);
$PRkh10=mysql_fetch_assoc($PRkh5);
$PRkm6=mysql_fetch_assoc($PRkm);
$PRkm7=mysql_fetch_assoc($PRkm2);
$PRkm8=mysql_fetch_assoc($PRkm3);
$PRkm9=mysql_fetch_assoc($PRkm4);
$PRkm10=mysql_fetch_assoc($PRkm5);
$PRkme6=mysql_fetch_assoc($PRkme);
$PRkme7=mysql_fetch_assoc($PRkme2);
$PRkme8=mysql_fetch_assoc($PRkme3);
$PRkme9=mysql_fetch_assoc($PRkme4);
$PRkme10=mysql_fetch_assoc($PRkme5);
$PRkko6=mysql_fetch_assoc($PRkko);
$PRkko7=mysql_fetch_assoc($PRkko2);
$PRkko8=mysql_fetch_assoc($PRkko3);
$PRkko9=mysql_fetch_assoc($PRkko4);
$PRkko10=mysql_fetch_assoc($PRkko5);
if($res1<=10){
if(mysql_num_rows($PRkh)<1){
$khINS=mysql_query("SET NAMES cp1251");
$khINS=mysql_query("INSERT INTO inv (IL_CLASS,IL_NAME,IL_COST,IL_KEY,IL_IMAGE,IL_SRC,ID_USERS,IL_COUNT) VALUES ('stone','камень жизни ур.1','5','i.stonehp1','img_items/stonehp1.png','i.stonehp1','$_SESSION[s]','1')");}
if(mysql_num_rows($PRkh)>0){
$STONEHP1=mysql_query("SELECT * FROM inv WHERE IL_KEY=\"i.stonehp1\" AND ID_USERS=\"$_SESSION[s]\"");
$STONEHP1B=mysql_fetch_assoc($STONEHP1);
$khUPD=$STONEHP1B[IL_COUNT]+1;
$UPru=mysql_query("UPDATE inv SET IL_COUNT=\"$khUPD\" WHERE IL_KEY=\"i.stonehp1\" AND ID_USERS=\"$_SESSION[s]\"");}
echo"<br/><img src=\"../img_items/stonehp1.png\"><br/>вы получили камень жизни ур.1<br/>";}//+5 к хп
if($res2<=6){
if(mysql_num_rows($PRkh2)<1){
$khINS=mysql_query("SET NAMES cp1251");
$khINS=mysql_query("INSERT INTO inv (IL_CLASS,IL_NAME,IL_COST,IL_KEY,IL_IMAGE,IL_SRC,ID_USERS,IL_COUNT) VALUES ('stone','камень жизни ур.2','5','i.stonehp2','img_items/stonehp2.png','i.stonehp2','$_SESSION[s]','1')");}
if(mysql_num_rows($PRkh2)>0){
$STONEHP2=mysql_query("SELECT * FROM inv WHERE IL_KEY=\"i.stonehp2\" AND ID_USERS=\"$_SESSION[s]\"");
$STONEHP2B=mysql_fetch_assoc($STONEHP2);
$khUPD=$STONEHP2B[IL_COUNT]+1;
$UPru=mysql_query("UPDATE inv SET IL_COUNT=\"$khUPD\" WHERE IL_KEY=\"i.stonehp2\" AND ID_USERS=\"$_SESSION[s]\"");}
echo"<br/><img src=\"../img_items/stonehp2.png\"><br/>вы получили камень жизни ур.2<br/>";}//+10 к хп
if($res3<=3){
if(mysql_num_rows($PRkh3)<1){
$khINS=mysql_query("SET NAMES cp1251");
$khINS=mysql_query("INSERT INTO inv (IL_CLASS,IL_NAME,IL_COST,IL_KEY,IL_IMAGE,IL_SRC,ID_USERS,IL_COUNT) VALUES ('stone','камень жизни ур.3','5','i.stonehp3','img_items/stonehp3.png','i.stonehp3','$_SESSION[s]','1')");}
if(mysql_num_rows($PRkh3)>0){
$STONEHP3=mysql_query("SELECT * FROM inv WHERE IL_KEY=\"i.stonehp3\" AND ID_USERS=\"$_SESSION[s]\"");
$STONEHP3B=mysql_fetch_assoc($STONEHP3);
$khUPD=$STONEHP3B[IL_COUNT]+1;
$UPru=mysql_query("UPDATE inv SET IL_COUNT=\"$khUPD\" WHERE IL_KEY=\"i.stonehp3\" AND ID_USERS=\"$_SESSION[s]\"");
echo"<br/><img src=\"../img_items/stonehp3.png\"><br/>вы получили камень жизни ур.3<br/>";}
}//+15 к хп
if($res4<=2){
if(mysql_num_rows($PRkh4)<1){
$khINS=mysql_query("SET NAMES cp1251");
$khINS=mysql_query("INSERT INTO inv (IL_CLASS,IL_NAME,IL_COST,IL_KEY,IL_IMAGE,IL_SRC,ID_USERS,IL_COUNT) VALUES ('stone','камень жизни ур.4','5','i.stonehp4','img_items/stonehp4.png','i.stonehp4','$_SESSION[s]','1')");}
if(mysql_num_rows($PRkh4)>0){
$STONEHP4=mysql_query("SELECT * FROM inv WHERE IL_KEY=\"i.stonehp4\" AND ID_USERS=\"$_SESSION[s]\"");
$STONEHP4B=mysql_fetch_assoc($STONEHP4);
$khUPD=$STONEHP4B[IL_COUNT]+1;
$UPru=mysql_query("UPDATE inv SET IL_COUNT=\"$khUPD\" WHERE IL_KEY=\"i.stonehp4\" AND ID_USERS=\"$_SESSION[s]\"");
}
echo"<br/><img src=\"../img_items/stonehp4.png\"><br/>вы получили камень жизни ур.4<br/>";
}//+20 к хп
if($res5<=1){
if(mysql_num_rows($PRkh5)<1){
$khINS=mysql_query("SET NAMES cp1251");
$khINS=mysql_query("INSERT INTO inv (IL_CLASS,IL_NAME,IL_COST,IL_KEY,IL_IMAGE,IL_SRC,ID_USERS,IL_COUNT) VALUES ('stone','камень жизни ур.5','5','i.stonehp5','img_items/stonehp5.png','i.stonehp5','$_SESSION[s]','1')");}
if(mysql_num_rows($PRkh5)>0){
$STONEHP5=mysql_query("SELECT * FROM inv WHERE IL_KEY=\"i.stonehp5\" AND ID_USERS=\"$_SESSION[s]\"");
$STONEHP5B=mysql_fetch_assoc($STONEHP5);
$khUPD=$STONEHP5B[IL_COUNT]+1;
$UPru=mysql_query("UPDATE inv SET IL_COUNT=\"$khUPD\" WHERE IL_KEY=\"i.stonehp5\" AND ID_USERS=\"$_SESSION[s]\"");
}
echo"<br/><img src=\"../img_items/stonehp5.png\"><br/>вы получили камень жизни ур.5<br/>";
}//+30 к хп
if($res6<=10){
if(mysql_num_rows($PRkm)<1){
$khINS=mysql_query("SET NAMES cp1251");
$khINS=mysql_query("INSERT INTO inv (IL_CLASS,IL_NAME,IL_COST,IL_KEY,IL_IMAGE,IL_SRC,ID_USERS,IL_COUNT) VALUES ('stone','камень маны ур.1','5','i.stonemp1','img_items/stonemp1.png','i.stonemp1','$_SESSION[s]','1')");}
if(mysql_num_rows($PRkm)>0){
$STONEMP=mysql_query("SELECT * FROM inv WHERE IL_KEY=\"i.stonemp1\" AND ID_USERS=\"$_SESSION[s]\"");
$STONEMPA=mysql_fetch_assoc($STONEMP);
$kmUPD=$STONEMPA[IL_COUNT]+1;
$UPru=mysql_query("UPDATE inv SET IL_COUNT=\"$kmUPD\" WHERE IL_KEY=\"i.stonemp1\" AND ID_USERS=\"$_SESSION[s]\"");
}
echo"<br/><img src=\"../img_items/stonemp1.png\"><br/>вы получили камень маны ур.1<br/>";
}//+5 к мп
if($res7<=6){
if(mysql_num_rows($PRkm2)<1){
$khINS=mysql_query("SET NAMES cp1251");
$khINS=mysql_query("INSERT INTO inv (IL_CLASS,IL_NAME,IL_COST,IL_KEY,IL_IMAGE,IL_SRC,ID_USERS,IL_COUNT) VALUES ('stone','камень маны ур.2','5','i.stonemp2','img_items/stonemp2.png','i.stonemp2','$_SESSION[s]','1')");}
if(mysql_num_rows($PRkm2)>0){
$STONEMP2=mysql_query("SELECT * FROM inv WHERE IL_KEY=\"i.stonemp2\" AND ID_USERS=\"$_SESSION[s]\"");
$STONEMP2A=mysql_fetch_assoc($STONEMP2);
$kmUPD=$STONEMP2A[IL_COUNT]+1;
$UPru=mysql_query("UPDATE inv SET IL_COUNT=\"$kmUPD\" WHERE IL_KEY=\"i.stonemp2\" AND ID_USERS=\"$_SESSION[s]\"");
}
echo"<br/><img src=\"../img_items/stonemp2.png\"><br/>вы получили камень маны ур.2<br/>";}//+10 к хп
if($res8<=3){
if(mysql_num_rows($PRkm3)<1){
$khINS=mysql_query("SET NAMES cp1251");
$khINS=mysql_query("INSERT INTO inv (IL_CLASS,IL_NAME,IL_COST,IL_KEY,IL_IMAGE,IL_SRC,ID_USERS,IL_COUNT) VALUES ('stone','камень маны ур.3','5','i.stonemp3','img_items/stonemp3.png','i.stonemp3','$_SESSION[s]','1')");}
if(mysql_num_rows($PRkm3)>0){
$STONEMP3=mysql_query("SELECT * FROM inv WHERE IL_KEY=\"i.stonemp3\" AND ID_USERS=\"$_SESSION[s]\"");
$STONEMP3A=mysql_fetch_assoc($STONEMP3);
$kmUPD=$STONEMP3A[IL_COUNT]+1;
$UPru=mysql_query("UPDATE inv SET IL_COUNT=\"$kmUPD\" WHERE IL_KEY=\"i.stonemp3\" AND ID_USERS=\"$_SESSION[s]\"");
}
echo"<br/><img src=\"../img_items/stonemp3.png\"><br/>вы получили камень маны ур.3<br/>";}//+15 к хп
if($res9<=2){
if(mysql_num_rows($PRkm4)<1){
$khINS=mysql_query("SET NAMES cp1251");
$khINS=mysql_query("INSERT INTO inv (IL_CLASS,IL_NAME,IL_COST,IL_KEY,IL_IMAGE,IL_SRC,ID_USERS,IL_COUNT) VALUES ('stone','камень маны ур.4','5','i.stonemp4','img_items/stonemp4.png','i.stonemp4','$_SESSION[s]','1')");}
if(mysql_num_rows($PRkm4)>0){
$STONEMP4=mysql_query("SELECT * FROM inv WHERE IL_KEY=\"i.stonemp4\" AND ID_USERS=\"$_SESSION[s]\"");
$STONEMP4A=mysql_fetch_assoc($STONEMP4);
$kmUPD=$STONEMP4A[IL_COUNT]+1;
$UPru=mysql_query("UPDATE inv SET IL_COUNT=\"$kmUPD\" WHERE IL_KEY=\"i.stonemp4\" AND ID_USERS=\"$_SESSION[s]\"");
}
echo"<br/><img src=\"../img_items/stonemp4.png\"><br/>вы получили камень маны ур.4<br/>";}//+20 к хп
if($res10<=1){
if(mysql_num_rows($PRkm5)<1){
$khINS=mysql_query("SET NAMES cp1251");
$khINS=mysql_query("INSERT INTO inv (IL_CLASS,IL_NAME,IL_COST,IL_KEY,IL_IMAGE,IL_SRC,ID_USERS,IL_COUNT) VALUES ('stone','камень маны ур.5','5','i.stonemp5','img_items/stonemp5.png','i.stonemp5','$_SESSION[s]','1')");}
if(mysql_num_rows($PRkm5)>0){
$STONEMP5=mysql_query("SELECT * FROM inv WHERE IL_KEY=\"i.stonemp5\" AND ID_USERS=\"$_SESSION[s]\"");
$STONEMP5A=mysql_fetch_assoc($STONEMP5);
$kmUPD=$STONEMP5A[IL_COUNT]+1;
$UPru=mysql_query("UPDATE inv SET IL_COUNT=\"$kmUPD\" WHERE IL_KEY=\"i.stonemp5\" AND ID_USERS=\"$_SESSION[s]\"");
}
echo"<br/><img src=\"../img_items/stonemp5.png\"><br/>вы получили камень маны ур.5<br/>";}//+30 к хп
if($res11<=10){
if(mysql_num_rows($PRkme)<1){
$khINS=mysql_query("SET NAMES cp1251");
$khINS=mysql_query("INSERT INTO inv (IL_CLASS,IL_NAME,IL_COST,IL_KEY,IL_IMAGE,IL_SRC,ID_USERS,IL_COUNT) VALUES ('stone','мельхиор ур.1','5','i.stoneme1','img_items/stoneme1.png','i.stoneme1','$_SESSION[s]','1')");}
if(mysql_num_rows($PRkme)>0){
$STONEME=mysql_query("SELECT * FROM inv WHERE IL_KEY=\"i.stoneme1\" AND ID_USERS=\"$_SESSION[s]\"");
$STONEMEA=mysql_fetch_assoc($STONEME);
$kmUPD=$STONEMEA[IL_COUNT]+1;
$UPru=mysql_query("UPDATE inv SET IL_COUNT=\"$kmUPD\" WHERE IL_KEY=\"i.stoneme1\" AND ID_USERS=\"$_SESSION[s]\"");
}
echo"<br/><img src=\"../img_items/stoneme1.png\"><br/>вы получили мельхиор ур.1<br/>";}//+1 к урону
if($res12<=6){
if(mysql_num_rows($PRkme2)<1){
$khINS=mysql_query("SET NAMES cp1251");
$khINS=mysql_query("INSERT INTO inv (IL_CLASS,IL_NAME,IL_COST,IL_KEY,IL_IMAGE,IL_SRC,ID_USERS,IL_COUNT) VALUES ('stone','мельхиор ур.2','5','i.stoneme2','img_items/stoneme2.png','i.stoneme2','$_SESSION[s]','1')");}
if(mysql_num_rows($PRkme2)>0){
$STONEME2=mysql_query("SELECT * FROM inv WHERE IL_KEY=\"i.stoneme2\" AND ID_USERS=\"$_SESSION[s]\"");
$STONEME2A=mysql_fetch_assoc($STONEME2);
$kmUPD=$STONEME2A[IL_COUNT]+1;
$UPru=mysql_query("UPDATE inv SET IL_COUNT=\"$kmUPD\" WHERE IL_KEY=\"i.stoneme2\" AND ID_USERS=\"$_SESSION[s]\"");
}
echo"<br/><img src=\"../img_items/stoneme2.png\"><br/>вы получили мельхиор ур.2<br/>";}//+3 к урону
if($res13<=3){
if(mysql_num_rows($PRkme3)<1){
$khINS=mysql_query("SET NAMES cp1251");
$khINS=mysql_query("INSERT INTO inv (IL_CLASS,IL_NAME,IL_COST,IL_KEY,IL_IMAGE,IL_SRC,ID_USERS,IL_COUNT) VALUES ('stone','мельхиор ур.3','5','i.stoneme3','img_items/stoneme3.png','i.stoneme3','$_SESSION[s]','1')");}
if(mysql_num_rows($PRkme3)>0){
$STONEME3=mysql_query("SELECT * FROM inv WHERE IL_KEY=\"i.stoneme3\" AND ID_USERS=\"$_SESSION[s]\"");
$STONEME3A=mysql_fetch_assoc($STONEME3);
$kmUPD=$STONEME3A[IL_COUNT]+1;
$UPru=mysql_query("UPDATE inv SET IL_COUNT=\"$kmUPD\" WHERE IL_KEY=\"i.stoneme3\" AND ID_USERS=\"$_SESSION[s]\"");
}
echo"<br/><img src=\"../img_items/stoneme3.png\"><br/>вы получили мельхиор ур.3<br/>";}//+5 к урону
if($res14<=2){
if(mysql_num_rows($PRkme4)<1){
$khINS=mysql_query("SET NAMES cp1251");
$khINS=mysql_query("INSERT INTO inv (IL_CLASS,IL_NAME,IL_COST,IL_KEY,IL_IMAGE,IL_SRC,ID_USERS,IL_COUNT) VALUES ('stone','мельхиор ур.4','5','i.stoneme4','img_items/stoneme4.png','i.stoneme4','$_SESSION[s]','1')");}
if(mysql_num_rows($PRkme4)>0){
$STONEME4=mysql_query("SELECT * FROM inv WHERE IL_KEY=\"i.stoneme4\" AND ID_USERS=\"$_SESSION[s]\"");
$STONEME4A=mysql_fetch_assoc($STONEME4);
$kmUPD=$STONEME4A[IL_COUNT]+1;
$UPru=mysql_query("UPDATE inv SET IL_COUNT=\"$kmUPD\" WHERE IL_KEY=\"i.stoneme4\" AND ID_USERS=\"$_SESSION[s]\"");
}
echo"<br/><img src=\"../img_items/stoneme4.png\"><br/>вы получили мельхиор ур.4<br/>";}//+15 к урону
if($res15<=1){
if(mysql_num_rows($PRkme5)<1){
$khINS=mysql_query("SET NAMES cp1251");
$khINS=mysql_query("INSERT INTO inv (IL_CLASS,IL_NAME,IL_COST,IL_KEY,IL_IMAGE,IL_SRC,ID_USERS,IL_COUNT) VALUES ('stone','мельхиор ур.5','5','i.stoneme5','img_items/stoneme5.png','i.stoneme5','$_SESSION[s]','1')");}
if(mysql_num_rows($PRkme5)>0){
$STONEME5=mysql_query("SELECT * FROM inv WHERE IL_KEY=\"i.stoneme5\" AND ID_USERS=\"$_SESSION[s]\"");
$STONEME5A=mysql_fetch_assoc($STONEME5);
$kmUPD=$STONEME5A[IL_COUNT]+1;
$UPru=mysql_query("UPDATE inv SET IL_COUNT=\"$kmUPD\" WHERE IL_KEY=\"i.stoneme5\" AND ID_USERS=\"$_SESSION[s]\"");
}
echo"<br/><img src=\"../img_items/stoneme5.png\"><br/>вы получили мельхиор ур.5<br/>";}//+25 к урону
if($res16<=10){
if(mysql_num_rows($PRkko)<1){
$khINS=mysql_query("SET NAMES cp1251");
$khINS=mysql_query("INSERT INTO inv (IL_CLASS,IL_NAME,IL_COST,IL_KEY,IL_IMAGE,IL_SRC,ID_USERS,IL_COUNT) VALUES ('stone','кореол ур.1','5','i.stoneko1','img_items/stoneko1.png','i.stoneko1','$_SESSION[s]','1')");}
if(mysql_num_rows($PRkko)>0){
$STONEKO=mysql_query("SELECT * FROM inv WHERE IL_KEY=\"i.stoneko1\" AND ID_USERS=\"$_SESSION[s]\"");
$STONEKOA=mysql_fetch_assoc($STONEKO);
$kmUPD=$STONEKOA[IL_COUNT]+1;
$UPru=mysql_query("UPDATE inv SET IL_COUNT=\"$kmUPD\" WHERE IL_KEY=\"i.stoneko1\" AND ID_USERS=\"$_SESSION[s]\"");
}
echo"<br/><img src=\"../img_items/stoneko1.png\"><br/>вы получили кореол ур.1<br/>";}//+1 к броне
if($res17<=6){
if(mysql_num_rows($PRkko2)<1){
$khINS=mysql_query("SET NAMES cp1251");
$khINS=mysql_query("INSERT INTO inv (IL_CLASS,IL_NAME,IL_COST,IL_KEY,IL_IMAGE,IL_SRC,ID_USERS,IL_COUNT) VALUES ('stone','кореол ур.2','5','i.stoneko2','img_items/stoneko2.png','i.stoneko2','$_SESSION[s]','1')");}
if(mysql_num_rows($PRkko2)>0){
$STONEKO2=mysql_query("SELECT * FROM inv WHERE IL_KEY=\"i.stoneko2\" AND ID_USERS=\"$_SESSION[s]\"");
$STONEKO2A=mysql_fetch_assoc($STONEKO2);
$kmUPD=$STONEKO2A[IL_COUNT]+1;
$UPru=mysql_query("UPDATE inv SET IL_COUNT=\"$kmUPD\" WHERE IL_KEY=\"i.stoneko2\" AND ID_USERS=\"$_SESSION[s]\"");
}

echo"<br/><img src=\"../img_items/stoneko2.png\"><br/>вы получили кореол ур.2<br/>";}//+3 к броне
if($res18<=3){
if(mysql_num_rows($PRkko3)<1){
$khINS=mysql_query("SET NAMES cp1251");
$khINS=mysql_query("INSERT INTO inv (IL_CLASS,IL_NAME,IL_COST,IL_KEY,IL_IMAGE,IL_SRC,ID_USERS,IL_COUNT) VALUES ('stone','кореол ур.3','5','i.stoneko3','img_items/stoneko3.png','i.stoneko3','$_SESSION[s]','1')");}
if(mysql_num_rows($PRkko3)>0){
$STONEKO3=mysql_query("SELECT * FROM inv WHERE IL_KEY=\"i.stoneko3\" AND ID_USERS=\"$_SESSION[s]\"");
$STONEKO3A=mysql_fetch_assoc($STONEKO3);
$kmUPD=$STONEKO3A[IL_COUNT]+1;
$UPru=mysql_query("UPDATE inv SET IL_COUNT=\"$kmUPD\" WHERE IL_KEY=\"i.stoneko3\" AND ID_USERS=\"$_SESSION[s]\"");
}

echo"<br/><img src=\"../img_items/stoneko3.png\"><br/>вы получили кореол ур.3<br/>";}//+5 к броне
if($res19<=2){
if(mysql_num_rows($PRkko4)<1){
$khINS=mysql_query("SET NAMES cp1251");
$khINS=mysql_query("INSERT INTO inv (IL_CLASS,IL_NAME,IL_COST,IL_KEY,IL_IMAGE,IL_SRC,ID_USERS,IL_COUNT) VALUES ('stone','кореол ур.4','5','i.stoneko4','img_items/stoneko4.png','i.stoneko4','$_SESSION[s]','1')");}
if(mysql_num_rows($PRkko4)>0){
$STONEKO4=mysql_query("SELECT * FROM inv WHERE IL_KEY=\"i.stoneko4\" AND ID_USERS=\"$_SESSION[s]\"");
$STONEKO4A=mysql_fetch_assoc($STONEKO4);
$kmUPD=$STONEKO4A[IL_COUNT]+1;
$UPru=mysql_query("UPDATE inv SET IL_COUNT=\"$kmUPD\" WHERE IL_KEY=\"i.stoneko4\" AND ID_USERS=\"$_SESSION[s]\"");
}

echo"<br/><img src=\"../img_items/stoneko4.png\"><br/>вы получили кореол ур.4<br/>";}//+10 к броне
if($res20<=1){
if(mysql_num_rows($PRkko5)<1){
$khINS=mysql_query("SET NAMES cp1251");
$khINS=mysql_query("INSERT INTO inv (IL_CLASS,IL_NAME,IL_COST,IL_KEY,IL_IMAGE,IL_SRC,ID_USERS,IL_COUNT) VALUES ('stone','кореол ур.5','5','i.stoneko5','img_items/stoneko5.png','i.stoneko5','$_SESSION[s]','1')");}
if(mysql_num_rows($PRkko5)>0){
$STONEKO5=mysql_query("SELECT * FROM inv WHERE IL_KEY=\"i.stoneko5\" AND ID_USERS=\"$_SESSION[s]\"");
$STONEKO5A=mysql_fetch_assoc($STONEKO5);
$kmUPD=$STONEKO5A[IL_COUNT]+1;
$UPru=mysql_query("UPDATE inv SET IL_COUNT=\"$kmUPD\" WHERE IL_KEY=\"i.stoneko5\" AND ID_USERS=\"$_SESSION[s]\"");
}

echo"<br/><img src=\"../img_items/stoneko5.png\"><br/>вы получили кореол ур.5<br/>";}//+15 к броне

$PRru2=mysql_fetch_assoc($PRru);
if(mysql_num_rows($PRru)<1){
$INru=mysql_query("SET NAMES cp1251");
$INru=mysql_query("INSERT INTO inv (IL_CLASS,IL_NAME,IL_COST,IL_KEY,IL_IMAGE,IL_SRC,ID_USERS,IL_COUNT) VALUES ('resurs','руда','10','i.ruda','img_items/ruda.png','i.ruda','$_SESSION[s]','1')");}

if(mysql_num_rows($PRru)>0){
$ruCOU=$PRru2[IL_COUNT]+1;
$UPru=mysql_query("UPDATE inv SET IL_COUNT=\"$ruCOU\" WHERE IL_KEY=\"i.ruda\" AND ID_USERS=\"$_SESSION[s]\"");}

}
if($LVLP2[PROF_LVL]==1){$EXP=20;}
if($LVLP2[PROF_LVL]==2){$EXP=40;}
if($LVLP2[PROF_LVL]==3){$EXP=80;}
if($LVLP2[PROF_LVL]==4){$EXP=200;}
if($LVLP2[PROF_LVL]==5){$EXP=400;}
if($LVLP2[PROF_LVL]==6){$EXP=800;}
if($LVLP2[PROF_LVL]==7){$EXP=1600;}
if($LVLP2[PROF_LVL]==8){$EXP=3200;}
if($LVLP2[PROF_LVL]==9){$EXP=6400;}


if($EXP==$LVLP2[PROF_MIN_EXP] OR $LVLP2[PROF_MIN_EXP]>$EXP){echo'<br/>уровень навыка повысился!';
$LVLPL=$LVLP2[PROF_LVL]+1;
$pNAV=mysql_query("UPDATE user_prof SET PROF_LVL=\"$LVLPL\",PROF_MIN_EXP=\"0\" WHERE PROF_NICK=\"$_SESSION[s]\" AND PROF_CLASS=\"gd\"");}
if($pmin<=7){
$OPNA=rand(1,3);
$pLE=$LVLP2[PROF_MIN_EXP]+$OPNA;
echo'<div style="padding-top:4px"><img src="../img/star.png" width="24" height="24"> опыт навыка +'.$OPNA.'</div>';

$opiPL=mysql_query("UPDATE user_prof SET PROF_MIN_EXP=\"$pLE\" WHERE PROF_NICK=\"$_SESSION[s]\" AND PROF_CLASS=\"gd\"");
}






}

}
}
$RNDKIR=rand(1,150);
if($RNDKIR<=6 AND $RUSI2[IL_MIN_PROCH]>0){
$PROC=$RUSI2[IL_MIN_PROCH]-1;
$upKI=mysql_query("UPDATE inv SET IL_MIN_PROCH=\"$PROC\" WHERE IL_KEY=\"i.kirka\" AND IL_NO=\"1\" AND ID_USERS=\"$_SESSION[s]\"");
echo"
<div style=\"padding-top:4px\"><img src=\"../img/pros.png\" width=\"24\" height=\"24\"> -1 кирка потеряла прочность</div><br/>";
}

?>
</div></font></b>
</td></tr>
<tr>
<td height="10" align="center" valign="top"  bgcolor="#A23232">
<div class="menu"><li><?echo"<a href=\"gornoe_delo.php?src=$src&dob=1\">";?><b><font color="#FFE7BA">  Добывать руду </font></b></li></a></div>
</td></tr>
<tr>
<td>
<?include("footer.php");
die;?>
</td></tr>

</table>
<?
@include("../refresh.php");
?>
