Просмотр файла sdark.mobi/shaman/activate.php

Размер файла: 29.99Kb
<?php
require_once '../core/system.php';
echo only_reg();
echo ban();
echo blok();
$header = "Шаман";
require_once H.'core/head.php';
if($user['level']<5){
header('location: /'); 
$_SESSION['err'] = 'Доступно только с 5 уровня';
}

if(isset($_GET['hp1'])){
if($user['gold']<100){
header("Location: /shaman/");
$_SESSION['err'] = ' Недостаточно золота';exit;}
$hp30 = floor($user['max_health']*0.1);
$uhp30 = floor($user['max_health']*0.01);
$req = mysql_query("SELECT * FROM `bonus` WHERE `usr` = '$user[id]' and `name` = 'Бонус здоровья'");
$avto = mysql_num_rows($req);
if($avto==0){
$t=time()+3600;
$bonka = mysql_result(mysql_query("SELECT COUNT(*) FROM `logi` WHERE `user_id` = '".$user['id']."' and `text` = 'Бонус'"),0);
if($bonka==0){mysql_query("INSERT INTO `logi` set `user_id` = '".$user['id']."', `text` = 'Бонус', `time` = '".$time."', `kol`='100', `kto`='-'");}else{
mysql_query("UPDATE `logi` set  `time` = '".$tm."', `kol`=`kol`+'100', `kto`='-' WHERE `user_id` = '".$user['id']."' and `text` = 'Бонус'");}

mysql_query("UPDATE `user` set `max_health` = `max_health` + '$hp30',`gold`=`gold`-'100' where `id` = '".$user['id']."'");
mysql_query("INSERT INTO `bonus` set `usr` = ".$user['id'].", `name` = 'Бонус здоровья',`kol`='$hp30',`param`='max_health', `time` = '$t', `bonus`='+$uhp30 к здоровью', `image`='3',`typ`='0'");
}else{header("Location: /shaman/");
$_SESSION['err'] = ' У вас уже есть бонус на здоровье';exit;}
header("Location: /shaman/"); 
$_SESSION['message'] = "Бонус активирован";
}
if(isset($_GET['hp2'])){
if($user['gold']<200){
header("Location: /shaman/");
$_SESSION['err'] = ' Недостаточно золота';exit;}
$hp50 = floor($user['max_health']*0.2);
$uhp50 = floor($user['max_health']*0.02);
$req = mysql_query("SELECT * FROM `bonus` WHERE `usr` = '$user[id]' and `name` = 'Бонус здоровья'");
$avto = mysql_num_rows($req);
if($avto==0){
$t=time()+3600;
$bonka = mysql_result(mysql_query("SELECT COUNT(*) FROM `logi` WHERE `user_id` = '".$user['id']."' and `text` = 'Бонус'"),0);
if($bonka==0){mysql_query("INSERT INTO `logi` set `user_id` = '".$user['id']."', `text` = 'Бонус', `time` = '".$time."', `kol`='200', `kto`='-'");}else{
mysql_query("UPDATE `logi` set  `time` = '".$tm."', `kol`=`kol`+'200', `kto`='-' WHERE `user_id` = '".$user['id']."' and `text` = 'Бонус'");}
mysql_query("UPDATE `user` set `max_health` = `max_health` + '$hp50',`gold`=`gold`-'200' where `id` = '".$user['id']."'");
mysql_query("INSERT INTO `bonus` set `usr` = ".$user['id'].", `name` = 'Бонус здоровья',`kol`='$hp50',`param`='max_health', `time` = '$t', `bonus`='+$uhp50 к здоровью', `image`='3',`typ`='0'");
}else{header("Location: /shaman/");
$_SESSION['err'] = ' У вас уже есть бонус на здоровье';exit;}
header("Location: /shaman/"); 
$_SESSION['message'] = "Бонус активирован";
}
if(isset($_GET['hp3'])){
if($user['gold']<400){
header("Location: /shaman/");
$_SESSION['err'] = ' Недостаточно золота';exit;}
$hp70 = floor($user['max_health']*0.4);
$uhp70 = floor($user['max_health']*0.04);
$req = mysql_query("SELECT * FROM `bonus` WHERE `usr` = '$user[id]' and `name` = 'Бонус здоровья'");
$avto = mysql_num_rows($req);
if($avto==0){
$t=time()+3600;
$bonka = mysql_result(mysql_query("SELECT COUNT(*) FROM `logi` WHERE `user_id` = '".$user['id']."' and `text` = 'Бонус'"),0);
if($bonka==0){mysql_query("INSERT INTO `logi` set `user_id` = '".$user['id']."', `text` = 'Бонус', `time` = '".$time."', `kol`='400', `kto`='-'");}else{
mysql_query("UPDATE `logi` set  `time` = '".$tm."', `kol`=`kol`+'400', `kto`='-' WHERE `user_id` = '".$user['id']."' and `text` = 'Бонус'");}
mysql_query("UPDATE `user` set `max_health` = `max_health` + '$hp70',`gold`=`gold`-'400' where `id` = '".$user['id']."'");
mysql_query("INSERT INTO `bonus` set `usr` = ".$user['id'].", `name` = 'Бонус здоровья',`kol`='$hp70',`param`='max_health', `time` = '$t', `bonus`='+$uhp70 к здоровью', `image`='3',`typ`='0'");
}else{header("Location: /shaman/");
$_SESSION['err'] = ' У вас уже есть бонус на здоровье';exit;}
header("Location: /shaman/"); 
$_SESSION['message'] = "Бонус активирован";
}
if(isset($_GET['sila1'])){
if($user['gold']<100){
header("Location: /shaman/");
$_SESSION['err'] = ' Недостаточно золота';exit;}
$sila30 = floor($user['sila']*0.1);
$req = mysql_query("SELECT * FROM `bonus` WHERE `usr` = '$user[id]' and `name` = 'Бонус силы'");
$avto = mysql_num_rows($req);
if($avto==0){
$t=time()+3600;
$bonka = mysql_result(mysql_query("SELECT COUNT(*) FROM `logi` WHERE `user_id` = '".$user['id']."' and `text` = 'Бонус'"),0);
if($bonka==0){mysql_query("INSERT INTO `logi` set `user_id` = '".$user['id']."', `text` = 'Бонус', `time` = '".$time."', `kol`='100', `kto`='-'");}else{
mysql_query("UPDATE `logi` set  `time` = '".$tm."', `kol`=`kol`+'100', `kto`='-' WHERE `user_id` = '".$user['id']."' and `text` = 'Бонус'");}

mysql_query("UPDATE `user` set `sila` = `sila` + '$sila30',`gold`=`gold`-'100' where `id` = '".$user['id']."'");
mysql_query("INSERT INTO `bonus` set `usr` = ".$user['id'].", `name` = 'Бонус силы',`kol`='$sila30',`param`='sila', `time` = '$t', `bonus`='+$sila30 к силе', `image`='4',`typ`='0'");
}else{header("Location: /shaman/");
$_SESSION['err'] = ' У вас уже есть бонус на силу';exit;}
header("Location: /shaman/"); 
$_SESSION['message'] = "Бонус активирован";
}
if(isset($_GET['sila2'])){
if($user['gold']<200){
header("Location: /shaman/");
$_SESSION['err'] = ' Недостаточно золота';exit;}
$sila50 = floor($user['sila']*0.2);
$req = mysql_query("SELECT * FROM `bonus` WHERE `usr` = '$user[id]' and `name` = 'Бонус силы'");
$avto = mysql_num_rows($req);
if($avto==0){
$t=time()+3600;
$bonka = mysql_result(mysql_query("SELECT COUNT(*) FROM `logi` WHERE `user_id` = '".$user['id']."' and `text` = 'Бонус'"),0);
if($bonka==0){mysql_query("INSERT INTO `logi` set `user_id` = '".$user['id']."', `text` = 'Бонус', `time` = '".$time."', `kol`='200', `kto`='-'");}else{
mysql_query("UPDATE `logi` set  `time` = '".$tm."', `kol`=`kol`+'200', `kto`='-' WHERE `user_id` = '".$user['id']."' and `text` = 'Бонус'");}
mysql_query("UPDATE `user` set `sila` = `sila` + '$sila50',`gold`=`gold`-'200' where `id` = '".$user['id']."'");
mysql_query("INSERT INTO `bonus` set `usr` = ".$user['id'].", `name` = 'Бонус силы',`kol`='$sila50',`param`='sila', `time` = '$t', `bonus`='+$sila50 к силе', `image`='4',`typ`='0'");
}else{header("Location: /shaman/");
$_SESSION['err'] = ' У вас уже есть бонус на силу';exit;}
header("Location: /shaman/"); 
$_SESSION['message'] = "Бонус активирован";
}
if(isset($_GET['sila3'])){
if($user['gold']<400){
header("Location: /shaman/");
$_SESSION['err'] = ' Недостаточно золота';exit;}
$sila70 = floor($user['sila']*0.4);
$req = mysql_query("SELECT * FROM `bonus` WHERE `usr` = '$user[id]' and `name` = 'Бонус силы'");
$avto = mysql_num_rows($req);
if($avto==0){
$t=time()+3600;
$bonka = mysql_result(mysql_query("SELECT COUNT(*) FROM `logi` WHERE `user_id` = '".$user['id']."' and `text` = 'Бонус'"),0);
if($bonka==0){mysql_query("INSERT INTO `logi` set `user_id` = '".$user['id']."', `text` = 'Бонус', `time` = '".$time."', `kol`='400', `kto`='-'");}else{
mysql_query("UPDATE `logi` set  `time` = '".$tm."', `kol`=`kol`+'400', `kto`='-' WHERE `user_id` = '".$user['id']."' and `text` = 'Бонус'");}

mysql_query("UPDATE `user` set `sila` = `sila` + '$sila70',`gold`=`gold`-'400' where `id` = '".$user['id']."'");
mysql_query("INSERT INTO `bonus` set `usr` = ".$user['id'].", `name` = 'Бонус силы',`kol`='$sila70',`param`='sila', `time` = '$t', `bonus`='+$sila70 к силе', `image`='4',`typ`='0'");
}else{header("Location: /shaman/");
$_SESSION['err'] = ' У вас уже есть бонус на силу';exit;}
header("Location: /shaman/"); 
$_SESSION['message'] = "Бонус активирован";
}
if(isset($_GET['prot1'])){
if($user['gold']<100){
header("Location: /shaman/");
$_SESSION['err'] = ' Недостаточно золота';exit;}
$prot30 = floor($user['zashit']*0.1);
$req = mysql_query("SELECT * FROM `bonus` WHERE `usr` = '$user[id]' and `name` = 'Бонус защиты'");
$avto = mysql_num_rows($req);
if($avto==0){
$t=time()+3600;
$bonka = mysql_result(mysql_query("SELECT COUNT(*) FROM `logi` WHERE `user_id` = '".$user['id']."' and `text` = 'Бонус'"),0);
if($bonka==0){mysql_query("INSERT INTO `logi` set `user_id` = '".$user['id']."', `text` = 'Бонус', `time` = '".$time."', `kol`='100', `kto`='-'");}else{
mysql_query("UPDATE `logi` set  `time` = '".$tm."', `kol`=`kol`+'100', `kto`='-' WHERE `user_id` = '".$user['id']."' and `text` = 'Бонус'");}

mysql_query("UPDATE `user` set `zashit` = `zashit` + '$prot30',`gold`=`gold`-'100' where `id` = '".$user['id']."'");
mysql_query("INSERT INTO `bonus` set `usr` = ".$user['id'].", `name` = 'Бонус защиты',`kol`='$prot30',`param`='zashit', `time` = '$t', `bonus`='+$prot30 к защите', `image`='5',`typ`='0'");
}else{header("Location: /shaman/");
$_SESSION['err'] = ' У вас уже есть бонус на защиту';exit;}
header("Location: /shaman/"); 
$_SESSION['message'] = "Бонус активирован";
}
if(isset($_GET['prot2'])){
if($user['gold']<200){
header("Location: /shaman/");
$_SESSION['err'] = ' Недостаточно золота';exit;}
$prot50 = floor($user['zashit']*0.2);
$req = mysql_query("SELECT * FROM `bonus` WHERE `usr` = '$user[id]' and `name` = 'Бонус защиты'");
$avto = mysql_num_rows($req);
if($avto==0){
$t=time()+3600;
$bonka = mysql_result(mysql_query("SELECT COUNT(*) FROM `logi` WHERE `user_id` = '".$user['id']."' and `text` = 'Бонус'"),0);
if($bonka==0){mysql_query("INSERT INTO `logi` set `user_id` = '".$user['id']."', `text` = 'Бонус', `time` = '".$time."', `kol`='200', `kto`='-'");}else{
mysql_query("UPDATE `logi` set  `time` = '".$tm."', `kol`=`kol`+'200', `kto`='-' WHERE `user_id` = '".$user['id']."' and `text` = 'Бонус'");}
mysql_query("UPDATE `user` set `zashit` = `zashit` + '$prot50',`gold`=`gold`-'200' where `id` = '".$user['id']."'");
mysql_query("INSERT INTO `bonus` set `usr` = ".$user['id'].", `name` = 'Бонус защиты',`kol`='$prot50',`param`='zashit', `time` = '$t', `bonus`='+$prot50 к защите', `image`='5',`typ`='0'");
}else{header("Location: /shaman/");
$_SESSION['err'] = ' У вас уже есть бонус на защиту';exit;}
header("Location: /shaman/"); 
$_SESSION['message'] = "Бонус активирован";
}
if(isset($_GET['prot3'])){
if($user['gold']<400){
header("Location: /shaman/");
$_SESSION['err'] = ' Недостаточно золота';exit;}
$prot70 = floor($user['zashit']*0.4);
$req = mysql_query("SELECT * FROM `bonus` WHERE `usr` = '$user[id]' and `name` = 'Бонус защиты'");
$avto = mysql_num_rows($req);
if($avto==0){
$t=time()+3600;
$bonka = mysql_result(mysql_query("SELECT COUNT(*) FROM `logi` WHERE `user_id` = '".$user['id']."' and `text` = 'Бонус'"),0);
if($bonka==0){mysql_query("INSERT INTO `logi` set `user_id` = '".$user['id']."', `text` = 'Бонус', `time` = '".$time."', `kol`='400', `kto`='-'");}else{
mysql_query("UPDATE `logi` set  `time` = '".$tm."', `kol`=`kol`+'400', `kto`='-' WHERE `user_id` = '".$user['id']."' and `text` = 'Бонус'");}

mysql_query("UPDATE `user` set `zashit` = `zashit` + '$prot70',`gold`=`gold`-'400' where `id` = '".$user['id']."'");
mysql_query("INSERT INTO `bonus` set `usr` = ".$user['id'].", `name` = 'Бонус защиты',`kol`='$prot70',`param`='zashit', `time` = '$t', `bonus`='+$prot70 к защите', `image`='5',`typ`='0'");
}else{header("Location: /shaman/");
$_SESSION['err'] = ' У вас уже есть бонус на защиту';exit;}
header("Location: /shaman/"); 
$_SESSION['message'] = "Бонус активирован";
}
if(isset($_GET['exp1'])){
if($user['gold']<500){
header("Location: /shaman/");
$_SESSION['err'] = ' Недостаточно золота';exit;}
$req = mysql_query("SELECT * FROM `bonus` WHERE `usr` = '$user[id]' and `name` = 'Бонус опыта'");
$avto = mysql_num_rows($req);
if($avto==0){
$t=time()+1800;
$bonka = mysql_result(mysql_query("SELECT COUNT(*) FROM `logi` WHERE `user_id` = '".$user['id']."' and `text` = 'Бонус'"),0);
if($bonka==0){mysql_query("INSERT INTO `logi` set `user_id` = '".$user['id']."', `text` = 'Бонус', `time` = '".$time."', `kol`='500', `kto`='-'");}else{
mysql_query("UPDATE `logi` set  `time` = '".$tm."', `kol`=`kol`+'500', `kto`='-' WHERE `user_id` = '".$user['id']."' and `text` = 'Бонус'");}

mysql_query("UPDATE `user` set `gold`=`gold`-'500' where `id` = '".$user['id']."'");
mysql_query("INSERT INTO `bonus` set `usr` = ".$user['id'].", `name` = 'Бонус опыта',`kol`='',`param`='', `time` = '$t', `bonus`='опыт х2', `image`='15',`typ`='3'");
}else{header("Location: /shaman/");
$_SESSION['err'] = ' У вас уже есть бонус на опыт';exit;}
header("Location: /shaman/"); 
$_SESSION['message'] = "Бонус активирован";
}
if(isset($_GET['exp2'])){
if($user['gold'] < 1000){
$_SESSION['err'] = ' Недостаточно золота';
header("Location: /shaman/");
exit;
}
$req = mysql_query("SELECT * FROM `bonus` WHERE `usr` = '$user[id]' and `name` = 'Бонус опыта'");
$avto = mysql_num_rows($req);
if($avto==0){
$t=time()+3600;
$bonka = mysql_result(mysql_query("SELECT COUNT(*) FROM `logi` WHERE `user_id` = '".$user['id']."' and `text` = 'Бонус'"),0);
if($bonka==0){
mysql_query("INSERT INTO `logi` set `user_id` = '".$user['id']."', `text` = 'Бонус', `time` = '".$time."', `kol`='1000', `kto`='-'");
} else {
mysql_query("UPDATE `logi` set  `time` = '".$tm."', `kol`=`kol`+'1000', `kto`='-' WHERE `user_id` = '".$user['id']."' and `text` = 'Бонус'");
}
mysql_query("UPDATE `user` set `gold`=`gold`-'1000' where `id` = '".$user['id']."'");
mysql_query("INSERT INTO `bonus` set `usr` = ".$user['id'].", `name` = 'Бонус опыта',`kol`='',`param`='', `time` = '$t', `bonus`='опыт х2', `image`='15',`typ`='3'");
} else {
$_SESSION['err'] = ' У вас уже есть бонус на опыт';
header("Location: /shaman/");
exit;
}
header("Location: /shaman/"); 
$_SESSION['message'] = "Бонус активирован";
}

if(isset($_GET['reload1'])){
$reqk = mysql_query("SELECT * FROM `umen` WHERE `usr` = '$user[id]' and `img` = 'whack'");
$mimi = mysql_num_rows($reqk);
if($mimi==0){header("Location: /shaman/");
$_SESSION['err'] = ' Бонус недоступен';exit;}
if($user['gold']<500){
header("Location: /shaman/");
$_SESSION['err'] = ' Недостаточно золота';exit;}
$req = mysql_query("SELECT * FROM `bonus` WHERE `usr` = '$user[id]' and `name` = 'Сильный Удар'");
$avto = mysql_num_rows($req);
if($avto==0){
$t=time()+1800;
mysql_query("UPDATE `umen` set `time` = `time`-'5' WHERE `usr` = '$user[id]' and `img` = 'whack'");
mysql_query("UPDATE `user` set `gold`=`gold`-'500' where `id` = '".$user['id']."'");
$bonka = mysql_result(mysql_query("SELECT COUNT(*) FROM `logi` WHERE `user_id` = '".$user['id']."' and `text` = 'Бонус'"),0);
if($bonka==0){mysql_query("INSERT INTO `logi` set `user_id` = '".$user['id']."', `text` = 'Бонус', `time` = '".$time."', `kol`='500', `kto`='-'");}else{
mysql_query("UPDATE `logi` set  `time` = '".$tm."', `kol`=`kol`+'500', `kto`='-' WHERE `user_id` = '".$user['id']."' and `text` = 'Бонус'");}

mysql_query("INSERT INTO `bonus` set `usr` = ".$user['id'].", `name` = 'Сильный Удар',`kol`='5',`param`='whack', `time` = '$t', `bonus`='-5 сек', `image`='16',`typ`='4'");
}else{header("Location: /shaman/");
$_SESSION['err'] = ' У вас уже есть похожий бонус';exit;}
header("Location: /shaman/"); 
$_SESSION['message'] = "Бонус активирован";
}
if(isset($_GET['reload2'])){
$reqo = mysql_query("SELECT * FROM `umen` WHERE `usr` = '$user[id]' and `img` = 'whack'");
$mimo = mysql_num_rows($reqo);
if($mimo==0){header("Location: /shaman/");
$_SESSION['err'] = ' Бонус недоступен';exit;}
if($user['gold']<1000){
header("Location: /shaman/");
$_SESSION['err'] = ' Недостаточно золота';exit;}
$req = mysql_query("SELECT * FROM `bonus` WHERE `usr` = '$user[id]' and `name` = 'Сильный Удар'");
$avto = mysql_num_rows($req);
if($avto==0){
$t=time()+3600;
mysql_query("UPDATE `umen` set `time` = `time`-'10' WHERE `usr` = '$user[id]' and `img` = 'whack'");
mysql_query("UPDATE `user` set `gold`=`gold`-'1000' where `id` = '".$user['id']."'");
$bonka = mysql_result(mysql_query("SELECT COUNT(*) FROM `logi` WHERE `user_id` = '".$user['id']."' and `text` = 'Бонус'"),0);
if($bonka==0){mysql_query("INSERT INTO `logi` set `user_id` = '".$user['id']."', `text` = 'Бонус', `time` = '".$time."', `kol`='1000', `kto`='-'");}else{
mysql_query("UPDATE `logi` set  `time` = '".$tm."', `kol`=`kol`+'1000', `kto`='-' WHERE `user_id` = '".$user['id']."' and `text` = 'Бонус'");}

mysql_query("INSERT INTO `bonus` set `usr` = ".$user['id'].", `name` = 'Сильный Удар',`kol`='10',`param`='whack', `time` = '$t', `bonus`='-10 сек', `image`='16',`typ`='4'");
}else{header("Location: /shaman/");
$_SESSION['err'] = ' У вас уже есть похожий бонус';exit;}
header("Location: /shaman/"); 
$_SESSION['message'] = "Бонус активирован";
}
if(isset($_GET['reload3'])){
$reqp = mysql_query("SELECT * FROM `umen` WHERE `usr` = '$user[id]' and `img` = 'gift_of_the_Gods'");
$mimp = mysql_num_rows($reqp);
if($mimp==0){header("Location: /shaman/");
$_SESSION['err'] = ' Бонус недоступен';exit;}
if($user['gold']<500){
header("Location: /shaman/");
$_SESSION['err'] = ' Недостаточно золота';exit;}
$req = mysql_query("SELECT * FROM `bonus` WHERE `usr` = '$user[id]' and `name` = 'Дар Богов'");
$avto = mysql_num_rows($req);
if($avto==0){
$t=time()+1800;
mysql_query("UPDATE `umen` set `time` = `time`-'5' WHERE `usr` = '$user[id]' and `img` = 'gift_of_the_Gods'");
mysql_query("UPDATE `user` set `gold`=`gold`-'500' where `id` = '".$user['id']."'");

$bonka = mysql_result(mysql_query("SELECT COUNT(*) FROM `logi` WHERE `user_id` = '".$user['id']."' and `text` = 'Бонус'"),0);
if($bonka==0){mysql_query("INSERT INTO `logi` set `user_id` = '".$user['id']."', `text` = 'Бонус', `time` = '".$time."', `kol`='500', `kto`='-'");}else{
mysql_query("UPDATE `logi` set  `time` = '".$tm."', `kol`=`kol`+'500', `kto`='-' WHERE `user_id` = '".$user['id']."' and `text` = 'Бонус'");}
mysql_query("INSERT INTO `bonus` set `usr` = ".$user['id'].", `name` = 'Дар Богов',`kol`='5',`param`='gift_of_the_Gods', `time` = '$t', `bonus`='-5 сек', `image`='18',`typ`='4'");
}else{header("Location: /shaman/");
$_SESSION['err'] = ' У вас уже есть похожий бонус';exit;}
header("Location: /shaman/"); 
$_SESSION['message'] = "Бонус активирован";
}
if(isset($_GET['reload4'])){
$reqr = mysql_query("SELECT * FROM `umen` WHERE `usr` = '$user[id]' and `img` = 'gift_of_the_Gods'");
$mimr = mysql_num_rows($reqr);
if($mimr==0){
$_SESSION['err'] = ' Бонус недоступен';
header("Location: /shaman/");
exit;
}
if($user['gold']<1000){
$_SESSION['err'] = ' Недостаточно золота';
header("Location: /shaman/");
exit;
}
$req = mysql_query("SELECT * FROM `bonus` WHERE `usr` = '$user[id]' and `name` = 'Дар Богов'");
$avto = mysql_num_rows($req);
if($avto==0){
$t=time()+3600;
mysql_query("UPDATE `umen` set `time` = `time`-'10' WHERE `usr` = '$user[id]' and `img` = 'gift_of_the_Gods'");
mysql_query("UPDATE `user` set `gold`=`gold`-'1000' where `id` = '".$user['id']."'");
$bonka = mysql_result(mysql_query("SELECT COUNT(*) FROM `logi` WHERE `user_id` = '".$user['id']."' and `text` = 'Бонус'"),0);
if($bonka==0){
mysql_query("INSERT INTO `logi` set `user_id` = '".$user['id']."', `text` = 'Бонус', `time` = '".$time."', `kol`='1000', `kto`='-'");
} else {
mysql_query("UPDATE `logi` set  `time` = '".$tm."', `kol`=`kol`+'1000', `kto`='-' WHERE `user_id` = '".$user['id']."' and `text` = 'Бонус'");
}
mysql_query("INSERT INTO `bonus` set `usr` = ".$user['id'].", `name` = 'Дар Богов',`kol`='10',`param`='gift_of_the_Gods', `time` = '$t', `bonus`='-10 сек', `image`='18',`typ`='4'");
} else {	
header("Location: /shaman/");
$_SESSION['err'] = ' У вас уже есть похожий бонус';
exit;
}
header("Location: /shaman/"); 
$_SESSION['message'] = "Бонус активирован";
}

