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.

makedonor.php 1.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?
  2. authorize();
  3. if (!check_perms('users_give_donor')) {
  4. error(403);
  5. }
  6. if (!is_number($_POST['id']) || !is_numeric($_POST['donation_amount']) || empty($_POST['donation_currency'])) {
  7. error(404);
  8. }
  9. $ConvID = (int)$_POST['id'];
  10. $DB->query("
  11. SELECT c.Subject, c.UserID, c.Level, c.AssignedToUser, c.Unread, c.Status, u.Donor
  12. FROM staff_pm_conversations AS c
  13. JOIN users_info AS u ON u.UserID = c.UserID
  14. WHERE ID = $ConvID");
  15. list($Subject, $UserID, $Level, $AssignedToUser, $Unread, $Status, $Donor) = $DB->next_record();
  16. if ($DB->record_count() == 0) {
  17. error(404);
  18. }
  19. $Message = "Thank for for helping to support the site. It's users like you who make all of this possible.";
  20. if ((int)$Donor === 0) {
  21. $Message .= ' Enjoy your new love from us!';
  22. } else {
  23. $Message .= ' ';
  24. }
  25. $DB->query("
  26. UPDATE staff_pm_conversations
  27. SET Date = NOW(),
  28. Unread = true,
  29. Status = 'Resolved',
  30. ResolverID = ".$LoggedUser['ID']."
  31. WHERE ID = $ConvID");
  32. Donations::donate($UserID, array(
  33. "Source" => "Staff PM",
  34. "Price" => $_POST['donation_amount'],
  35. "Currency" => $_POST['donation_currency'],
  36. "Reason" => $_POST['donation_reason'],
  37. "SendPM" => true));
  38. header('Location: staffpm.php');