Файл: modules/balance/ajax.php
Строк: 40
<?
if($CONFIG['uid']==0) die('Access denied.');
if($this->Act=='changetomoney'):
$col = $_POST['col'];
$kurs = 0.07;
if($col>=50 && $col<=$CONFIG['Globals']['balance'] && is_numeric($col)){
$money = $CONFIG['Globals']['money']+($col*$kurs);
$balance = $CONFIG['Globals']['balance']-$col;
$uid = $CONFIG['uid'];
if(is_numeric($balance) && is_numeric($money)){
mysql_query("UPDATE `users` SET `balance` = '$balance', `money` = '$money' WHERE `id` =$uid;");
$Array = array('ok');
echo Ajax::Responce($Array);
} else {
$Array = array('err');
echo Ajax::Responce($Array);
}
} else {
$Array = array('err');
echo Ajax::Responce($Array);
}
elseif($this->Act=='changetoballs'):
$col = $_POST['col'];
$kurs = 10;
if($col<=$CONFIG['Globals']['money'] && $col>0 && is_numeric($col)){
$balance = $CONFIG['Globals']['balance']+($col*$kurs);
$money = $CONFIG['Globals']['money']-$col;
$uid = $CONFIG['uid'];
if(is_numeric($balance) && is_numeric($money)){
mysql_query("UPDATE `users` SET `balance` = '$balance', `money` = '$money' WHERE `id` =$uid;");
$Array = array('ok');
echo Ajax::Responce($Array);
} else {
$Array = array('err');
echo Ajax::Responce($Array);
}
} else {
$Array = array('err');
echo Ajax::Responce($Array);
}
endif;