Example #1
0
            foreach ($arrExtensions as $strExtension) {
                $downloadExtensionObj->addNew(array("downloadcategory_id", "extension"), array($downloadCatInfo['downloadcategory_id'], trim($strExtension)));
            }
            echo "\n\t\t\t<div style='display: none' id='successBox'>\n\t\t\t\t<p align='center'>\n\t\t\t\t\tSuccessfully Edited Download Category!\n\t\t\t\t</p>\n\t\t\t</div>\n\t\n\t\t\t<script type='text/javascript'>\n\t\t\t\tpopupDialog('Edit Download Category', '" . $MAIN_ROOT . "members/console.php?cID=" . $cID . "', 'successBox');\n\t\t\t</script>\n\t\t\t";
            if ($resortOrder) {
                $downloadCatObj->resortOrder();
            }
        }
    } else {
        $_POST = filterArray($_POST);
        $_POST['submit'] = false;
    }
}
if (!$_POST['submit']) {
    $countCategories = 0;
    $intHighestOrderNum = $downloadCatObj->getHighestOrderNum();
    $afterSelected = "";
    if ($downloadCatInfo['ordernum'] == 1) {
        $selectCat = $downloadCatInfo['ordernum'] + 1;
        $afterSelected = "selected";
    } else {
        $selectCat = $downloadCatInfo['ordernum'] - 1;
    }
    $result = $mysqli->query("SELECT * FROM " . $dbprefix . "downloadcategory WHERE downloadcategory_id != '" . $downloadCatInfo['downloadcategory_id'] . "' ORDER BY ordernum DESC");
    while ($row = $result->fetch_assoc()) {
        $strSelected = "";
        if ($selectCat == $row['ordernum']) {
            $strSelected = "selected";
        }
        $catOrderOptions .= "<option value='" . $row['downloadcategory_id'] . "' " . $strSelected . ">" . filterText($row['name']) . "</option>";
        $countCategories++;