if(isset($_GET['platinum1'])){
if($user['gold'] < 35000){
$_SESSION['err'] = ' Недостаточно золота';
header("Location: /shaman/");
exit;
}

$req = mysql_query("SELECT * FROM `bonus` WHERE `usr` = '".$user['id']."' and `name` = 'Дар Богов'");
$avto = mysql_num_rows($req);
if($avto > 0){
header("Location: /shaman/");
$_SESSION['err'] = ' Ошибка. У вас активирован бонус на Дар Богов!';
exit;
}

$req = mysql_query("SELECT * FROM `bonus` WHERE `usr` = '".$user['id']."' and `name` = 'Сильный Удар'");
$avto = mysql_num_rows($req);
if($avto > 0){
header("Location: /shaman/");
$_SESSION['err'] = ' Ошибка. У вас активирован бонус на Сильный Удар!';
exit;
}

$req = mysql_query("SELECT * FROM `bonus` WHERE `usr` = '".$user['id']."' and `name` = 'Бонус опыта'");
$avto = mysql_num_rows($req);
if($avto > 0){
header("Location: /shaman/");
$_SESSION['err'] = ' Ошибка. У вас активирован бонус на Двойной опыт!';
exit;
}

$req = mysql_query("SELECT * FROM `bonus` WHERE `usr` = '".$user['id']."' and `name` = 'Бонус защиты'");
$avto = mysql_num_rows($req);
if($avto > 0){
header("Location: /shaman/");
$_SESSION['err'] = ' Ошибка. У вас активирован бонус защиты!';
exit;
}

$req = mysql_query("SELECT * FROM `bonus` WHERE `usr` = '".$user['id']."' and `name` = 'Бонус здоровья'");
$avto = mysql_num_rows($req);
if($avto > 0){
header("Location: /shaman/");
$_SESSION['err'] = ' Ошибка. У вас активирован бонус здоровья!';
exit;
}

$req = mysql_query("SELECT * FROM `bonus` WHERE `usr` = '".$user['id']."' and `name` = 'Бонус силы'");
$avto = mysql_num_rows($req);
if($avto > 0){
header("Location: /shaman/");
$_SESSION['err'] = ' Ошибка. У вас активирован бонус силы!';
exit;
}

$req = mysql_query("SELECT * FROM `bonus` WHERE `usr` = '".$user['id']."' and `name` = 'Платинум'");
$avto = mysql_num_rows($req);
if($avto==0){
$t = time() + 43200;
$bonka = mysql_result(mysql_query("SELECT COUNT(*) FROM `logi` WHERE `user_id` = '".$user['id']."' and `text` = 'Бонус'"),0);
if($bonka==0){
mysql_query("INSERT INTO `logi` set `user_id` = '".$user['id']."', `text` = 'Бонус', `time` = '".$time."', `kol`='35000', `kto`='-'");
} else {
mysql_query("UPDATE `logi` set  `time` = '".$tm."', `kol`=`kol`+'35000', `kto`='-' WHERE `user_id` = '".$user['id']."' and `text` = 'Бонус'");
}
mysql_query("INSERT INTO `bonus` set `usr` = ".$user['id'].", `name` = 'Платинум',`kol`='',`param`='', `time` = '".$t."', `bonus`='', `image`='19',`typ`='3'");
mysql_query("INSERT INTO `bonus` set `usr` = ".$user['id'].", `name` = 'Бонус опыта',`kol`='',`param`='', `time` = '".$t."', `bonus`='опыт х2', `image`='15',`typ`='3'");

$hp70 = floor($user['max_health']*0.5);
$uhp70 = floor($user['max_health']*0.05);
$sila70 = floor($user['sila']*0.5);
$prot70 = floor($user['zashit']*0.5);

mysql_query("INSERT INTO `bonus` set `usr` = ".$user['id'].", `name` = 'Бонус здоровья',`kol`='".$hp70."',`param`='max_health', `time` = '".$t."', `bonus`='+".$uhp70." к здоровью', `image`='3',`typ`='0'");
mysql_query("INSERT INTO `bonus` set `usr` = ".$user['id'].", `name` = 'Бонус силы',`kol`='".$sila70."',`param`='sila', `time` = '".$t."', `bonus`='+".$sila70." к силе', `image`='4',`typ`='0'");
mysql_query("INSERT INTO `bonus` set `usr` = ".$user['id'].", `name` = 'Бонус защиты',`kol`='".$prot70."',`param`='zashit', `time` = '".$t."', `bonus`='+".$prot70." к защите', `image`='5',`typ`='0'");
mysql_query("UPDATE `user` set `max_health` = `max_health` + '".$hp70."',  `sila` = `sila` + '".$sila70."',`zashit` = `zashit` + '".$prot70."', `gold`=`gold`-'35000' where `id` = '".$user['id']."'");

mysql_query("UPDATE `umen` set `time` = `time`-'12' WHERE `usr` = '".$user['id']."' and `img` = 'whack'");
mysql_query("INSERT INTO `bonus` set `usr` = ".$user['id'].", `name` = 'Сильный Удар',`kol`='12',`param`='whack', `time` = '".$t."', `bonus`='-12 сек', `image`='16',`typ`='4'");

mysql_query("UPDATE `umen` set `time` = `time`-'12' WHERE `usr` = '".$user['id']."' and `img` = 'gift_of_the_Gods'");
mysql_query("INSERT INTO `bonus` set `usr` = ".$user['id'].", `name` = 'Дар Богов',`kol`='12',`param`='gift_of_the_Gods', `time` = '".$t."', `bonus`='-12 сек', `image`='18',`typ`='4'");

} else {
$_SESSION['err'] = ' У вас уже есть платинум!';
header("Location: /shaman/");
exit;
}
header("Location: /shaman/"); 
$_SESSION['message'] = "Бонус активирован";
}

