コード例 #1
0
$cID = $consoleObj->findConsoleIDByName("Member Application");
$consoleObj->select($cID);
$appComponentObj = new BasicOrder($mysqli, "app_components", "appcomponent_id");
if ($member->authorizeLogin($_SESSION['btPassword']) && $member->hasAccess($consoleObj)) {
    include BASE_DIRECTORY . "members/include/membermanagement/include/appcomponent_form.php";
    if ($_POST['saveComponent']) {
        // Check Component Name
        if (trim($_POST['newComponentName']) == "") {
            $addAppForm->errors[] = "You can't have a blank component name.<br>";
        }
        if (!in_array($_POST['newComponentType'], array_keys($typeOptions))) {
            $addAppForm->errors[] = "You selected an invalid component type.<br>";
        }
        if (count($addAppForm->errors) == 0) {
            if ($appComponentObj->getHighestOrderNum() == "") {
                $componentOrderNum = $appComponentObj->validateOrder("first", "before");
            } else {
                $appComponentObj->selectByOrder(1);
                $componentOrderNum = $appComponentObj->makeRoom("after");
            }
            if ($_POST['newComponentRequired'] != 0) {
                $_POST['newComponentRequired'] = 1;
            }
            $arrColumns = array("name", "componenttype", "ordernum", "required", "tooltip");
            $arrValues = array($_POST['newComponentName'], $_POST['newComponentType'], $componentOrderNum, $_POST['newComponentRequired'], $_POST['newComponentTooltip']);
            if ($appComponentObj->addNew($arrColumns, $arrValues)) {
                if ($_POST['newComponentType'] == "select" || $_POST['newComponentType'] == "multiselect") {
                    $appComponentSelectOptionObj = new Basic($mysqli, "app_selectvalues", "appselectvalue_id");
                    $newComponentID = $appComponentObj->get_info("appcomponent_id");
                    foreach ($_SESSION['btAppComponent']['cOptions'] as $optionValue) {
                        $appComponentSelectOptionObj->addNew(array("appcomponent_id", "componentvalue"), array($newComponentID, $optionValue));
コード例 #2
0
ファイル: addcategory.php プロジェクト: nsystem1/clanscripts
    }
}
$cID = $_GET['cID'];
$dispError = "";
$countErrors = 0;
$categoryObj = new BasicOrder($mysqli, "forum_category", "forumcategory_id");
$categoryObj->set_assocTableName("forum_board");
$categoryObj->set_assocTableKey("forumboard_id");
if ($_POST['submit']) {
    // Check Name
    if (trim($_POST['catname']) == "") {
        $dispError .= "&nbsp;&nbsp;&nbsp;<b>&middot;</b> Category name may not be blank.<br>";
        $countErrors++;
    }
    // Check Order
    $intNewOrderSpot = $categoryObj->validateOrder($_POST['displayorder'], $_POST['beforeafter']);
    if ($intNewOrderSpot === false) {
        $dispError .= "&nbsp;&nbsp;&nbsp;<b>&middot;</b> You selected an invalid display order.<br>";
        $countErrors++;
    }
    if ($countErrors == 0) {
        $arrColumns = array("name", "ordernum");
        $arrValues = array($_POST['catname'], $intNewOrderSpot);
        if ($categoryObj->addNew($arrColumns, $arrValues)) {
            $forumCatInfo = $categoryObj->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 Added New Forum Category: <b>" . $forumCatInfo['name'] . "</b>!\n\t\t\t\t</p>\n\t\t\t</div>\n\t\t\t\n\t\t\t<script type='text/javascript'>\n\t\t\t\tpopupDialog('Add Forum Category', '" . $MAIN_ROOT . "members', 'successBox');\n\t\t\t</script>\n\t\t\t";
        } else {
            $countErrors++;
            $dispError .= "&nbsp;&nbsp;&nbsp;<b>&middot;</b> Unable to save category to the database.  Please contact the website administrator.<br>";
        }
    }
コード例 #3
0
    $consoleObj->select($_GET['cID']);
    if (!$member->hasAccess($consoleObj)) {
        exit;
    }
}
$cID = $_GET['cID'];
include_once "../classes/btupload.php";
if ($_POST['submit']) {
    $diplomacyStatusObj = new BasicOrder($mysqli, "diplomacy_status", "diplomacystatus_id");
    // Check Name
    if (trim($_POST['statusname']) == "") {
        $dispError .= "&nbsp;&nbsp;&nbsp;<b>&middot;</b> Status name may not be blank.<br>";
        $countErrors++;
    }
    // Check Display Order
    $intNewOrderNum = $diplomacyStatusObj->validateOrder($_POST['displayorder'], $_POST['beforeafter']);
    if ($intNewOrderNum === false) {
        $dispError .= "&nbsp;&nbsp;&nbsp;<b>&middot;</b> You selected an invalid display order.<br>";
        $countErrors++;
    }
    $statusImageURL = "";
    if ($countErrors == 0) {
        // If no errors, check for image upload and try to upload the image
        if ($_FILES['statusimagefile']['name'] != "") {
            $uploadImg = new BTUpload($_FILES['statusimagefile'], "status_", "../images/diplomacy/", array(".jpg", ".png", ".gif", ".bmp"));
            if (!$uploadImg->uploadFile()) {
                $countErrors++;
                $dispError .= "&nbsp;&nbsp;&nbsp;<b>&middot;</b> Unable to upload status image. Please make sure the file size is not too big and it has an acceptable file extension.<br>";
            } else {
                $statusImageURL = "images/diplomacy/" . $uploadImg->getUploadedFileName();
            }