コード例 #1
0
ファイル: editstatus.php プロジェクト: nsystem1/clanscripts
            $uploadImg = new BTUpload($_POST['statusimageurl'], "status_", "../images/diplomacy/", array(".jpg", ".png", ".gif", ".bmp"), 4, true);
            if (!$uploadImg->uploadFile()) {
                $countErrors++;
                $dispError .= "&nbsp;&nbsp;&nbsp;<b>&middot;</b> Unable to download status image from remote url. You may need to first download the image and upload normally.<br>";
            } else {
                $statusImageURL = "images/diplomacy/" . $uploadImg->getUploadedFileName();
            }
        } else {
            $statusImageURL = $diplomacyStatusInfo['imageurl'];
        }
        // If there are still no errors after uploading the image, add to db
        if ($countErrors == 0) {
            $arrColumns = array("name", "imageurl", "imagewidth", "imageheight", "ordernum");
            $arrValues = array($_POST['statusname'], $statusImageURL, $_POST['imagewidth'], $_POST['imageheight'], $intNewOrderNum);
            $diplomacyStatusObj->select($diplomacyStatusInfo['diplomacystatus_id']);
            if ($diplomacyStatusObj->update($arrColumns, $arrValues)) {
                echo "\n\t\t\t\t\n\t\t\t\t\t<div style='display: none' id='successBox'>\n\t\t\t\t\t\t<p align='center'>\n\t\t\t\t\t\t\tSuccessfully edited the " . $diplomacyStatusObj->get_info_filtered("name") . " diplomacy status!\n\t\t\t\t\t\t</p>\n\t\t\t\t\t</div>\n\t\t\t\t\t\n\t\t\t\t\t<script type='text/javascript'>\n\t\t\t\t\t\tpopupDialog('Edit Diplomacy Status', '" . $MAIN_ROOT . "members', 'successBox');\n\t\t\t\t\t</script>\n\t\t\t\t\n\t\t\t\t";
                $diplomacyStatusObj->resortOrder();
                $member->logAction("Edited the " . $_POST['statusname'] . " diplomacy status.");
            } 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['submit'] = false;
    }
}
if (!$_POST['submit']) {
    $arrBeforeAfter = $diplomacyStatusObj->findBeforeAfter();
コード例 #2
0
 include BASE_DIRECTORY . "members/include/membermanagement/include/appcomponent_form.php";
 if ($_POST['saveComponent']) {
     // Check Component Name
     if (trim($_POST['saveComponentName']) == "") {
         $addAppForm->errors[] = "You can't have a blank component name.<br>";
     }
     if (!in_array($_POST['saveComponentType'], array_keys($typeOptions))) {
         $addAppForm->errors[] .= "You selected an invalid component type.<br>";
     }
     if (count($addAppForm->errors) == 0) {
         if ($_POST['saveComponentRequired'] != 0) {
             $_POST['saveComponentRequired'] = 1;
         }
         $arrColumns = array("name", "componenttype", "required", "tooltip");
         $arrValues = array($_POST['saveComponentName'], $_POST['saveComponentType'], $_POST['saveComponentRequired'], $_POST['saveComponentTooltip']);
         if ($appComponentObj->update($arrColumns, $arrValues)) {
             if ($appCompInfo['componenttype'] == "select" || $appCompInfo['componenttype'] == "multiselect" || $appCompInfo['componenttype'] == "profile") {
                 $mysqli->query("DELETE FROM " . $dbprefix . "app_selectvalues WHERE appcomponent_id = '" . $appCompInfo['appcomponent_id'] . "'");
             }
             if ($_POST['saveComponentType'] == "select" || $_POST['saveComponentType'] == "multiselect") {
                 $appComponentSelectOptionObj = new Basic($mysqli, "app_selectvalues", "appselectvalue_id");
                 foreach ($_SESSION['btAppComponent']['cOptions'] as $optionValue) {
                     $appComponentSelectOptionObj->addNew(array("appcomponent_id", "componentvalue"), array($appCompInfo['appcomponent_id'], $optionValue));
                 }
             } elseif ($_POST['saveComponentType'] == "profile") {
                 $appComponentSelectOptionObj = new Basic($mysqli, "app_selectvalues", "appselectvalue_id");
                 $appComponentSelectOptionObj->addNew(array("appcomponent_id", "componentvalue"), array($appCompInfo['appcomponent_id'], $_POST['profileOptionID']));
             }
             $member->logAction("Modified the member application.");
             echo "\n\t\t\t\t\t\n\t\t\t\t\t\t<div id='editAppComponentSuccess' style='display: none'>\n\t\t\t\t\t\t\t<p class='main' align='center'>\n\t\t\t\t\t\t\t\tMember Application Component Saved!<br><br>\n\t\t\t\t\t\t\t\tClick OK to continue modifying the member application.\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\n\t\t\t\t\t\t<script type='text/javascript'>\n\t\t\t\t\t\t\t\$(document).ready(function() {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\$('#editAppComponentSuccess').dialog({\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\ttitle: 'Edit Application Component',\n\t\t\t\t\t\t\t\t\tmodal: true,\n\t\t\t\t\t\t\t\t\tzIndex: 99999,\n\t\t\t\t\t\t\t\t\tshow: 'scale',\n\t\t\t\t\t\t\t\t\twidth: 450,\n\t\t\t\t\t\t\t\t\tresizable: false,\n\t\t\t\t\t\t\t\t\tbuttons: {\n\t\t\t\t\t\t\t\t\t\t'OK': function() {\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\$('#loadingSpiral').show();\n\t\t\t\t\t\t\t\t\t\t\t\$('#appComponentList').fadeOut(250);\n\t\t\t\t\t\t\t\t\t\t\t\$.post('" . $MAIN_ROOT . "members/include/membermanagement/include/appcomponentlist.php', { }, function(data) {\n\t\t\t\t\t\t\t\t\t\t\t\t\$('#appComponentList').html(data);\n\t\t\t\t\t\t\t\t\t\t\t\t\$('#loadingSpiral').hide();\n\t\t\t\t\t\t\t\t\t\t\t\t\$('#appComponentList').fadeIn(250);\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\$(this).dialog('close');\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\$('#appComponentForm').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\t});\n\t\t\t\t\t\t</script>\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t";
         } else {