Ejemplo n.º 1
0
 function resetPlayers()
 {
     global $sql;
     $q = "SELECT " . TBL_PLAYERS . ".*" . " FROM " . TBL_PLAYERS . " WHERE (" . TBL_PLAYERS . ".Event = '" . $this->fields['EventID'] . "')";
     $result = $sql->db_Query($q);
     $num_players = mysql_numrows($result);
     if ($num_players != 0) {
         for ($j = 0; $j < $num_players; $j++) {
             $PlayerID = mysql_result($result, $j, TBL_PLAYERS . ".PlayerID");
             $q2 = "UPDATE " . TBL_PLAYERS . " SET ELORanking = '" . $this->fields['ELO_default'] . "'," . "     TS_mu = '" . floatToSQL($this->fields['TS_default_mu']) . "'," . "     TS_sigma = '" . floatToSQL($this->fields['TS_default_sigma']) . "'," . "     G2_r = '" . floatToSQL($this->fields['G2_default_r']) . "'," . "     G2_RD = '" . floatToSQL($this->fields['G2_default_RD']) . "'," . "     G2_sigma = '" . floatToSQL($this->fields['G2_default_sigma']) . "'," . "     GamesPlayed = 0," . "     Loss = 0," . "     Win = 0," . "     Draw = 0," . "     Score = 0," . "     ScoreAgainst = 0," . "     Points = 0," . "     Forfeits = 0," . "     Rank = 0," . "     RankDelta = 0," . "     OverallScore = 0," . "     Streak = 0," . "     Streak_Best = 0," . "     Streak_Worst = 0" . " WHERE (PlayerID = '{$PlayerID}')";
             $result2 = $sql->db_Query($q2);
             deletePlayerAwards($PlayerID);
         }
     }
 }
Ejemplo n.º 2
0
    header("Location: eventmanage.php?eventid={$event_id}");
    exit;
}
if (isset($_POST['del_player_games']) && $_POST['del_player_games'] != "") {
    $playerid = $_POST['del_player_games'];
    deletePlayerMatches($playerid);
    if ($event->getField('FixturesEnable') == TRUE) {
        $event->brackets(true);
    }
    updateStats($event_id, $time, TRUE);
    header("Location: eventmanage.php?eventid={$event_id}");
    exit;
}
if (isset($_POST['del_player_awards']) && $_POST['del_player_awards'] != "") {
    $playerid = $_POST['del_player_awards'];
    deletePlayerAwards($playerid);
    header("Location: eventmanage.php?eventid={$event_id}");
    exit;
}
if (isset($_POST['checkin_player']) && $_POST['checkin_player'] != "") {
    $playerid = $_POST['checkin_player'];
    checkinPlayer($playerid);
    if ($event->getField('FixturesEnable') == TRUE && $event->getField('Status') == 'active') {
        $event->brackets(true);
    }
    $event->setFieldDB('IsChanged', 1);
    header("Location: eventmanage.php?eventid={$event_id}");
    exit;
}
if (isset($_POST['replace_player']) && $_POST['replace_player'] != "") {
    $playerid = $_POST['replace_player'];