$seat2 = new seat2(); unset($_SESSION['tournament_submit_result_blocker']); if ($func->isModActive('server')) { //Server auslesen $selections = array(); $selections['0'] = t('Kein Server zugewiesen'); $res = $db->qry("SELECT * FROM %prefix%server WHERE party_id = %int%", $party->party_id); while ($row = $db->fetch_array($res)) { $selections[$row['serverid']] = $row['caption']; } $db->free_result($res); } $dsp->NewContent(t('Details der Partie %1 vs %2', $team1['name'], $team2['name']), t('Hier siehst du Details zu dieser Partie und kannst das Ergebnis eintragen.')); // Write Start and Enddate for each round $round_start = $tfunc->GetGameStart($tournament, $team1['round'], $team1['group_nr']); $round_end = $tfunc->GetGameEnd($tournament, $team1['round'], $team1['group_nr']); $dsp->AddDoubleRow(t('Spielzeit'), $func->unixstamp2date($round_start, "datetime") . " - " . $func->unixstamp2date($round_end, "datetime")); $dsp->AddDoubleRow(t('Map'), $map[abs(floor($team1['round'])) % count($map)]); if ($func->isModActive('server')) { $dsp->AddDoubleRow(t('Server'), '<a href="index.php?mod=server&action=show_details&serverid=' . $team1['server_id'] . '">' . $selections[$team1['server_id']] . '</a>'); } if ($func->isModActive('server') and $auth['type'] >= 2) { include_once 'inc/classes/class_masterform.php'; $mf = new masterform(); $mf->AddField(t('Server Zuweisen'), 'server_id', IS_SELECTION, $selections, FIELD_OPTIONAL); if ($mf->SendForm("index.php?mod=tournament2&action=submit_result&step=1&tournamentid=" . $tournamentid . "&gameid1=" . $gameid1 . "&gameid2=" . $gameid2, 't2_games', 'gameid', $gameid1)) { $db->qry("UPDATE %prefix%t2_games SET server_id = %int% WHERE gameid = %int%", $_POST['server_id'], $gameid2); } } $dsp->AddHRuleRow(); $dsp->AddSingleRow("<b>" . t('Ergebnis melden') . "</b>");
// Generate Table-head $mintime = 9999999999; $maxtime = 0; $tournaments = $db->qry("SELECT *, UNIX_TIMESTAMP(starttime) AS starttime\n FROM %prefix%tournament_tournaments\n WHERE party_id = %int% AND (%int% > 1 OR status != 'invisible')", $party->party_id, $auth['type']); while ($tournament = $db->fetch_array($tournaments)) { // Calc Min-Time if ($tournament["starttime"] < $mintime) { $mintime = $tournament["starttime"]; } // Calc Max-Time $team_anz = $tfunc->GetTeamAnz($tournament["tournamentid"], $tournament["mode"]); $max_round = 1; for ($z = $team_anz / 2; $z >= 2; $z /= 2) { $max_round++; } $endtime = $tfunc->GetGameEnd($tournament, $max_round); if ($endtime > $maxtime) { $maxtime = $endtime; } } $db->free_result($tournaments); if ($maxtime > $mintime + 60 * 60 * 24 * 4) { $maxtime = $mintime + 60 * 60 * 24 * 4; } $head .= "<td><b>" . t('Turnier') . "</b></td>"; for ($z = $mintime; $z <= $maxtime; $z += 60 * 60 * 2) { $head .= "<td colspan = 4>" . $func->unixstamp2date($z, "time") . "</td>"; } $smarty->assign('head', $head); // Generate Table-foot $rows = "";