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.

addreply.php 1.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?PHP
  2. require_once('lib/dashboard.php');
  3. require_once('lib/common.php');
  4. if (!isset($_GET['n']) && !ctype_digit($_GET['n'])) {
  5. header('Location: '.CP_PATH.'viewissues');
  6. }
  7. $sql = 'SELECT i_id FROM issues_issues WHERE i_id = '.m($_GET['n']);
  8. $res = mysql_query($sql);
  9. if (mysql_num_rows($res) == 0) {
  10. header('Location: '.CP_PATH.'viewissues');
  11. }
  12. if (isset($_POST['submit'])) {
  13. if ($_POST['text'] == '') {
  14. header('Location: '.CP_PATH.'viewissue/'.$_GET['n']);
  15. }
  16. $sql = 'INSERT INTO issues_replies
  17. (irep_id, i_id, user_id, irep_time, irep_text)
  18. VALUES(\'0\', \''.m($_GET['n']).'\', \''.m(getUserID($_SERVER['REDIRECT_REMOTE_USER'])).'\',
  19. \''.time().'\', \''.m($_POST['text']).'\')';
  20. $res = mysql_query($sql) or die(mysql_error().'<br />'.$sql);
  21. $sql = 'UPDATE issues_issues SET i_updated = \''.time().'\' WHERE i_id = \''.$_GET['n'].'\';';
  22. $res = mysql_query($sql) or die(mysql_error().'<br />'.$sql);
  23. logger::log('Issue tracker: reply added to : '.getIssueInfo($_GET['n']), getUserID($_SERVER['REDIRECT_REMOTE_USER']), logger::information);
  24. header('Location: '.CP_PATH.'viewissue/'.$_GET['n'].'#'.mysql_insert_id());
  25. return;
  26. }
  27. $categories = getCategories();
  28. $admins = getAdmins();
  29. define('TITLE', 'Issue tracker :: Add Issue');
  30. addDashboardItem('Actions', 'Raise new issue', 'addissue');
  31. include_once('res/commonDashboard.php');
  32. require_once('lib/header.php');
  33. require_once('pages/addreply.php');
  34. require_once('lib/footer.php');
  35. ?>