Joints | ||
Joints maken Joints verkopen Joints versturen |
Versturen | |||||||
if ($data['joint'] < 1){
print "Je moet minimaal 1 joint hebben. Anders is het niet mogelijk te doneren."; }elseif ($data['joint'] > 1){ print<<
Onjuiste invoer. | Probeer het opnieuwd. | ";
exit;
}
if ($_POST['points'] >= 1){
if ($data['login'] != $_POST['user']){
$sentpoints = $_POST['points'];
$sentuser = $_POST['user'];
if ($data->joint >= $sentpoints){
$def = mysql_query("SELECT * FROM `[users]` WHERE `login`='{$sentuser}'");
if ($def2 = mysql_fetch_object($def)){
$fromuser = $data->login;
$joint = $data['joint'];
$allpointsminussent = $joint - $sentpoints;
$towho = $def2['login'];
$fromwho = $data['login'];
$points = $sentpoints;
mysql_query("UPDATE `[users]` SET `joint`=`joint`+'{$sentpoints}' WHERE `login`='{$sentuser}'");
mysql_query("UPDATE `[users]` SET `joint`=`joint`-'{$sentpoints}' WHERE `login`='{$data['login']}'");
print "||||||
Je hebt {$sentpoints} Joints verstuurd naar {$sentuser}. Je hebt nu nog {$allpointsminussent} Joints. |