<?php
require_once ('system/func.php');
auth(); // Закроем от не авторизованных
# Настройки #
$id = abs(intval($_GET['id']));
if($id)$profile = mysql_fetch_assoc(mysql_query("SELECT * FROM `users` WHERE `id` = '".$id."'"));
else $profile = $user;
$clans = mysql_fetch_assoc(mysql_query("SELECT * FROM `clans` WHERE `id` = '".$user['id_clan']."' "));
# Ошибки #
if(!$profile){
$_SESSION['msg'] == 'Такой игрок не существует';
header('Location: /online?search');
exit();
}
if(isset($_GET['angels'])){
$id = abs(intval($_GET['angels']));
$angels_bonus = ($user['angels_bonus']+1);
$angels = ($user[gold]/1000000);
$gold = 10;
$money_sek = 0;
$room = 1;
$gold_room =10;
if($user['gold'] < 10000000000){
$_SESSION['msg'] = "Ваш доход должен быть больше <img width='20' height='20' src='/img/money_36.png'> ".n_f(10000000000)."";
header('Location: /profile/');
exit();
}else{
mysql_query("UPDATE `users` SET `angels_bonus` = '".($user['angels_bonus']+1)."', `angels` = '".($user['angels']+$angels)."', `gold` = '".$gold."', `money_sek` = '".$money_sek."', `room` = '".$room."', `gold_room` = '".$gold_room."', `clan_angels` = '".($user['clan_angels']+$angels)."' WHERE (`id` = '".$myID."')");
mysql_query("UPDATE `clans` SET `angels` = '".($clans['angels']+$angels)."' WHERE `id` = '".$user['id_clan']."' ");
mysql_query("DELETE FROM `room_users` WHERE `id_user` = '".$myID."'");
$_SESSION['msg'] = 'Вы успешно сбросили бизнес';
header('Location: /profile/');
exit();
}
}
if(isset($_GET['pay10'])){
$id = abs(intval($_GET['pay10']));
$pay_10 = ($user[money_sek]*86400);
if($user['ruby'] < 10){
$_SESSION['msg'] = "Не хватает <img width='20' height='20' src='/img/rubyy.jpg'> ".n_f((10-$user['ruby']))."";
header('Location: /profile/');
exit();
}else{
mysql_query("UPDATE `users` SET `ruby` = '".($user['ruby']-10)."', `gold` = '".($user['gold']+$pay_10)."' WHERE (`id` = '".$myID."')");
$_SESSION['msg'] = "Вы купили <img width='20' height='20' src='/img/money_36.png'> ".n_f($pay_10)."";
header('Location: /profile/');
exit();
}
}
if(isset($_GET['pay30'])){
$id = abs(intval($_GET['pay30']));
$pay_30 = (($user[money_sek]*86400)*7);
if($user['ruby'] < 30){
$_SESSION['msg'] = "Не хватает <img width='20' height='20' src='/img/ruby.png'> ".n_f((30-$user['ruby']))."";
header('Location: /profile/');
exit();
}else{
mysql_query("UPDATE `users` SET `ruby` = '".($user['ruby']-30)."', `gold` = '".($user['gold']+$pay_30)."' WHERE (`id` = '".$myID."')");
$_SESSION['msg'] = "Вы купили <img width='20' height='20' src='/img/money_36.png'> ".n_f($pay_30)."";
header('Location: /profile/');
exit();
}
}
if(isset($_GET['pay90'])){
$id = abs(intval($_GET['pay90']));
$pay_90 = (($user[money_sek]*86400)*49);
if($user['ruby'] < 90){
$_SESSION['msg'] = "Не хватает <img width='20' height='20' src='/img/ruby.png'> ".n_f((90-$user['ruby']))."";
header('Location: /profile/');
exit();
}else{
mysql_query("UPDATE `users` SET `ruby` = '".($user['ruby']-90)."', `gold` = '".($user['gold']+$pay_90)."' WHERE (`id` = '".$myID."')");
$_SESSION['msg'] = "Вы купили <img width='20' height='20' src='/img/money_36.png'> ".n_f($pay_90)."";
header('Location: /profile/');
exit();
}
}
if(isset($_GET['pay270'])){
$id = abs(intval($_GET['pay270']));
$pay_270 = (($user[money_sek]*86400)*343);
if($user['ruby'] < 270){
$_SESSION['msg'] = "Не хватает <img width='20' height='20' src='/img/ruby.png'> ".n_f((270-$user['ruby']))."";
header('Location: /profile/');
exit();
}else{
mysql_query("UPDATE `users` SET `ruby` = '".($user['ruby']-270)."', `gold` = '".($user['gold']+$pay_270)."' WHERE (`id` = '".$myID."')");
$_SESSION['msg'] = "Вы купили <img width='20' height='20' src='/img/money_36.png'> ".n_f($pay_270)."";
header('Location: /profile/');
exit();
}
}
if(isset($_GET['pay810'])){
$id = abs(intval($_GET['pay810']));
$pay_810 = (($user[money_sek]*86400)*2401);
if($user['ruby'] < 810){
$_SESSION['msg'] = "Не хватает <img width='20' height='20' src='/img/ruby.png'> ".n_f((810-$user['ruby']))."";
header('Location: /profile/');
exit();
}else{
mysql_query("UPDATE `users` SET `ruby` = '".($user['ruby']-810)."', `gold` = '".($user['gold']+$pay_810)."' WHERE (`id` = '".$myID."')");
$_SESSION['msg'] = "Вы купили <img width='20' height='20' src='/img/money_36.png'> ".n_f($pay_810)."";
header('Location: /profile/');
exit();
}
}
if(isset($_GET['pay2430'])){
$id = abs(intval($_GET['pay2430']));
$pay_2430 = (($user[money_sek]*86400)*16807);
if($user['ruby'] < 2430){
$_SESSION['msg'] = "Не хватает <img width='20' height='20' src='/img/ruby.png'> ".n_f((2430-$user['ruby']))."";
header('Location: /profile/');
exit();
}else{
mysql_query("UPDATE `users` SET `ruby` = '".($user['ruby']-2430)."', `gold` = '".($user['gold']+$pay_2430)."' WHERE (`id` = '".$myID."')");
$_SESSION['msg'] = "Вы купили <img width='20' height='20' src='/img/money_36.png'> ".n_f($pay_2430)."";
header('Location: /profile/');
exit();
}
}
$title = $profile['login'];
require_once ('system/header.php');
$pay_30 = n_f((($user[money_sek]*86400)*7));
$pay_10 = n_f(($user[money_sek]*86400));
$pay_90 = n_f((($user[money_sek]*86400)*49));
$pay_270 = n_f((($user[money_sek]*86400)*343));
$pay_810 = n_f((($user[money_sek]*86400)*2401));
$pay_2430 = n_f((($user[money_sek]*86400)*16807));
# Информация #
echo'<div class="content"></div>';
echo'<span class="nobr"><center>';
$angels = ($user[gold]/1000000);
if($profile['id'] == $myID){
echo'<a class="btni" style="min-width:135px;margin:4px;" href="/profile/pay//"><span><img src="/img/money_36.png" alt="$" width="16" height="16"/> <span>'.$pay_10.'</span></span> <span>за <span><img width="24" height="24" alt="рубины" src="/img/ruby.png" title="рубины"/><span>Оформить прописку</span></span></span></a>';
echo'<a class="btni" style="min-width:135px;margin:4px;" href="/profile/pay/270/"><span><img src="/img/money_36.png" alt="$" width="16" height="16"/> <span>'.$pay_270.'</span></span> <span>за <span><img width="24" height="24" alt="рубины" src="/img/ruby.png" title="рубины"/><span>270</span></span></span></a><br>';
}else{
}
require_once ('system/footer.php');
?>