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.

search.php 2.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <?PHP
  2. require_once('lib/dashboard.php');
  3. require_once('lib/common.php');
  4. $admins = getAdmins();
  5. $categories = getCategories();
  6. if (isset($_POST['search'])) {
  7. $_POST = repairPost($_POST);
  8. $search = $_POST;
  9. } elseif (isset($_GET['n']) && ctype_digit($_GET['n'])) {
  10. $sql = 'SELECT isea_name, user_id, isea_options FROM issues_searches WHERE isea_id = '.m($_GET['n']).';';
  11. $res = mysql_query($sql) or die(mysql_error());
  12. if (mysql_num_rows($res) > 0) {
  13. $data = mysql_fetch_assoc($res);
  14. $search = unserialize($data['isea_options']);
  15. $search['title'] = $data['isea_name'];
  16. foreach($search as $key => $value) {
  17. if ($value == '<<me>>') {
  18. $search[$key] = getUserID($_SERVER['REDIRECT_REMOTE_USER']);
  19. }
  20. }
  21. }
  22. }
  23. if (isset($search)) {
  24. if (!isset($search['categories'])) {
  25. $search['categories'] = array();
  26. }
  27. if ($search['categories'] == 'all') {
  28. $search['categories'] = array_keys($categories);
  29. }
  30. if (!is_array($search['categories'])) {
  31. $search['categories'] = array($search['categories']);
  32. }
  33. if (!isset($search['priority'])) {
  34. $search['priority'] = array();
  35. }
  36. if ($search['priority'] == 'all') {
  37. $search['priority'] = array('urgent', 'high', 'normal', 'low');
  38. }
  39. if (!is_array($search['priority'])) {
  40. $search['priority'] = array($search['priority']);
  41. }
  42. if (!isset($search['status'])) {
  43. $search['status'] = array();
  44. }
  45. if ($search['status'] == 'all') {
  46. $search['status'] = array('open', 'assigned', 'closed', 'reopened');
  47. }
  48. if (!is_array($search['status'])) {
  49. $search['status'] = array($search['status']);
  50. }
  51. } else {
  52. $search = array();
  53. $search['keywords'] = '';
  54. $search['keywordloc'] = 'both';
  55. $search['submitter'] = 'any';
  56. $search['assignee'] = 'any';
  57. $search['added'] = 'any';
  58. $search['updated'] = 'any';
  59. $search['deadline'] = 'any';
  60. $search['priority'] = array('urgent', 'high', 'normal', 'low');
  61. $search['status'] = array('open', 'assigned', 'closed', 'reopened');
  62. $search['categories'] = array_keys($categories);
  63. $search['order'] = 'added';
  64. $search['limit'] = 20;
  65. }
  66. define('TITLE', 'Issue tracker :: Search');
  67. addDashboardItem('Actions', 'Raise new issue', 'addissue');
  68. include_once('res/commonDashboard.php');
  69. require_once('lib/header.php');
  70. require_once('pages/searchform.php');
  71. require_once('pages/searchresults.php');
  72. require_once('lib/footer.php');
  73. ?>