Пример #1
0
        if ($_POST['optiontype'] != "select") {
            $_POST['optiontype'] = "input";
        }
        $arrColumnNames = array("profilecategory_id", "name", "optiontype", "sortnum");
        $arrColumnValues = array($_POST['optioncategory'], $_POST['optionname'], $_POST['optiontype'], $intNewSortNum);
        $profileOptionObj->select($profileOptionInfo['profileoption_id']);
        if ($profileOptionObj->update($arrColumnNames, $arrColumnValues)) {
            if ($_POST['optiontype'] == "select" && $_SESSION['btProfileCacheRefresh']) {
                $counter = 1;
                $result = $mysqli->query("DELETE FROM " . $dbprefix . "profileoptions_select WHERE profileoption_id = '" . $profileOptionInfo['profileoption_id'] . "'");
                foreach ($_SESSION['btProfileCache'] as $selectValue) {
                    $profileOptionObj->addNewSelectValue($selectValue, $counter);
                    $counter++;
                }
            }
            $profileOptionObj->resortOrder();
            $newProfileInfo = $profileOptionObj->get_info_filtered();
            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 Profile Option: <b>" . $newProfileInfo['name'] . "</b>!\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 Profile Option', '" . $MAIN_ROOT . "members/console.php?cID=" . $cID . "', 'successBox');\n\t\t\t</script>\n\t\t\t";
        } else {
            $countErrors++;
            $dispError .= "&nbsp;&nbsp;&nbsp;<b>&middot;</b> Unable to save information to the database!  Please contact the website administrator.<br>";
        }
    }
    if ($countErrors > 0) {
        $_POST = filterArray($_POST);
        $_POST['submit'] = false;
    }
}
if (!$_POST['submit']) {
    $afterSelected = "";
    $_SESSION['btProfileCache'] = array();