Unsupported scripts and control panel web app for a hosting company
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.

ticketmail.php 2.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <?PHP
  2. function ticketmail ($ticket) {
  3. $sql = 'SELECT t.ticket_thread, u.user_name, t.ticket_body FROM tickets AS';
  4. $sql .= ' t, users AS u WHERE t.ticket_id = '.$ticket.' AND u.user_id = ';
  5. $sql .= 't.user_id';
  6. $res = mysql_query($sql);
  7. $row = mysql_fetch_array($res);
  8. $sql = 'SELECT u.user_email, u.mail_tickets, t.ticket_title FROM tickets AS'; $sql .= ' t, users AS u';
  9. $sql .= ' WHERE t.ticket_id = '.$row['ticket_thread'].' AND u.user_id = ';
  10. $sql .= ' t.user_id';
  11. $res = mysql_query($sql);
  12. $usr = mysql_fetch_array($res);
  13. if ($usr['mail_tickets'] == '1') {
  14. $to = $usr['user_email'];
  15. $subject = 'UTD-Hosting ticket: '.$usr['ticket_title'];
  16. $body = 'This is an automated message. A reply has been made to one of';
  17. $body .= ' your tickets. A full copy of the message follows. ';
  18. $body .= 'You can view the entire thread and make replies at';
  19. $body .= ' https://secure.utd-hosting.com/control/viewticket/'.$row['ticket_thread'];
  20. $body .= ' and unsubscribe from these updates at ';
  21. $body .= 'https://secure.utd-hosting.com/control/prefs.'."\n\n";
  22. $body .= ' ============ Message from '.$row['user_name'].' ============';
  23. $body .= "\n\n".$row['ticket_body']."\n\n";
  24. $body .= ' ============ End of message ========= '."\n\n";
  25. $body .= "Please do not ";
  26. $body .= 'reply to this e-mail -- use the reply form at the URL above. ';
  27. $body .= "\n\n-- UTD-Hosting support";
  28. mail($to, $subject, $body, 'From: support@utd-hosting.com (UTD-Hosting support)');
  29. }
  30. }
  31. function adminTicketMail($ticket) {
  32. $sql = 'SELECT t.ticket_title, t.ticket_thread, u.user_name, t.ticket_body FROM tickets AS';
  33. $sql .= ' t, users AS u WHERE t.ticket_id = '.$ticket.' AND u.user_id = ';
  34. $sql .= 't.user_id';
  35. $res = mysql_query($sql);
  36. $row = mysql_fetch_array($res);
  37. $sql = 'SELECT user_email FROM users WHERE user_admin = 1';
  38. $res = mysql_query($sql);
  39. while ($usr = mysql_fetch_array($res)) {
  40. $to = $usr['user_email'];
  41. $subject = 'UTD-Hosting ticket: '.$row['ticket_title'];
  42. $body = 'This is an automated message. A new ticket has been posted. View it here: ';
  43. $body .= ' https://secure.utd-hosting.com/control/viewticket/'.$row['ticket_thread']."\n\n";
  44. $body .= ' ============ Message from '.$row['user_name'].' ============';
  45. $body .= "\n\n".$row['ticket_body']."\n\n";
  46. $body .= ' ============ End of message ========= '."\n\n";
  47. $body .= "Please do not ";
  48. $body .= 'reply to this e-mail -- use the reply form at the URL above. ';
  49. $body .= "\n\n-- UTD-Hosting support";
  50. mail($to, $subject, $body, 'From: support@utd-hosting.com (UTD-Hosting support)');
  51. }
  52. }
  53. ?>