Advertisement
Guest User

Untitled

a guest
Aug 12th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. <?php
  2. show_header("Exchanged");
  3. $DB->query("SELECT BonusPoints FROM users_info WHERE UserID={$LoggedUser['ID']}");
  4. list($LoggedUser['BonusPoints']) = $DB->next_record();
  5. $points=$_GET['points'];
  6. $credit=$BonusPointsSystem[$points];
  7. if ($credit==0) {
  8. error('Bad points','Bad points');
  9. }
  10.  
  11. if ($LoggedUser['BonusPoints']<$points) {
  12. error('You dont have enough points.','You dont have enough points.');
  13. } else {
  14. $DB->query("UPDATE users_info SET BonusPoints=BonusPoints-{$points} WHERE UserID={$LoggedUser['ID']}");
  15. $DB->query("UPDATE users_main SET Uploaded=Uploaded+{$credit} WHERE ID={$LoggedUser['ID']}");
  16. $DB->query("INSERT INTO bonus_points (id,uid,UploadBonus,RecID,PointsUsed) VALUES (NULL,{$LoggedUser['ID']},$credit,NULL,{$points})");
  17. }
  18. update_user_data();
  19. ?>
  20. <div class="thin">
  21. <h3 id="general">Bonus Points</h3>
  22. <div class="box pad" style="padding:10px 10px 10px 20px;">
  23. You've added <strong><?php echo $credit; ?> bytes</strong> to your upload which deducted <strong><?php echo $points; ?></strong> points.
  24. </div>
  25. <!-- END General Rules -->
  26. </div>
  27. <?php
  28. show_footer();
  29. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement