Oppaitime's version of Gazelle
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

invite.php 1.0KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?
  2. $Purchase = "1 invite";
  3. $UserID = $LoggedUser['ID'];
  4. $DB->query("
  5. SELECT BonusPoints
  6. FROM users_main
  7. WHERE ID = $UserID");
  8. if ($DB->has_results()) {
  9. list($Points) = $DB->next_record();
  10. if ($Points >= 100000) {
  11. $DB->query("
  12. UPDATE users_main
  13. SET BonusPoints = BonusPoints - 100000,
  14. Invites = Invites + 1
  15. WHERE ID = $UserID");
  16. $DB->query("
  17. UPDATE users_info
  18. SET AdminComment = CONCAT('".sqltime()." - Purchased an invite from the store\n\n', AdminComment)
  19. WHERE UserID = $UserID");
  20. $Cache->delete_value('user_info_heavy_'.$UserID);
  21. $Worked = true;
  22. } else {
  23. $Worked = false;
  24. $ErrMessage = "Not enough points";
  25. }
  26. }
  27. View::show_header('Store'); ?>
  28. <div class="thin">
  29. <h2 id="general">Purchase <?print $Worked?"Successful":"Failed"?></h2>
  30. <div class="box pad" style="padding: 10px 10px 10px 20px;">
  31. <p><?print $Worked?("You purchased ".$Purchase):("Error: ".$ErrMessage)?></p>
  32. <p><a href="/store.php">Back to Store</a></p>
  33. </div>
  34. </div>
  35. <? View::show_footer(); ?>