require_once "../classes/" . $class . ".class.php";
    });
    require_once "../includes/sanitize-all.php";
    define('ALLOW_ACCESS', true);
    // allow access to this page when it is loaded with ajax
} else {
    if ($admin) {
        require_once "../lib/includes/sanitize-all.php";
    } else {
        require_once "lib/includes/sanitize-all.php";
    }
}
defined('ALLOW_ACCESS') or die('Restricted access');
// Security to prevent direct access to php files.
$db = new Database();
$subCategories = $db->getSubCategoriesArray($mainCatID, "CASE WHEN name = 'Other' THEN 2 ELSE 1 END,name ASC");
$subCatID = 0;
if (!empty($_GET["sub_cat_id"])) {
    $subCatID = $_GET["sub_cat_id"];
}
?>


<?php 
if ($subCategories) {
    ?>
	<?php 
    foreach ($subCategories as $cat) {
        ?>
	<?php 
        $status = $cat["id"] == $subCatID ? "checked='checked'" : "";