[code] case 'money':
$title = 'Казна клана';
include './system/h.php';
if(!$clan['id'] OR $clan['id'] != $i['id']) {
header('location: /clan/');
exit;
}
$g = _string(_num($_POST['g']));
$s = _string(_num($_POST['s']));
if($user['g'] < $g) {
echo 'На счёте не достаточно средств';
} else {
if($g OR $s) {
if($g && $user['g'] >= $g) {
mysql_query('UPDATE `clans` SET `g` = `g` + '.$g.' WHERE `id` = "'.$clan['id'].'"');
mysql_query('UPDATE `users` SET `g` = `g` - '.$g.' WHERE `id` = "'.$user['id'].'"');
}
if($s && $user['s'] >= $s) {
mysql_query('UPDATE `clans` SET `s` = `s` + '.$s.' WHERE `id` = "'.$clan['id'].'"');
mysql_query('UPDATE `users` SET `s` = `s` - '.$s.' WHERE `id` = "'.$user['id'].'"');
}
header('location: /clan/money/');
}
?>
<div class='main'>
<div class='block_zero'>
Казна клана: <img src='/images/icon/silver.png' alt='*'/> <?=n_f($i['s'])?> <img src='/images/icon/gold.png' alt='*'/> <?=n_f($i['g'])?><br/>
У вас на счету: <img src='/images/icon/silver.png' alt='*'/> <?=n_f($user['s'])?> <img src='/images/icon/gold.png' alt='*'/> <?=n_f($user['g'])?>
</div>
<div class='mini-line'></div>
<div class='block_zero'>
<?
?>
<form action='/clan/money/' method='post'>
<img src='/images/icon/gold.png' alt='*'/> <input name='g' value='0'/><br/>
<img src='/images/icon/silver.png' alt='*'/> <input name='s' value='0'/><br/>
<input type='submit' value='Пополнить'/>
</form>
</div>
</div>
<?
}
include './system/f.php';[/code]