session_start(); include_once("../../../../mysql_connect.php"); include_once('stoly_config.php'); $ile_s = $parametry['ile_s'][$id_t1]; $player = ''; $country = ''; $dzien=''; $player = intval($_GET['player']); $country = $_GET['country']; $dzien = $_GET['day']; $sc="style=\"vertical-align: middle; text-align: center;\""; $sr="style=\"vertical-align: middle; text-align: right;\""; $sl="style=\"vertical-align: middle; text-align: left;\""; //================================================================================================================================== //Lista dni $listad = ""; $listad .= ""; $table_name = "dg_config_sedziowie"; $sql = "SELECT * FROM $table_name WHERE `id_t` = \"$id_t1\""; $result = @mysql_query($sql,$dbc)or die("Wykonanie zapytania nie powiodło się."); while ($wiersz = mysql_fetch_array($result)) { for ($d = 1; $d <= 11; $d++) { $a = 'o_d'.$d; ${$a} = date('d.m.Y', strtotime($wiersz["$a"])); $listad .= ""; for ($s = 1; $s <=8; $s++) { //sesje $a = 'g_d'.$d.'s'.$s; ${$a} = date('H:i', strtotime($wiersz["$a"])); } } } //================================================================================================================================== //================================================================================================================================== // lista zawodników $table_name = "dg_zawodnicy"; $sql = "SELECT * FROM $table_name WHERE `id_t` = \"$id_t1\" OR `id_t` = \"$id_t2\" OR `id_t` = \"$id_t3\" ORDER by `zawodnik`"; $result = @mysql_query($sql,$dbc)or die("Wykonanie zapytania nie powiodĹ‚o siÄ™."); $ilu_z = mysql_numrows($result); $zawodnicy=array(); $x=1; $id_list = ''; $lista = ""; while ($wiersz = mysql_fetch_array($result)) { $nr_g = $wiersz['nr_g']; $g = $wiersz['grupa']; $c=64; if ($parametry['io'][$id_t]=='1') { //mam pokazywać grupy I oraz O $c += + $g; } else { switch($g) { case ($g >= 9 and $g < 14):$c += + $g +1; break; //omijamy nazwe grupy I case ($g >= 14):$c = $c += + $g + 2; break; //omijamy nazwe grupy O default:$c += + $g; break; } } switch($c) { case ($c>90):$c2 = $c-26; $grupa = "A".chr($c2);break; //Po Z wracamy do AA // case ($c>90):$c2 = $c+6; $grupa = chr($c2);break; //Po Z mamy a default:$grupa = chr($c); break; } //$lista .= ""; $lista .= ""; if ($wiersz['id_z']>0) {$id_list .= " `id` LIKE '".$wiersz['id_z']."' OR";} $x++; } $res1=@mysql_query("SELECT `zawodnicy`.* FROM `zawodnicy` WHERE ".substr($id_list,0,strlen($id_list)-2)); $players = array(); while($row=@mysql_fetch_array($res1)) { $kraj = $row['kraj']; $players[$row['id']]['kraj'] = $row['kraj']; $players[$row['id']]['player'] = $row['imie'].' '.$row['nazwisko']; } $ile_zaw = count($players); //================================================================================================================================== //================================================================================================================================== //Lista krajów //sortuje utworzona tablice po krajach uasort($players, 'porownajkraje'); function porownajkraje($a, $b) { if ($a[kraj]==$b[kraj]) return 0; else return $a<$b?-1:1;} $listak = ""; $kraj_chwila=''; $x=1; foreach ($players as $klucz => $wiersz) { if ($players[$klucz]['kraj']!=$kraj_chwila) { $listak .= ""; $x++; } $kraj_chwila=$players[$klucz]['kraj']; } //================================================================================================================================== $table_name = "dg_wyniki"; $where = "`id_t` = ".$id_t1; if ($id_t2>0) {$where .= " OR `id_t` = ".$id_t2;} if ($id_t3>0) {$where .= " OR `id_t` = ".$id_t3;} $sql = "SELECT * FROM $table_name WHERE ".$where." ORDER by `dzien`, `sesja`, `stol`"; $result = @mysql_query($sql,$dbc)or die("Wykonanie zapytania nie powiodło się."); $jest = mysql_numrows($result); if ($jest>0) { $display_block="