예제 #1
0
        if ($_POST['headertype'] == "image" && $_FILES['headerimagefile']['name'] != "") {
            $btUploadObj = new BTUpload($_FILES['headerimagefile'], "menuheader_", "../images/menu/", array(".jpg", ".png", ".bmp", ".gif"));
        } elseif ($_POST['headertype'] == "image") {
            $btUploadObj = new BTUpload($_POST['headerimageurl'], "menuheader_", "../images/menu/", array(".jpg", ".png", ".bmp", ".gif"), 4, true);
        }
        if ($_POST['headertype'] == "image" && $btUploadObj->uploadFile()) {
            $headerImageURL = "images/menu/" . $btUploadObj->getUploadedFileName();
        } elseif ($_POST['headertype'] == "image") {
            $countErrors++;
            $dispError .= "&nbsp;&nbsp;&nbsp;<b>&middot;</b> Unable to upload selected image.  Make sure it's the correct file extension and not too big.<br>";
        }
    }
    if ($countErrors == 0) {
        $arrColumns = array("section", "name", "sortnum", "headertype", "headercode", "accesstype", "hide");
        $arrValues = array($_POST['section'], $_POST['categoryname'], $intNewOrderNum, $_POST['headertype'], $headerImageURL, $_POST['accesstype'], $_POST['hidecategory']);
        if ($menuCatObj->addNew($arrColumns, $arrValues)) {
            $menuCatInfo = $menuCatObj->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 Menu Category: <b>" . $menuCatInfo['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 New Menu Category', '" . $MAIN_ROOT . "members', 'successBox');\n\t\t\t</script>\n\t\t\t";
        }
    }
    if ($countErrors > 0) {
        $_POST = filterArray($_POST);
        $_POST['submit'] = false;
    }
}
if (!$_POST['submit']) {
    $selectSection = array();
    if (isset($_GET['sectionID'])) {
        $selectSection[$_GET['sectionID']] = " selected";
    }
    for ($i = 0; $i < $menuXML->info->section->count(); $i++) {