} else { $strCatImageURL = $_POST['catimageurl']; } } if ($strCatImageURL == "") { $_POST['useimage'] = 0; } } if ($countErrors == 0) { // No errors... Add to DB $arrColumns = array("name", "imageurl", "ordernum", "hidecat", "useimage", "description", "imagewidth", "imageheight", "color"); $arrValues = array($_POST['catname'], $strCatImageURL, $intNewCatOrderNum, $_POST['hidecat'], $_POST['useimage'], $_POST['catdesc'], $_POST['catimagewidth'], $_POST['catimageheight'], $_POST['rankcolor']); $newCat = new RankCategory($mysqli); if ($newCat->addNew($arrColumns, $arrValues)) { // Added New Category... Now set the ranks in this category $newCatInfo = $newCat->get_info(); $rankObj = new Rank($mysqli); $result = $mysqli->query("SELECT * FROM " . $dbprefix . "ranks WHERE rank_id != '1'"); while ($row = $result->fetch_assoc()) { $postVar = "rankid_" . $row['rank_id']; if (isset($_POST[$postVar]) && $_POST[$postVar] == 1) { if ($rankObj->select($row['rank_id'])) { $arrColumn = array("rankcategory_id"); $arrValue = array($newCatInfo['rankcategory_id']); $rankObj->update($arrColumn, $arrValue); } } } 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 Rank Category!\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 Rank Category', '" . $MAIN_ROOT . "members', 'successBox');\n\t\t\t</script>\n\t\t\t"; } else { $_POST['submit'] = false;