Clan - Bank |
|
clanlevel >= 8 || $data->clanlevel == 6) {
$dbres = mysql_query("SELECT `name`,`cash`,`bank`,`bankleft`,`bankmax` FROM `[clans]` WHERE `name`='{$data->clan}'");
$clan = mysql_fetch_object($dbres);
if(isset($_POST['out']) && preg_match('/^[0-9]+$/',$_POST['amount'])) {
if($_POST['amount'] <= $clan->bank) {
$clan->cash += $_POST['amount'];
$clan->bank -= $_POST['amount'];
$amount =$_POST['amount'];
mysql_query("UPDATE `[clans]` SET `bank`={$clan->bank},`cash`={$clan->cash} WHERE `name`='{$clan->name}'");
mysql_query("INSERT INTO `[clanlogs]` (`datum`,`wie`,`waar`,`wat`,`wat2`,`hoeveel`) values(NOW(),'$data->login','$data->clan','bank','$amount','1')");
}
else
print " Zoveel geld staat er niet op de bank |
\n";
}
else if(isset($_POST['in']) && preg_match('/^[0-9]+$/',$_POST['amount'])) {
if($_POST['amount'] <= $clan->cash) {
if($_POST['amount'] <= $clan->bankmax) {
if($clan->bankleft > 0) {
$clan->cash -= $_POST['amount'];
$clan->bank += $_POST['amount'];
$clan->bankleft--;
$amount =$_POST['amount'];
mysql_query("UPDATE `[clans]` SET `bank`={$clan->bank},`cash`={$clan->cash},`bankleft`={$clan->bankleft} WHERE `name`='{$clan->name}'");
mysql_query("INSERT INTO `[clanlogs]` (`datum`,`wie`,`waar`,`wat`,`wat2`,`hoeveel`) values(NOW(),'$data->login','$data->clan','bank','$amount','2')");
}
else
print " Je kan niet meer storten vandaag |
\n";
}
else
print " Je mag maar \${$clan->bankmax},- per keer storten |
\n";
}
else
print " Zoveel geld heb je niet |
\n";
}
print <<
Je mag nog {$clan->bankleft}x geld storten (max. \${$clan->bankmax} per keer)
Contant: | \${$clan->cash} |
Op de bank: | \${$clan->bank} |
|
ENDHTML;
}
/* ------------------------- */ ?>