Пример #1
0
if (!isset($member) || substr($_SERVER['PHP_SELF'], -11) != "console.php") {
    exit;
} else {
    $memberInfo = $member->get_info_filtered();
    $consoleObj->select($_GET['cID']);
    if (!$member->hasAccess($consoleObj)) {
        exit;
    }
}
include_once $prevFolder . "classes/consolecategory.php";
$cID = $_GET['cID'];
$consoleCatObj = new ConsoleCategory($mysqli);
if (!$consoleCatObj->select($_GET['catID'])) {
    die("<script type='text/javascript'>window.location = '" . $MAIN_ROOT . "members';</script>");
}
$consoleCatInfo = $consoleCatObj->get_info_filtered();
echo "\n\n<script type='text/javascript'>\n\$(document).ready(function() {\n\$('#breadCrumb').html(\"<a href='" . $MAIN_ROOT . "'>Home</a> > <a href='" . $MAIN_ROOT . "members'>My Account</a> > <a href='" . $MAIN_ROOT . "members/console.php?cID=" . $cID . "'>Manage Console Categories</a> > " . $consoleCatInfo['name'] . "\");\n});\n</script>\n";
if ($_POST['submit']) {
    $resortOrder = false;
    // Check Category Name
    if (trim($_POST['catname']) == "") {
        $countErrors++;
        $dispError .= "&nbsp;&nbsp;&nbsp;<b>&middot;</b> You must enter a Category Name.<br>";
    }
    // Check Cat Order
    $intNewOrderSpot = "";
    if (!$consoleCatObj->select($_POST['catorder']) and $_POST['catorder'] != "first") {
        $countErrors++;
        $dispError .= "&nbsp;&nbsp;&nbsp;<b>&middot;</b> You selected an invalid category order. (category)<br>";
    } elseif ($_POST['catorder'] == "first") {
        // "(no other categories)" selected, check to see if there are actually no other categories