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.

editcategory.php 1.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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.'categories');
  6. }
  7. if (isset($_POST['submit'])) {
  8. $_POST['name'] = trim($_POST['name']);
  9. if (empty($_POST['name'])) {
  10. header('Location: '.CP_PATH.'categories');
  11. return;
  12. }
  13. $sql = 'UPDATE issues_categories SET icat_name = \''.m($_POST['name']).'\', icat_assign = '.m($_POST['assignee']).' WHERE icat_id = '.m($_GET['n']);
  14. $res = mysql_query($sql) or die(mysql_error().'<br />'.$sql);
  15. logger::log('Issue tracker: category edited: '.getCategoryName($_GET['n']), getUserID($_SERVER['REDIRECT_REMOTE_USER']), logger::information);
  16. header('Location: '.CP_PATH.'categories');
  17. return;
  18. }
  19. $admins = getAdmins();
  20. $sql = 'SELECT icat_id, icat_name, icat_assign FROM issues_categories WHERE icat_id = \''.$_GET['n'].'\'';
  21. $res = mysql_query($sql);
  22. if (mysql_num_rows($res) == 0) {
  23. header('Location: '.CP_PATH.'categories');
  24. }
  25. $data = mysql_fetch_assoc($res);
  26. define('TITLE', 'Issue tracker :: Edit Category :: '.h($data['icat_name']));
  27. addDashboardItem('Actions', 'Add Category', 'addcategory');
  28. include_once('res/commonDashboard.php');
  29. require_once('lib/header.php');
  30. require_once('pages/editcategory.php');
  31. require_once('lib/footer.php');
  32. ?>