Esempio n. 1
0
include_once "../../../../classes/profilecategory.php";
include_once "../../../../classes/profileoption.php";
$consoleObj = new ConsoleOption($mysqli);
$member = new Member($mysqli);
$member->select($_SESSION['btUsername']);
$profileCatObj = new ProfileCategory($mysqli);
$profileObj = new ProfileOption($mysqli);
$cID = $consoleObj->findConsoleIDByName("Manage Profile Options");
$consoleObj->select($cID);
$_GET['cID'] = $cID;
if ($member->authorizeLogin($_SESSION['btPassword'])) {
    $memberInfo = $member->get_info_filtered();
    $selectedOption = "";
    $addSQL = "";
    if ($member->hasAccess($consoleObj) && $profileCatObj->select($_POST['catID'])) {
        if ($_POST['oID'] != "" and $profileObj->SELECT($_POST['oID'])) {
            $addSQL = " AND profileoption_id != '" . $_POST['oID'] . "'";
            $profileOptionInfo = $profileObj->get_info_filtered();
            if ($profileOptionInfo['profilecategory_id'] == $_POST['catID']) {
                $arrAssociates = $profileCatObj->getAssociateIDs("ORDER BY sortnum");
                $highestIndex = count($arrAssociates) - 1;
                $arrFlipped = array_flip($arrAssociates);
                if ($highestIndex > 0) {
                    if ($arrFlipped[$_POST['oID']] == $highestIndex) {
                        $temp = $highestIndex - 1;
                        $selectedOption = $arrAssociates[$temp];
                    } else {
                        $temp = $arrFlipped[$_POST['oID']] + 1;
                        $selectedConsole = $arrAssociates[$temp];
                    }
                }