28 lines
1.1 KiB
PHP
28 lines
1.1 KiB
PHP
<?
|
|
if(isset($_POST['convert_ekredit']))
|
|
{
|
|
//îáìåíÿòü åêð. íà êð.
|
|
$mn = ceil((int)($_POST['convert_sum']*100));
|
|
$mn = round(($mn/100),2);
|
|
if($u->bank['money2']>=$mn)
|
|
{
|
|
if($mn<0.01 || $mn>1000000000)
|
|
{
|
|
$re2 = 'Íåâåðíî óêàçàíà ñóììà';
|
|
}else{
|
|
$upd = mysql_query('UPDATE `bank` SET `money1` = "'.mysql_real_escape_string($u->bank['money1']+($mn*$con)).'",`money2` = "'.mysql_real_escape_string($u->bank['money2']-$mn).'" WHERE `id` = "'.$u->bank['id'].'" LIMIT 1');
|
|
if($upd)
|
|
{
|
|
$u->bank['money1'] += $mn*$con;
|
|
$u->bank['money2'] -= $mn;
|
|
$u->addDelo(3,$u->info['id'],'Âû îáìåíÿëè <b>'.$mn.' åêð.</b> íà <b>'.($mn*$con).' êð.</b>, êîìèññèÿ <b>0 êð.</b> <i>(Èòîãî: '.$u->bank['money1'].' êð., '.$u->bank['money2'].' åêð.)</i>',time(),$u->info['city'],'Bank.System',0,mysql_real_escape_string($mn*$con),$u->bank['id']);
|
|
$re2 = 'Âû óäà÷íî îáìåíÿëè <b>'.$mn.' åêð.</b> íà <b>'.($mn*$con).' êð.</b>';
|
|
}else{
|
|
$re2 = 'Íå óäàëîñü âûïîëíèòü îïåðàöèþ';
|
|
}
|
|
}
|
|
}else{
|
|
$re2 = 'Ó âàñ íåò <b>'.$mn.' åêð.</b> íà ñ÷åòå';
|
|
}
|
|
}
|
|
?>
|