switch ($arr['priority']) { case BT_PRIORITY_LOW: $priority = 'Low'; break; case BT_PRIORITY_NORMAL: $priority = 'Normal'; break; case BT_PRIORITY_HIGH: $priority = 'High'; break; default: $priority = 'Abnormal'; break; } //get the main category $MainCategory = $CategoryStore->getMainCategory($arr['maincategory']); switch ($arr['maincategory']) { case BT_CAT_WEBSITE: $MainCategoryName = 'Website'; break; case BT_CAT_WOTLK_CORE: $MainCategoryName = 'WotLK Core'; break; default: $MainCategoryName = 'Unknown'; break; } //get the category $Category = $MainCategory->getCategory($arr['category']); if ($Category === false) { $CategoryName = 'Unknown';
if (!$text) { $ERRORS->Add("Please describe the bug as much detail as possible."); } if (!$category) { $ERRORS->Add("Please select a category."); } else { //validate the category if (!in_array($mainCategory, $validMainCategories)) { $ERRORS->Add("Please select valid category."); } } $ERRORS->Check('/index.php?page=bugtracker_submit'); #################################################################### ## The actual unstuck script begins here $CategoryStore = new BTCategories(); $CategoryData = $CategoryStore->getMainCategory($mainCategory)->getCategory($category); //free memory unset($CategoryStore); //Do more checks if ($CategoryData === false) { $ERRORS->Add("Please select valid sub-category."); } else { if ($CategoryData->hasSubCategories() and !$subcategory) { $ERRORS->Add("Please select specifics."); } else { if ($subcategory) { //try getting the sub-category name if (!($SubCategoryName = $CategoryData->getSubCategoryName($subcategory))) { $ERRORS->Add("Please select valid specifics."); } unset($SubCategoryName);
<?php if (!defined('init_ajax')) { header('HTTP/1.0 404 not found'); exit; } $category = isset($_GET['category']) ? (int) $_GET['category'] : false; if ($category) { $data = new BTCategories(); $catData = $data->getMainCategory($category)->data; unset($data); $encoded = json_encode($catData); unset($catData); echo $encoded; } else { header('HTTP/1.0 404 not found'); exit; } exit;