Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function claim_worked() {
- global $db,$ir,$h,$userid;
- $choice = array(
- 'choiceone',
- 'choicetwo',
- 'choicethree'
- );
- $_POST['choice'] = isset($_POST['choice']) && ctype_alpha($_POST['choice']) && in_array($_POST['choice'], $choice) ? $_POST['choice'] : null;
- if(empty($_POST['choice'])) {
- exit('The choice you chose was not valid');
- $h->endpage();
- }
- $res = $db->query("SELECT * FROM `donate_log` WHERE `donate_buyer` = '$userid'");
- $row = $db->fetch_row($res);
- if($_POST['choice'] == 'choiceone') {
- if($ir['tier'] == 1 && $row['donate_totalprice'] >= 50) {
- $db->query("UPDATE `users` SET `platinum` = `platinum` + 250 WHERE `id` = '$userid'");
- item_add($userid, 75, 3);
- echo "<span style='color:green'>You have chosen 250 platinum and 3 stat tablets</span>";
- } else {
- exit('Your not eligible for a reward.');
- $h->endpage();
- }
- } else if($_POST['choice'] == 'choicetwo') {
- if($ir['tier'] == 1 && $row['donate_totalprice'] >= 50) {
- $db->query("UPDATE `users` SET `platinum` = `platinum` + 100 WHERE `id` = '$userid'");
- item_add($userid, 52, 3);
- echo "<span style='color:green'>You have chosen 100 platinum and 3 Weapon Upgrade Kit</span>";
- } else {
- exit('Your not eligible for a reward.');
- $h->endpage();
- }
- } else if($_POST['choice'] == 'choicethree') {
- if($ir['tier'] == 1 && $row['donate_totalprice'] >= 50) {
- item_add($userid, 43, 1);
- echo "<span style='color:green'>You have chosen Donator Package One</span>";
- } else {
- exit('Your not eligible for a reward.');
- $h->endpage();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment