Beispiel #1
0
include_once "../../../../_setup.php";
include_once "../../../../classes/member.php";
include_once "../../../../classes/rank.php";
include_once "../../../../classes/consoleoption.php";
include_once "../../../../classes/profilecategory.php";
$consoleObj = new ConsoleOption($mysqli);
$member = new Member($mysqli);
$member->select($_SESSION['btUsername']);
$profileCatObj = new ProfileCategory($mysqli);
$cID = $consoleObj->findConsoleIDByName("Manage Profile Categories");
$_GET['cID'] = $cID;
$consoleObj->select($cID);
if ($member->authorizeLogin($_SESSION['btPassword'])) {
    $memberInfo = $member->get_info_filtered();
    if ($member->hasAccess($consoleObj) && $profileCatObj->select($_POST['catID'])) {
        define('MEMBERRANK_ID', $memberInfo['rank_id']);
        $profileCatInfo = $profileCatObj->get_info_filtered();
        $arrCats = $profileCatObj->getAssociateIDs();
        if (count($arrCats) > 0) {
            echo "<div id='newDeleteMessage' style='display: none'><p align='center'>There are currently profile options with the profile category <b>" . $profileCatInfo['name'] . "</b>.  Please move all profile options out of this category before deleting it.</p></div>";
            echo "\n\t\t\t\t<script type='text/javascript'>\n\t\t\t\t\t\$(document).ready(function() {\n\t\t\t\t\t\t\$('#deleteMessage').dialog('close');\n\t\t\t\t\t\t\$('#newDeleteMessage').dialog({\n\t\t\t\t\t\t\n\t\t\t\t\t\t\ttitle: 'Manage Profile Categories - Delete',\n\t\t\t\t\t\t\tmodal: true,\n\t\t\t\t\t\t\tzIndex: 9999,\n\t\t\t\t\t\t\tresizable: false,\n\t\t\t\t\t\t\tshow: 'scale',\n\t\t\t\t\t\t\twidth: 400,\n\t\t\t\t\t\t\tbuttons: {\n\t\t\t\t\t\t\t\t'OK': function() {\n\t\t\t\t\t\t\t\t\t\$(this).dialog('close');\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t\t});\n\t\t\t\t</script>\n\t\t\t";
        } elseif ($_POST['confirm'] == "1") {
            $profileCatObj->delete();
            include "main.php";
        } else {
            echo "<p align='center'>Are you sure you want to delete the profile category <b>" . $profileCatInfo['name'] . "</b>?";
        }
    } elseif (!$profileCatObj->select($_POST['catID'])) {
        echo "<p align='center'>Unable find the selected profile category.  Please try again or contact the website administrator.</p>";
    }
}