".$laufnr.". Schoninger-Volkslauf


".$date.""; if (file_exists($xmlFile)) { $xml = simplexml_load_file($xmlFile); #$xml = new SimpleXMLElement($xml); #$nodes = $xml->xpath('//*[@contestName="en"]'); #echo 'Found ', count($nodes), ' node(s) with lang "en".'; #var_dump ($xml->event); #var_dump ($xml->categories); #var_dump ($xml->contests); #$result = $xml->starters->xpath('starter/contestName="600m - Kidsruns"'); #echo intval(substr($xmlFile, 0, strpos($xmlFile,'Lauf'))); #$row = simplexml_load_string($node->asXML()); if ( intval(substr($xmlFile, 0, strpos($xmlFile,'Lauf'))) > 17 ) { $contests = array ("300m - Bambinis","600m - Kidsruns", "2300m - Fit and Fun Lauf", "6km - Jedermann Lauf", "11km - Panorama Lauf", "24,3km - Halbmarathon de Luxe", "10km - Walking"); } elseif ( intval(substr($xmlFile, 0, strpos($xmlFile,'Lauf'))) == 8 ) { $contests = array ("300m - Bambinis","600m - Kidsruns", "2300m - Fit and Fun Lauf", "6km - Jedermann Lauf", "11km - Panorama Lauf", "24,3km - Halbmarathon de Luxe", "Stickwalking"); } elseif ( intval(substr($xmlFile, 0, strpos($xmlFile,'Lauf'))) > 8 AND intval(substr($xmlFile, 0, strpos($xmlFile,'Lauf'))) < 18) { $contests = array ("300m - Bambinis","600m - Kidsruns", "2300m - Fit and Fun Lauf", "6km - Jedermann Lauf", "11km - Panorama Lauf", "24,3km - Halbmarathon de Luxe"); } else { $contests = array ("300m - Bambinis","600m - Kidsruns", "2300m - Fit and Fun Lauf", "6km - Jedermann Lauf", "11km - Panorama Lauf", "Stickwalking"); } #$contests = array ("24,3km - Halbmarathon de Luxe"); foreach ($contests as $contest) { $result = $xml->xpath("//starter[contestName='".$contest."']"); #print_r ($result); #var_dump ($xml->starters); #var_dump($xml); #echo $xml->contests[0]; $filter = "//starter[sex='male']"; $filter = array("//starter[contestName='".$contest."'][sex='male']","//starter[contestName='".$contest."'][sex='female']"); #$filterm = "//starter[contest='".$contest."' ./sex/text()='weiblich']"; foreach ( $filter as $filter ) { IF (strpos($filter,"female")>0) { $sex = "weiblich"; $mwcheck = "w"; } else { $sex = "männlich"; $mwcheck = "m"; } $starter1 = $xml->xpath("".$filter.""); #$filterw = "//starter[sex='weiblich']"; $starter2[] = array (); array_shift ( $starter2 ); $pl = 1; foreach ( $starter1 as $user ) { if ($user->result->time > "00:00:00.00") { $time = $user->result->time; } else { $time = 'nn'; } #$time = strtotime ($user->result->time); $starter2[] = array ( 'raceNumber' => (string)$user->raceNumber, 'lastName' => (string)$user->lastName, 'firstName' => (string)$user->firstName, 'team' => (string)$user->team, 'yearOfBirth' => (string)$user->yearOfBirth, 'categoryName' => (string)$user->categoryName, 'contestName' => (string)$user->contestName, 'placeak' => (string)'', 'place' => (string)'', #'time' => (string)$user->result->time 'time' => (string)$time # echo '
'; ); } usort($starter2, 'compare_time'); $starter2[0]['place'] = 1; foreach ( $starter2 as $user ) { # allgemeine Platzierung if (($row[time] != "00:00:00.00")) { #$pl++; $starter2[$pl]['place'] = $pl+1; $pl = $pl+1; } if ($row["yearOfBirth"] < 10 ) { $jg = $row["yearOfBirth"]; #$starter2[$pl]['yearOfBirth'] = '0'.$jg; } } #array_sort_by_column($starter, 'time'); #echo "
";	
#print_r ($starter2);
#var_dump($starter2);
#entfernt ersten Eintrag des Arrays
#array_shift (	$starter2 );
/*
$pl = 1;

foreach($starter2 as $row) {
	$pl++;
	$starter2[$pl]['place'] = $pl+1;
	echo $row["place"];
	echo $row["lastName"].' '.$row["firstName"];

echo '
'; } unset ($pl); */ // want to sort by salary and dob - so need arrays for the 'keys' we want to sort by $sal = array(); $dob = array(); for ($b = 0; $b < count($starter2); $b++) { $sal[] = $starter2[$b]['categoryName']; $dob[] = $starter2[$b]['place']; // dont need to reverse dob coz already in YYYY/MM/DD format } // now apply sort array_multisort($sal, SORT_ASC, $dob, SORT_ASC, $starter2); // sorted results will be in $payroll now in salary+dob order!! #$plak = 1; #array_shift ( $starter2 ); #array_pop ( $starter2 ); $plak = 1; $h = 0; foreach($starter2 as $row) { if ($row[time] != "nn") { $finisher++; } unset ($ak); $ak = $row["categoryName"]; #$starter2[0]['placeak'] = if ($ak == $akbef) { #$akbef == $ak; $starter2[$h]['placeak'] = $plak; $plak++; } else { unset ($plak); $plak = 1; $akbef = $ak; $starter2[$h]['placeak'] = $plak; $plak++; #$starter2[0]['placeak'] = '1'; } $h++; } #echo "
";	
#print_r ($starter2);
$finisher = $finisher+1;
#print_r ($starter2);

