Clan Doneren |
|
";
$amount = $_POST['amount'];
$amount = mysql_real_escape_string($amount);
$amount = htmlentities($amount);
$query = mysql_query("SELECT name, cash, UNIX_TIMESTAMP(`started`) AS started FROM `[clans]` WHERE `name`='{$data['clan']}'") or die(mysql_error());
$naar = mysql_fetch_assoc($query);
if(empty($amount)){
echo "Je moet een bedrag invullen";
}
elseif(strlen($amount) < 0 || strlen($amount) > 12){
echo "Je mag maximaal 12 cijfers/letters invoeren";
}
elseif(!is_numeric($amount)){
echo "Je bedrag mag alleen uit cijfers bestaan";
}
elseif($amount > $data['cash']){
echo "Je hebt zoveel geld niet cash";
}
elseif($amount < 0){
echo "Minimaal 1";
}
elseif($amount > 100000000000){
echo "Maximaal 100000000000 per keer";
}
else
{
mysql_query("SELECT RELEASE_LOCK('donate_'".$data['clan']."'')");
mysql_query("UPDATE `[users]` SET clandonatie = `clandonatie` + '".$amount."' WHERE login='".$data['login']."'");
mysql_query("UPDATE `[users]` SET cash = `cash` - '".$amount."' WHERE login='".$data['login']."'") or die (mysql_error());
mysql_query("UPDATE `[clans]` SET cash = `cash` + '".$amount."' WHERE name='".$data['clan']."'") or die (mysql_error());
echo "Je hebt succesvol ".$amount." naar je clan gestuurt";
}
echo " | ";
}
?>