$rankCatInfo['imagewidth'] = $imageSize[0]; } if ($rankCatInfo['imageheight'] == 0) { $imageURL = $rankCatObj->getLocalImageURL(); $imageSize = getimagesize($imageURL); $rankCatInfo['imageheight'] = $imageSize[1]; } echo "\n\t\t\t<tr>\n\t\t\t\t<td class='main' align='center' colspan='2'><img src='" . $rankCatInfo['imageurl'] . "' width='" . $rankCatInfo['imagewidth'] . "' height='" . $rankCatInfo['imageheight'] . "' onmouseover=\"showToolTip('<b>" . $rankCatInfo['name'] . "</b><br>" . $rankCatInfo['description'] . "')\" onmouseout='hideToolTip()'></td>\n\t\t\t</tr>\n\t\t"; } else { $dispCatDesc = ""; if ($rankCatInfo['description'] != "") { $dispCatDesc = " style='cursor: pointer' onmouseover=\"showToolTip('<b>" . $rankCatInfo['name'] . "</b><br>" . $rankCatInfo['description'] . "')\" onmouseout='hideToolTip()'"; } echo "\n\t\t\t<tr>\n\t\t\t\t<td class='formTitle' align='center' colspan='2'><span" . $dispCatDesc . ">" . $rankCatInfo['name'] . "</span></td>\n\t\t\t</tr>\n\t\t"; } $arrRanks = $rankCatObj->getAssociateIDs("ORDER BY ordernum DESC"); foreach ($arrRanks as $rankID) { $rankObj->select($rankID); $rankInfo = $rankObj->get_info_filtered(); if ($rankInfo['hiderank'] == 0) { if ($rankInfo['imagewidth'] == 0) { $imageURL = $rankObj->getLocalImageURL(); $imageSize = getimagesize($imageURL); $rankInfo['imagewidth'] = $imageSize[0]; } if ($rankInfo['imageheight'] == 0) { $imageURL = $rankObj->getLocalImageURL(); $imageSize = getimagesize($imageURL); $rankInfo['imageheight'] = $imageSize[1]; } echo "\n\t\t\t\t<tr>\n\t\t\t\t\t<td align='center' valign='top' style='width: 50%'>\n\t\t\t\t\t\t<img src='" . $rankInfo['imageurl'] . "' width='" . $rankInfo['imagewidth'] . "' height='" . $rankInfo['imageheight'] . "'>\n\t\t\t\t\t</td>\n\t\t\t\t\t<td valign='top' style='width: 50%' class='main'>\n\t\t\t\t\t\t<b>" . $rankInfo['name'] . "</b><br>\n\t\t\t\t\t\t" . nl2br($rankInfo['description']) . "\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr><td colspan='2'><br></td></tr>\n\t\t\t";
include_once "../../../../_setup.php"; include_once "../../../../classes/member.php"; include_once "../../../../classes/rank.php"; include_once "../../../../classes/consoleoption.php"; include_once "../../../../classes/rankcategory.php"; $member = new Member($mysqli); $member->select($_SESSION['btUsername']); $rankCatObj = new RankCategory($mysqli); $consoleObj = new ConsoleOption($mysqli); $cID = $consoleObj->findConsoleIDByName("Manage Rank Categories"); $consoleObj->select($cID); $_GET['cID'] = $cID; if ($member->authorizeLogin($_SESSION['btPassword'])) { $memberInfo = $member->get_info_filtered(); if ($member->hasAccess($consoleObj) && $rankCatObj->select($_POST['rID'])) { define('MEMBERRANK_ID', $memberInfo['rank_id']); $rankCatInfo = $rankCatObj->get_info_filtered(); $arrRanks = $rankCatObj->getAssociateIDs(); if (count($arrRanks) > 0) { echo "<div id='newDeleteMessage' style='display: none'><p align='center'>There are currently ranks under the rank category <b>" . $rankCatInfo['name'] . "</b>. Please change all ranks with 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 Rank 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 (isset($_POST['confirm']) && $_POST['confirm'] == "1") { $rankCatObj->delete(); include "main.php"; } else { echo "<p align='center'>Are you sure you want to delete the rank category <b>" . $rankCatInfo['name'] . "</b>?"; } } elseif (!$rankCatObj->select($_POST['rID'])) { echo "<p align='center'>Unable find the selected rank category. Please try again or contact the website administrator.</p>"; } }