if ($contest == $contest1)  {}
else {	echo '
';} $finisher = $finisher-2; echo '

'.$contest.' - '.$sex.'

'; if ( $mwcheck =='w') { $teilnehmer = count($xml->xpath("//starter[contestName='".$contest."'][sex='female']")); } else { $teilnehmer = count($xml->xpath("//starter[contestName='".$contest."'][sex='male']")); } $check++; echo " ( ".$finisher." Finisher / ".$teilnehmer." Anmeldungen )"; echo '
'; unset ($finisher); $contest1 = $contest; usort($starter2, 'compare_time'); echo " "; #Tableheader beenden if (ISSET($_GET["starter"])) { echo ' '; echo ' '; } else { echo ' '; } foreach($starter2 as $row) { $i++; #$starter2[$i]['placeak'] = $plak; if (($row[time] != "00:00:00.00")) { if (strlen($row["lastName"]) > 1) { echo ""; if (isset ($_GET['admin'])) { echo ""; } else { echo ""; } echo ""; #echo ""; echo ""; if (isset($_GET['urkunde'])) { $urkunde = "Urkunde"; } else { echo ""; } if (($row[time] != "nn")) { echo ""; } else { echo ""; } echo ""; } } if (($row[time] != "00:00:00.00")) { if (strlen($row["lastName"]) > 1) { } } # print_r ($entry); } echo "
PlatzNameJg.VereinAK Startnr.
Startnr. Platz
in AK
Zeit
".$platz."".$row["lastName"].", ".$row["firstName"]."".$row["lastName"].", ".$row["firstName"]."".$row["yearOfBirth"]."".$row["team"]."".$row["categoryName"]."".$row[time]."".$row['raceNumber']."".$row['placeak']."".$row[time]." - ".$urkunde."
"; if ($check % 2 != 0) { } else { # echo "Die Zahl $zahl ist gerade"; echo '
'.$print."
Fragen oder Korrekturen? Sprich uns an oder schick eine Mail an Timo@Schoninger-Volkslauf.de
"; } // sort alphabetically by name unset ($starter2); unset ($i); } } echo '
'; } else { exit("Datei $xmlFile kann nicht geöffnet werden."); } ?>