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.

10k_points.php 1.2KB

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