$category_new_form = htmlform::genHTMLForm($category_new_data); $title = $category_new_data['category_new']['title']; $image = $category_new_data['category_new']['image']; eval("echo \"" . getTemplate("tickets/tickets_newcategory") . "\";"); } } elseif ($action == 'editcategory' && $id != 0) { if (isset($_POST['send']) && $_POST['send'] == 'send') { $category = validate($_POST['category'], 'category'); $order = validate($_POST['logicalorder'], 'logicalorder'); if ($order < 1 || $order >= 1000) { $order = 1; } if ($category == '') { standard_error(array('stringisempty', 'mycategory')); } else { ticket::editCategory($db, $category, $id, $order); $log->logAction(ADM_ACTION, LOG_INFO, "edited ticket-category '" . $category . "'"); redirectTo($filename, array('page' => $page, 's' => $s)); } } else { $row = $db->query_first('SELECT * FROM `' . TABLE_PANEL_TICKET_CATS . '` WHERE `id` = "' . (int) $id . '"'); $category_edit_data = (include_once dirname(__FILE__) . '/lib/formfields/admin/tickets/formfield.category_edit.php'); $category_edit_form = htmlform::genHTMLForm($category_edit_data); $title = $category_edit_data['category_edit']['title']; $image = $category_edit_data['category_edit']['image']; eval("echo \"" . getTemplate("tickets/tickets_editcategory") . "\";"); } } elseif ($action == 'deletecategory' && $id != 0) { if (isset($_POST['send']) && $_POST['send'] == 'send') { if (ticket::deleteCategory($db, $id) == false) { standard_error('categoryhastickets');
standard_error(array('stringisempty', 'mycategory')); } else { ticket::addCategory($db, $category, $userinfo['adminid']); $log->logAction(ADM_ACTION, LOG_INFO, "added ticket-category '" . $category . "'"); redirectTo($filename, array('page' => $page, 's' => $s)); } } else { eval("echo \"" . getTemplate("ticket/tickets_newcategory") . "\";"); } } elseif ($action == 'editcategory' && $id != 0) { if (isset($_POST['send']) && $_POST['send'] == 'send') { $category = validate($_POST['category'], 'category'); if ($category == '') { standard_error(array('stringisempty', 'mycategory')); } else { ticket::editCategory($db, $category, $id); $log->logAction(ADM_ACTION, LOG_INFO, "edited ticket-category '" . $category . "'"); redirectTo($filename, array('page' => $page, 's' => $s)); } } else { $row = $db->query_first('SELECT * FROM `' . TABLE_PANEL_TICKET_CATS . '` WHERE `id` = "' . (int) $id . '"'); eval("echo \"" . getTemplate("ticket/tickets_editcategory") . "\";"); } } elseif ($action == 'deletecategory' && $id != 0) { if (isset($_POST['send']) && $_POST['send'] == 'send') { if (ticket::deleteCategory($db, $id) == false) { standard_error('categoryhastickets'); } $log->logAction(ADM_ACTION, LOG_INFO, "deleted ticket-category #" . $id); redirectTo($filename, array('page' => $page, 's' => $s)); } else {