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.

doticket.php 1.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?PHP
  2. require_once('lib/account.php');
  3. require_once('lib/dashboard.php');
  4. require_once('lib/database.php');
  5. if (get_magic_quotes_gpc() == 1) {
  6. foreach ($_POST as $k => $v) { $_POST[$k] = stripslashes($v); }
  7. }
  8. if (isset($_POST['body']) && isset($_POST['subject'])) {
  9. if (USER == 'demo') {
  10. define('MESSAGE','Sorry. The demo account can\'t raise tickets.');
  11. } elseif (strlen($_POST['body']) < 10) {
  12. define('MESSAGE', 'Please enter a complete description of the problem.');
  13. } elseif (strlen($_POST['subject']) < 5) {
  14. define('MESSAGE', 'Please enter a complete subject.');
  15. } else {
  16. $sql = 'INSERT INTO tickets (user_id, ticket_title, ticket_body, ';
  17. $sql .= 'ticket_time, ticket_status) VALUES ('.UID.', \''.m($_POST['subject']).'\', ';
  18. $sql .= '\''.m($_POST['body']).'\', '.time().', \'new\')';
  19. mysql_query($sql) or mf(__FILE__, __LINE__, $sql);
  20. $id = mysql_insert_id();
  21. $sql = 'UPDATE tickets SET ticket_thread = '.$id.' WHERE ticket_id = '.$id;
  22. mysql_query($sql) or mf(__FILE__, __LINE__, $sql);
  23. require('../common/ticketmail.php');
  24. adminTicketMail($id);
  25. logger::log('Raised ticket: '.$_POST['subject'], logger::normal);
  26. header('Location: '.CP_PATH.'viewticket/'.$id);
  27. die;
  28. }
  29. } else {
  30. define('MESSAGE', 'No ticket data submitted');
  31. }
  32. define('TITLE', 'Error');
  33. addDashboardItem('Useful links', 'Support center', 'support');
  34. addDashboardItem('Useful links', 'Raise a new ticket', 'tickets');
  35. addDashboardItem('Frequently asked questions', 'Can I file support requests without using the control panel?', 'support/005');
  36. require_once('lib/header.php');
  37. require_once('lib/footer.php');
  38. ?>