Exemplo n.º 1
0
     * 
     * Using the seed types array because they are same values as Access values 1,2 or 3
     */
    if (!in_array($_POST['tournamentaccess'], $arrSeedTypes)) {
        $countErrors++;
        $dispError .= "&nbsp;&nbsp;&nbsp;<b>&middot;</b> You selected an invalid Access value.<br>";
    }
    // Check Password
    if ($_POST['tournamentpassword'] != "" && $_POST['tournamentpassword'] != $_POST['tournamentpassword1']) {
        $countErrors++;
        $dispError .= "&nbsp;&nbsp;&nbsp;<b>&middot;</b> Your passwords did not match.<br>";
    }
    if ($countErrors == 0) {
        $arrColumns = array("member_id", "gamesplayed_id", "name", "seedtype", "startdate", "eliminations", "playersperteam", "maxteams", "description", "password", "requirereplay", "access", "timezone");
        $arrValues = array($memberInfo['member_id'], $_POST['game'], $_POST['tournamentname'], $_POST['seedtype'], $formattedDate, $_POST['eliminations'], $_POST['playersperteam'], $_POST['totalteams'], $_POST['extrainfo'], md5($_POST['tournamentpassword']), $_POST['requirereplay'], $_POST['tournamentaccess'], $_POST['startimezone']);
        if ($tournamentObj->addNew($arrColumns, $arrValues)) {
            echo "\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 Tournament!\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 Tournament', '" . $MAIN_ROOT . "members', 'successBox');\n\t\t\t\t</script>\n\t\t\t\n\t\t\t";
        } 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 = filterArray($_POST);
        $_POST['submit'] = false;
    }
}
if (!$_POST['submit']) {
    $gameoptions = "";
    $result = $mysqli->query("SELECT * FROM " . $dbprefix . "gamesplayed ORDER BY ordernum DESC");
    while ($row = $result->fetch_assoc()) {