if(isset($_GET['platinum2'])){
if($user['gold'] < 50000){
$_SESSION['err'] = ' Недостаточно золота';
header("Location: /shaman/");
exit;
}

$req = mysql_query("SELECT * FROM `bonus` WHERE `usr` = '".$user['id']."' and `name` = 'Дар Богов'");
$avto = mysql_num_rows($req);
if($avto > 0){
header("Location: /shaman/");
$_SESSION['err'] = ' Ошибка. У вас активирован бонус на Дар Богов!';
exit;
}

$req = mysql_query("SELECT * FROM `bonus` WHERE `usr` = '".$user['id']."' and `name` = 'Сильный Удар'");
$avto = mysql_num_rows($req);
if($avto > 0){
header("Location: /shaman/");
$_SESSION['err'] = ' Ошибка. У вас активирован бонус на Сильный Удар!';
exit;
}

$req = mysql_query("SELECT * FROM `bonus` WHERE `usr` = '".$user['id']."' and `name` = 'Бонус опыта'");
$avto = mysql_num_rows($req);
if($avto > 0){
header("Location: /shaman/");
$_SESSION['err'] = ' Ошибка. У вас активирован бонус на Двойной опыт!';
exit;
}

$req = mysql_query("SELECT * FROM `bonus` WHERE `usr` = '".$user['id']."' and `name` = 'Бонус защиты'");
$avto = mysql_num_rows($req);
if($avto > 0){
header("Location: /shaman/");
$_SESSION['err'] = ' Ошибка. У вас активирован бонус защиты!';
exit;
}

$req = mysql_query("SELECT * FROM `bonus` WHERE `usr` = '".$user['id']."' and `name` = 'Бонус здоровья'");
$avto = mysql_num_rows($req);
if($avto > 0){
header("Location: /shaman/");
$_SESSION['err'] = ' Ошибка. У вас активирован бонус здоровья!';
exit;
}

$req = mysql_query("SELECT * FROM `bonus` WHERE `usr` = '".$user['id']."' and `name` = 'Бонус силы'");
$avto = mysql_num_rows($req);
if($avto > 0){
header("Location: /shaman/");
$_SESSION['err'] = ' Ошибка. У вас активирован бонус силы!';
exit;
}

$req = mysql_query("SELECT * FROM `bonus` WHERE `usr` = '".$user['id']."' and `name` = 'Платинум'");
$avto = mysql_num_rows($req);
if($avto==0){
$t = time() + 86400;
$bonka = mysql_result(mysql_query("SELECT COUNT(*) FROM `logi` WHERE `user_id` = '".$user['id']."' and `text` = 'Бонус'"),0);
if($bonka==0){
mysql_query("INSERT INTO `logi` set `user_id` = '".$user['id']."', `text` = 'Бонус', `time` = '".$time."', `kol`='50000', `kto`='-'");
} else {
mysql_query("UPDATE `logi` set  `time` = '".$tm."', `kol`=`kol`+'50000', `kto`='-' WHERE `user_id` = '".$user['id']."' and `text` = 'Бонус'");
}
mysql_query("INSERT INTO `bonus` set `usr` = ".$user['id'].", `name` = 'Платинум',`kol`='',`param`='', `time` = '".$t."', `bonus`='', `image`='19',`typ`='3'");
mysql_query("INSERT INTO `bonus` set `usr` = ".$user['id'].", `name` = 'Бонус опыта',`kol`='',`param`='', `time` = '".$t."', `bonus`='опыт х2', `image`='15',`typ`='3'");

$hp70 = floor($user['max_health']*0.5);
$uhp70 = floor($user['max_health']*0.05);
$sila70 = floor($user['sila']*0.5);
$prot70 = floor($user['zashit']*0.5);

mysql_query("INSERT INTO `bonus` set `usr` = ".$user['id'].", `name` = 'Бонус здоровья',`kol`='".$hp70."',`param`='max_health', `time` = '".$t."', `bonus`='+".$uhp70." к здоровью', `image`='3',`typ`='0'");
mysql_query("INSERT INTO `bonus` set `usr` = ".$user['id'].", `name` = 'Бонус силы',`kol`='".$sila70."',`param`='sila', `time` = '".$t."', `bonus`='+".$sila70." к силе', `image`='4',`typ`='0'");
mysql_query("INSERT INTO `bonus` set `usr` = ".$user['id'].", `name` = 'Бонус защиты',`kol`='".$prot70."',`param`='zashit', `time` = '".$t."', `bonus`='+".$prot70." к защите', `image`='5',`typ`='0'");
mysql_query("UPDATE `user` set `max_health` = `max_health` + '".$hp70."',  `sila` = `sila` + '".$sila70."',`zashit` = `zashit` + '".$prot70."', `gold`=`gold`-'50000' where `id` = '".$user['id']."'");

mysql_query("UPDATE `umen` set `time` = `time`-'12' WHERE `usr` = '".$user['id']."' and `img` = 'whack'");
mysql_query("INSERT INTO `bonus` set `usr` = ".$user['id'].", `name` = 'Сильный Удар',`kol`='12',`param`='whack', `time` = '".$t."', `bonus`='-12 сек', `image`='16',`typ`='4'");

mysql_query("UPDATE `umen` set `time` = `time`-'12' WHERE `usr` = '".$user['id']."' and `img` = 'gift_of_the_Gods'");
mysql_query("INSERT INTO `bonus` set `usr` = ".$user['id'].", `name` = 'Дар Богов',`kol`='12',`param`='gift_of_the_Gods', `time` = '".$t."', `bonus`='-12 сек', `image`='18',`typ`='4'");

} else {
$_SESSION['err'] = ' У вас уже есть платинум!';
header("Location: /shaman/");
exit;
}
header("Location: /shaman/"); 
$_SESSION['message'] = "Бонус активирован";
}


require_once H.'core/foot.php';
?>