} } else { $logoImageURL = $_POST['logourl']; } if ($countErrors == 0) { $newSquadObj = new Squad($mysqli); if ($_POST['recruiting'] != 0) { $_POST['recruiting'] = 1; } if ($_POST['shoutbox'] != 0) { $_POST['shoutbox'] = 1; } $time = time(); $arrColumns = array("member_id", "name", "description", "logourl", "recruitingstatus", "datecreated", "privateshoutbox", "website"); $arrValues = array($memberInfo['member_id'], $_POST['squadname'], $_POST['squaddesc'], $logoImageURL, $_POST['recruiting'], $time, $_POST['shoutbox'], $_POST['squadsite']); if ($newSquadObj->addNew($arrColumns, $arrValues)) { $newSquadInfo = $newSquadObj->get_info_filtered(); $arrColumns = array("squad_id", "name", "sortnum", "postnews", "managenews", "postshoutbox", "manageshoutbox", "addrank", "manageranks", "editprofile", "sendinvites", "acceptapps", "setrank", "removemember"); $arrValues = array($newSquadInfo['squad_id'], "Founder", 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); $checkAddRank = $newSquadObj->objSquadRank->addNew($arrColumns, $arrValues); $squadRankInfo = $newSquadObj->objSquadRank->get_info(); $checkAddMember = $newSquadObj->objSquadMember->addNew(array("squad_id", "member_id", "squadrank_id", "datejoined"), array($newSquadInfo['squad_id'], $memberInfo['member_id'], $squadRankInfo['squadrank_id'], $time)); if ($checkAddRank && $checkAddMember) { echo "\n\t\t\t\t\n\t\t\t\t<div style='display: none' id='successBox'>\n\t\t\t\t\t<p align='center'>\n\t\t\t\t\t\tSuccessfully Created New Squad: <b>" . $newSquadInfo['name'] . "</b>!\n\t\t\t\t\t</p>\n\t\t\t\t</div>\n\t\t\t\t\n\t\t\t\t<script type='text/javascript'>\n\t\t\t\t\tpopupDialog('Create a Squad', '" . $MAIN_ROOT . "members', 'successBox');\n\t\t\t\t</script>\n\t\t\t\t\n\t\t\t\t"; } else { $countErrors++; $dispError .= " <b>·</b> Unable to save information to the database. Please contact the website administrator.<br>"; } } else { $countErrors++; $dispError .= " <b>·</b> Unable to save information to the database. Please contact the website administrator.<br>";