Файл: inc/turney.php
Строк: 88
<?php
$req = mysql_query("SELECT * FROM `proffa` WHERE `id_account`= '$account[id]' and `id_proffa`='2' ");
$avto=mysql_num_rows($req);
if($avto>=1){
$mag= mysql_fetch_array($req);
$cena=$account[shans_krystal]+$mag[priz];
$rangkr=rand(1,100);
$rangkrs=rand(1,$cena);
}else{
$cena=$account[shans_krystal];
$rangkr=rand(1,100);
$rangkrs=rand(1,$cena);
}
$date=date("D");
if($date=="Mon"){
if($rangkr<=$rangkrs){
mysql_query("UPDATE `account` SET `medalys`=`medalys`+'1',`arenakrys`='1' WHERE `id`='$account[id]'");
if($dosuj[zadanue2_ok]==0){
if($dosuj[zadanue2]<500){
mysql_query("UPDATE `dosuj` SET `zadanue2`=`zadanue2`+'1' WHERE `account`='$account[id]'");
}
}
}}
if($date=="Tue"){
if($rangkr<=$rangkrs){
mysql_query("UPDATE `account` SET `medalys`=`medalys`+'1',`arenakrys`='1' WHERE `id`='$account[id]'");
if($dosuj[zadanue2_ok]==0){
if($dosuj[zadanue2]<500){
mysql_query("UPDATE `dosuj` SET `zadanue2`=`zadanue2`+'1' WHERE `account`='$account[id]'");
}
}
}}
if($date=="Wed"){
if($rangkr<=$rangkrs){
mysql_query("UPDATE `account` SET `medalys`=`medalys`+'1',`arenakrys`='1' WHERE `id`='$account[id]'");
if($dosuj[zadanue2_ok]==0){
if($dosuj[zadanue2]<500){
mysql_query("UPDATE `dosuj` SET `zadanue2`=`zadanue2`+'1' WHERE `account`='$account[id]'");
}
}
}}
if($date=="Thu"){
if($rangkr<=$rangkrs){
mysql_query("UPDATE `account` SET `medalys`=`medalys`+'1',`arenakrys`='1' WHERE `id`='$account[id]'");
if($dosuj[zadanue2_ok]==0){
if($dosuj[zadanue2]<500){
mysql_query("UPDATE `dosuj` SET `zadanue2`=`zadanue2`+'1' WHERE `account`='$account[id]'");
}
}
}}
if($date=="Fri"){
if($rangkr<=$rangkrs){
mysql_query("UPDATE `account` SET `medalys`=`medalys`+'1',`arenakrys`='1' WHERE `id`='$account[id]'");
if($dosuj[zadanue2_ok]==0){
if($dosuj[zadanue2]<500){
mysql_query("UPDATE `dosuj` SET `zadanue2`=`zadanue2`+'1' WHERE `account`='$account[id]'");
}
}
}}
if($date=="Sat"){
if($rangkr<=$rangkrs){
mysql_query("UPDATE `account` SET `medalys`=`medalys`+'1',`arenakrys`='1' WHERE `id`='$account[id]'");
if($dosuj[zadanue2_ok]==0){
if($dosuj[zadanue2]<500){
mysql_query("UPDATE `dosuj` SET `zadanue2`=`zadanue2`+'1' WHERE `account`='$account[id]'");
}
}
}}
?>