"; $myURL = isset($_GET["myURL"])?$_GET["myURL"]:""; if (strlen($myURL)>0) $myURL = "www.datasport.it" . $_GET["myURL"]; else $myURL = urldecode($_SERVER["REQUEST_URI"]); $urlArray = explode("/",$myURL); if (strlen($myURL)>0) { $idMatch = explode("idmatch=",$myURL); $idMatch = $idMatch[1]; } else $idMatch = $_GET["idmatch"]; $competition = strtolower(trim($urlArray[2])); $season = strtolower(trim($urlArray[3])); $level = strtolower(trim($urlArray[4])); // echo($myURL); // die; /* //webservice matchdetails $urlWebServicesmatchDetails = "http://feeds.datasport.it/datasport/temporeale/calcio/ws.asp?action=getmatch&idmatch=".$idMatch ."&competition=".$competition."&season=".$season."&level=".$level."&type=matchdetails"; //webservice matchstory $urlWebServicesmatchCommentary = "http://feeds.datasport.it/datasport/temporeale/calcio/ws.asp?action=getmatch&idmatch=".$idMatch ."&competition=".$competition."&season=".$season."&level=".$level."&type=commentary"; //webservice matchmedia $urlWebServicesmatchMedia = "http://feeds.datasport.it/datasport/temporeale/calcio/ws.asp?action=getmatch&idmatch=".$idMatch ."&competition=".$competition."&season=".$season."&level=".$level."&type=media"; //webservice matchvideo3D $urlWebServicesmatchVideo = "http://feeds.datasport.it/datasport/temporeale/calcio/ws.asp?action=getmatch&idmatch=".$idMatch ."&competition=".$competition."&season=".$season."&level=".$level."&type=video"; //echo("
" . $urlWebServicesmatchDetails . "
"); //die; */ //$urlFoto = "http://feeds.datasport.it/datasport/temporeale/calcio/"; $urlFoto = "http://risultati.quotidiano.net/temporeale/"; #$myWsUrl = "http://www.datasport.it/ws.php"; $myWsUrl = "http://risultati.quotidiano.net/ws.php"; //$myWsUrl = "ws.php"; //print "."; //webservice matchdetails $urlWebServicesmatchDetails = $myWsUrl . "?action=getmatch&idmatch=".$idMatch ."&competition=".$competition."&season=".$season."&level=".$level."&type=matchdetails"; //webservice matchstory $urlWebServicesmatchCommentary = $myWsUrl . "?action=getmatch&idmatch=".$idMatch ."&competition=".$competition."&season=".$season."&level=".$level."&type=commentary"; //webservice matchmedia $urlWebServicesmatchMedia = $myWsUrl . "?action=getmatch&idmatch=".$idMatch ."&competition=".$competition."&season=".$season."&level=".$level."&type=media"; //webservice matchvideo3D $urlWebServicesmatchVideo = $myWsUrl . "?action=getmatch&idmatch=".$idMatch ."&competition=".$competition."&season=".$season."&level=".$level."&type=video"; /* $urlWebServicesmatchDetails = file_get_contents($urlWebServicesmatchDetails, false, $context); $urlWebServicesmatchCommentary = file_get_contents($urlWebServicesmatchCommentary, false, $context); $urlWebServicesmatchMedia = file_get_contents($urlWebServicesmatchMedia, false, $context); $urlWebServicesmatchVideo = file_get_contents($urlWebServicesmatchVideo, false, $context); */ //echo($urlWebServicesmatchDetails); //die; /* // --------- IF GETSEO -------------- if($_GET['action'] == "getSeo") { $xmlDoc = new DomDocument; $xmlDoc->preserveWhiteSpace = FALSE; $xmlDoc->recover = true; $xmlDoc->strictErrorChecking = false; $xmlDoc->formatOutput = true; $xmlDoc->load($urlWebServicesmatchDetails); if (!$xmlDoc) { echo 'Error while parsing the document'; exit; } $match = $xmlDoc->getElementsByTagName("match"); $teamHome = $match->item(0)->getElementsByTagName("teamhome"); $teamAway = $match->item(0)->getElementsByTagName("teamaway"); $teamHomeName = $teamHome->item(0)->getAttribute("team"); $teamAwayName = $teamAway->item(0)->getAttribute("team"); $description = $teamHomeName ." - ". $teamAwayName; ?> Diretta Europei 2012, Calcio, <?php echo $teamHomeName ?> - <?php echo $teamAwayName ?> Datasport.it preserveWhiteSpace = FALSE; $xmlDoc->recover = true; $xmlDoc->strictErrorChecking = false; $xmlDoc->formatOutput = true; $xmlDoc->load($urlWebServicesmatchDetails); if (!$xmlDoc) { echo 'Error while parsing the document'; exit; } $match = $xmlDoc->getElementsByTagName("match"); $teamHome = $match->item(0)->getElementsByTagName("teamhome"); $teamAway = $match->item(0)->getElementsByTagName("teamaway"); $htmlOutputheader = ""; $htmlOutput = ""; //** START HEADER **// $statusMatch = strtolower($match->item(0)->getAttribute("status")); $statusMatchImage = ""; $descriptionMinute = ""; $extratimematchminute = $match->item(0)->getAttribute("extratimematchminute"); $descriptionTime = $match->item(0)->getAttribute("descriptionTime"); $pagelleStyle = " display:none;"; if (trim($statusMatch) == "formazioni") { $statusMatchImage = ""; $descriptionMinute = "IN ATTESA"; $statusTab = "diretta"; $formazioniStyle = " display:block;"; } elseif ($statusMatch != "-" and $statusMatch != "terminata") { if ($extratimematchminute > 0 and $extratimematchminute != "") $descriptionMinute = "" . $match->item(0)->getAttribute("timematchminute") . "' + ".$extratimematchminute.""; else $descriptionMinute = "" . $match->item(0)->getAttribute("timematchminute") . "'"; if ($statusMatch == "intervallo 1°-2° tempo") $descriptionMinute = $statusMatch; $statusMatchImage = ""; if ($statusMatch == "sospesa") { $descriptionMinute = $statusMatch; $statusMatchImage = ""; } $formazioniStyle = " display:block;"; $statusTab = "diretta"; } else if (trim($statusMatch) == "terminata") { $statusMatchImage = ""; $descriptionMinute = strtoupper($statusMatch); $statusTab = "diretta"; $formazioniStyle = " display:block;"; $pagelleStyle = " display:block;"; } else if (trim($statusMatch) == "-") { $statusMatchImage = ""; $descriptionMinute = strtoupper($statusMatch); $statusTab = "diretta"; $formazioniStyle = " display:none;"; } else { $statusMatchImage = ""; $descriptionMinute = strtoupper($statusMatch); $statusTab = "diretta"; $formazioniStyle = " display:block;"; } $referee = "Arbitro: " . $match->item(0)->getAttribute("referee"); $stadium = "Stadio: " . str_replace("(FIORENTINA)","",$match->item(0)->getAttribute("stadium")); //date match header $mesi = array(0=>'', 1=>'Gennaio', 2=>'Febbraio', 3=>'Marzo', 4=>'Aprile',5=>'Maggio', 6=>'Giugno', 7=>'Luglio',8=>'Agosto', 9=>'Settembre', 10=>'Ottobre', 11=>'Novembre', 12=>'Dicembre'); $dateMatch = $match->item(0)->getAttribute("day"); $dateMatchTemp = explode("/", $dateMatch); if ($dateMatchTemp[1] < 10) $dateMatchTemp[1] = str_replace("0","",$dateMatchTemp[1]); if ($dateMatchTemp[0] < 10) $dateMatchTemp[0] = str_replace("0","",$dateMatchTemp[0]); $dateMatch = $dateMatchTemp[0] . " " . $mesi[$dateMatchTemp[1]]; $timeMatch = $match->item(0)->getAttribute("time"); $teamHomeName = $teamHome->item(0)->getAttribute("team"); $teamHomeName = str_replace("Hotspur","", $teamHomeName); $teamHomeName = str_replace("San Pietroburgo","", $teamHomeName); $teamHomeName = str_replace("Donetsk","", $teamHomeName); $teamAwayName = $teamAway->item(0)->getAttribute("team"); $teamAwayName = str_replace("Hotspur","", $teamAwayName); $teamAwayName = str_replace("San Pietroburgo","", $teamAwayName); $teamAwayName = str_replace("Donetsk","", $teamAwayName); $classificaVisible=true; $videoVisible=false; $teamHomeTrainer = checkTrainer($teamHome->item(0)->getElementsByTagName("players")); $teamAwayTrainer = checkTrainer($teamAway->item(0)->getElementsByTagName("players")); $teamHomeModule = $teamHome->item(0)->getAttribute("module"); $teamAwayModule = $teamAway->item(0)->getAttribute("module"); $logoHome = $teamHome->item(0)->getAttribute("logo"); $logoAway = $teamAway->item(0)->getAttribute("logo"); $logoHomeBg = "background: url(/temporeale".$logoHome.") no-repeat 8px 10px"; $logoAwayBg = "background: url(/temporeale".$logoAway.") no-repeat 200px 10px"; $teamHomeGeneralNode = $teamHome->item(0)->getElementsByTagName("general"); $teamHomeGoalNode = $teamHomeGeneralNode->item(0)->getElementsByTagName("goals"); $teamHomeGoal = $teamHomeGoalNode->item(0)->getAttribute("for"); if ($teamHomeGoal > 0) { $typeGoals = $teamHomeGoalNode->item(0)->getElementsByTagName("goal"); $resumeGoalHome = ""; foreach ($typeGoals as $typeGoal) { $resumeGoalHome .= $typeGoal->getAttribute("minute") . "' " . substr($typeGoal->getAttribute("name"),0, 1) . ". " . $typeGoal->getAttribute("surname"); if ($typeGoal->getAttribute("type") == "autogol") $resumeGoalHome .= " (autogol)"; if ($typeGoal->getAttribute("type") == "rigore") $resumeGoalHome .= " (rig.)"; $resumeGoalHome .= "
"; //. // " (".$typeGoal->getAttribute("type").")
"; } } $teamAwayGeneralNode = $teamAway->item(0)->getElementsByTagName("general"); $teamAwayGoalNode = $teamAwayGeneralNode->item(0)->getElementsByTagName("goals"); $teamAwayGoal = $teamAwayGoalNode->item(0)->getAttribute("for"); if ($teamAwayGoal > 0) { $typeGoals = $teamAwayGoalNode->item(0)->getElementsByTagName("goal"); $resumeGoalAway = ""; foreach ($typeGoals as $typeGoal) { $resumeGoalAway .= $typeGoal->getAttribute("minute") . "' " . substr($typeGoal->getAttribute("name"),0, 1) . ". " . $typeGoal->getAttribute("surname"); if ($typeGoal->getAttribute("type") == "autogol") $resumeGoalAway .= " (autogol)"; if ($typeGoal->getAttribute("type") == "rigore") $resumeGoalAway .= " (rig.)"; $resumeGoalAway .= "
"; } } if (trim($statusMatch) == "-" OR trim($statusMatch) == "formazioni") { $teamHomeGoal =""; $teamAwayGoal =""; } //** END HEADER **// /** TIMELINE */ $timelineStats =""; $timelineStats .= "
"; $timelineStats .= "
"; $timelineStats .= writeIconTimeline($teamHomeGeneralNode, "3px"); $timelineStats .= writeIconTimeline($teamAwayGeneralNode, "28px"); $timeMinute = $match->item(0)->getAttribute("timematchminute"); $timelineMinute = $timeMinute . "'"; if ((int)$timeMinute > 45 AND (int)$timeMinute <= 90) $widthBarTneline = (($timeMinute) * 6.6) + 40; else $widthBarTneline = ($timeMinute * 6.6); if (trim($statusMatch) == "terminata" OR $widthBarTneline > 650) { $widthBarTneline = 650; $timelineMinute = $timelineMinute . " +" . $extratimematchminute; } function writeIconTimeline($nodeXml,$top) { $minuteDiff = 6.6; $teamGoalNode = $nodeXml->item(0)->getElementsByTagName("goals"); $teamGoal = $teamGoalNode->item(0)->getAttribute("for"); if($teamGoal > 0) { $goals = $teamGoalNode->item(0)->getElementsByTagName("goal"); $countGoal = 0; foreach ($goals as $goal) { $goalMinute = $goal->getAttribute("minute"); $goalSurname = $goal->getAttribute("surname"); $goalType = $goal->getAttribute("type"); $countGoal++; $plusLeft = 0; if ((int)$goalMinute > 45 AND (int)$goalMinute <= 90) $plusLeft = 40; $position = " left: " . (($minuteDiff * $goalMinute) + $plusLeft -2) . "px"; $goalTitle = $goalMinute."' " .$goalSurname; if (!isset($return) or $return == NULL) $return = ""; if ($goalType == "autogol") $return .= "
"; elseif ($goalType == "rigore") $return .= "
"; else $return .= "
"; $return .= "
"; } } $teamCardNode = $nodeXml->item(0)->getElementsByTagName("cards"); $teamCard = $teamCardNode->item(0)->getAttribute("for"); if($teamCard > 0) { $cards = $teamCardNode->item(0)->getElementsByTagName("card"); $countCard = 0; foreach ($cards as $card) { $cardMinute = $card->getAttribute("minute"); $cardSurname = $card->getAttribute("surname"); $cardType = $card->getAttribute("type"); $countCard++; $plusLeft = 0; if ((int)$cardMinute > 45 AND (int)$cardMinute <= 90) $plusLeft = 40; $position = " left: " . (($minuteDiff * $cardMinute) + $plusLeft -2) . "px"; $cardTitle = $cardMinute."' " .$cardSurname; if (!isset($return) or $return == NULL) $return = ""; if ($cardType == "2AM") { $return .= "
"; }else if ($cardType == "ESP") { $return .= "
"; }else if ($cardType == "1AM"){ $return .= "
"; } $return .= "
"; } } $teamsubsitutionNode = $nodeXml->item(0)->getElementsByTagName("substitutions"); $teamsubsitution = $teamsubsitutionNode->item(0)->getAttribute("for"); if($teamsubsitution > 0) { $subsitutions = $teamsubsitutionNode->item(0)->getElementsByTagName("substitution"); $countsubsitution = 0; foreach ($subsitutions as $subsitution) { $subsitutionMinute = $subsitution->getAttribute("minute"); $subsitutionSurname = $subsitution->getAttribute("surname"); $subsitutionType = $subsitution->getAttribute("type"); $countsubsitution++; $plusLeft = 0; if ((int)$subsitutionMinute > 45 AND (int)$subsitutionMinute <= 90) $plusLeft = 40; $position = " left: " . (($minuteDiff * $subsitutionMinute) + $plusLeft -2) . "px"; $playerSubs =""; if ($countsubsitution == 2) { $subsitutionTitle .= "
". $subsitutionMinute."' " . str_replace("'"," ",$subsitutionSurname) . " - " . $subsitutionType ; $countsubsitution=0; $playerSubs = $subsitutionSurname; $return .= "
"; } else $subsitutionTitle = $subsitutionMinute."' " . str_replace("'"," ",$subsitutionSurname) . " - " . $subsitutionType ; } } if (isset($return)) return $return; return NULL; } function checkTrainer($nodeXml) { $nodeXml = $nodeXml->item(0)->getElementsByTagName("player"); foreach ($nodeXml as $nodePlayer) { if ("ALL" == $nodePlayer->getAttribute("role")) { $return = $nodePlayer->getAttribute("name"). " " . $nodePlayer->getAttribute("surname"); break; } } return $return; } function checkPlayerSubs($nodePlayers,$idPlayer) { foreach ($nodePlayers as $nodePlayer) { if ($idPlayer == $nodePlayer->getAttribute("id")) { $return = $nodePlayer->getAttribute("surname"); break; } } return $return; } function checkStatsPlayer($nodePlayer,$nodePlayers) { if (!isset($goalType)) $goalType=""; if (!isset($return)) $return = ""; /* //penaltysaved $penaltiessaved = $nodePlayer->getElementsByTagName("penaltysaved"); $countPenaltiesSaved = 0; foreach ($penaltiessaved as $penaltysaved) { $penaltysavedMinute = $penaltysaved->getAttribute("minute"); if ($penaltysavedMinute > 0 AND $penaltysavedMinute != null AND $penaltysavedMinute != "") { $countPenaltiesSaved++; if ($countPenaltiesSaved>1) $penaltysavedType .="
"; $penaltysavedType .= "RIGORE PARATO ".$penaltysavedMinute."' "; } } if ($countPenaltiesSaved > 0) { $return .= "
"; if ($countPenaltiesSaved > 1) $return .= "
".$countPenaltiesSaved."
"; $return .= "
"; } //penaltymissed $penaltiesmissed = $nodePlayer->getElementsByTagName("penaltymissed"); $countPenaltiesMissed = 0; foreach ($penaltiesmissed as $penaltysmissed) { $penaltysmissedMinute = $penaltysmissed->getAttribute("minute"); if ($penaltysmissedMinute > 0 AND $penaltysmissedMinute != null AND $penaltysmissedMinute != "") { $countPenaltiesMissed++; if ($countPenaltiesMissed>1) $penaltyType .="
"; $penaltyType .= $penaltysmissedMinute."' "; } } if ($countPenaltiesMissed > 0) { $return .= "
"; if ($countPenaltiesMissed > 1) $return .= "
".$countPenaltiesMissed."
"; $return .= "
"; } */ //GOAL $goals = $nodePlayer->getElementsByTagName("goals"); $goal = $goals->item(0)->getAttribute("for"); if($goal > 0) { $goals = $goals->item(0)->getElementsByTagName("goal"); $countGoal = 0; foreach ($goals as $goal) { $goalMinute = $goal->getAttribute("minute"); if ($goalMinute > 0 AND $goalMinute != null AND $goalMinute != "" and $goal->getAttribute("type") != "autogol" ) { $countGoal++; if ($countGoal>1) $goalType .="
"; $goalType .= $goalMinute."' "; if ($goal->getAttribute("type") == "rigore") $goalType .= "(rig.)"; } } if ($countGoal > 0) { $return .= "
"; if ($countGoal > 1) $return .= "
".$countGoal."
"; $return .= "
"; } } //AUTOGOAL $goals = $nodePlayer->getElementsByTagName("goals"); $goal = $goals->item(0)->getAttribute("for"); if($goal > 0) { $goals = $goals->item(0)->getElementsByTagName("goal"); $countGoal = 0; foreach ($goals as $goal) { $goalMinute = $goal->getAttribute("minute"); if ($goal->getAttribute("type") == "autogol" ) { $countGoal++; if ($countGoal>1) $goalType .="
"; $goalType .= $goalMinute."' "; $goalType .= "(" . $goal->getAttribute("type") . ")"; } } if ($countGoal > 0) { $return .= "
"; if ($countGoal > 1) $return .= "
".$countGoal."
"; $return .= "
"; } } //SUBSTITUTION $substitutions = $nodePlayer->getElementsByTagName("substitutions"); $substitution = $substitutions->item(0)->getAttribute("for"); if($substitution > 0) { $substitutions = $substitutions->item(0)->getElementsByTagName("substitution"); foreach ($substitutions as $substitution) { $type = $substitution->getAttribute("type"); $typeDesc = "esce"; if ($type == "OUT") $typeDesc = "entra"; $substitutionMinute = $substitution->getAttribute("minute"); if ($substitutionMinute > 0 AND $substitutionMinute != null AND $substitutionMinute != "") { $substitutionMinute = $substitutionMinute . "' ".$typeDesc.": " . checkPlayerSubs($nodePlayers,$substitution->getAttribute("idpalyersubs")); if ($type == "OUT") $return .= "
".$substitution->getAttribute("minute")."'
"; else $return .= "
".$substitution->getAttribute("minute")."'
"; } } } //CARD $cards = $nodePlayer->getElementsByTagName("cards"); $card = $cards->item(0)->getAttribute("for"); if($card > 0) { $cards = $cards->item(0)->getElementsByTagName("card"); $countCardYellow = 0; foreach ($cards as $card) { //$type = $card->getAttribute("type"); $cardMinute = $card->getAttribute("minute"); $cardColor = $card->getAttribute("type"); $cardMinute = $cardMinute . "'"; if ($cardColor == "2AM") { $return .= "
 
"; break; }else if ($cardColor == "ESP") { $return .= "
 
"; break; }else if ($cardColor == "1AM"){ $return .= "
 
"; } } } return $return; } function writePlayer($nodeXml,$teamTrainer,$module) { $return = null; $count=0; $bSubs = true; foreach ($nodeXml as $nodeXmlitem) { if ($count == 0) $return .= "
IN CAMPO (" . $module . ")
"; if ($nodeXmlitem->getAttribute("headline") == "N" AND $bSubs) { $bSubs = false; $return .= "
IN PANCHINA
"; } if( $nodeXmlitem->getAttribute("role")!="ALL") { $styleRow = "mod1"; if ($count % 2 == 0) $styleRow = "mod2"; $return .= "
".$nodeXmlitem->getAttribute("number")."
" . utf8_encode(substr($nodeXmlitem->getAttribute("name"),0, 1)) . ". " . $nodeXmlitem->getAttribute("surname") . "
"; $return .= checkStatsPlayer($nodeXmlitem,$nodeXml); $return .= "
"; $count++; } } $return .= "
All. " . $teamTrainer . "
"; return $return; } /* LIST PLAYER HOME*/ $teamHomePlayers = $teamHome->item(0)->getElementsByTagName("player"); $teamHomePlayerList = writePlayer($teamHomePlayers,$teamHomeTrainer,$teamHomeModule); /* LIST PLAYER AWAY*/ $teamAwayPlayers = $teamAway->item(0)->getElementsByTagName("player"); $teamAwayPlayerList = writePlayer($teamAwayPlayers,$teamAwayTrainer,$teamAwayModule); //************ GET THE COMMENTARY AND OTHER TABS *********************// /** write commentary icon**/ function CheckEventIcon($nodePlayer) { if (!isset($return)) $return = ""; //card $cards = $nodePlayer->getElementsByTagName("card"); $cardColor = $cards->item(0)->getAttribute("type"); if ($cardColor != null AND $cardColor != "") { if ($cardColor == "giallo") $return .= "
 
"; elseif ($cardColor == "rosso") $return .= "
 
"; } //goal $goal = $nodePlayer->getElementsByTagName("goal"); $goalMode = $goal->item(0)->getAttribute("type"); if ($goalMode != null AND $goalMode != "") { if ($goalMode == "autogol") $return .= "
 
"; elseif ($goalMode == "rigore") $return .= "
 
"; else $return .= "
 
"; } //substitution $substitution = $nodePlayer->getElementsByTagName("substitution"); $substitutionType = $substitution->item(0)->getAttribute("type"); if ($substitutionType != null AND $substitutionType != "") { $return .= "
 
"; } if (isset($return)) return $return; return NULL; } /*** LOAD COMMENTARY **/ $xmlDocCommentary = new DomDocument; $xmlDocCommentary->preserveWhiteSpace = FALSE; $xmlDocCommentary->recover = true; $xmlDocCommentary->strictErrorChecking = false; $xmlDocCommentary->formatOutput = true; $xmlDocCommentary->load($urlWebServicesmatchCommentary); if (!$xmlDocCommentary) { echo 'Error while parsing the document'; exit; } $matchCommentary = $xmlDocCommentary->getElementsByTagName("match"); //$statusMatch = ""; $direttaTxt = ""; $matchStories = $matchCommentary->item(0)->getElementsByTagName("eventmatch"); $countStories = 0; if (isset($_GET["statusTab"])) $statusTab = $_GET["statusTab"]; //***DIRETTA TAB***// $direttaTxt = ""; //***DICHIARAZIONI TAB***// /* $matchDeclaration = $matchCommentary->item(0)->getElementsByTagName("declaration"); $matchDeclarations = $matchDeclaration->item(0)->getElementsByTagName("description"); $countItems = 0; $dichiarazioniTxt = ""; */ //***PAGELLE TAB***// function checkVotePlayer($nodeXml) { $return = null; $role = $nodeXml->getAttribute("role"); $voteNode = $nodeXml->getElementsByTagName("vote"); $voteValue = $voteNode->item(0)->getAttribute("value"); $voteDesc = $voteNode->item(0)->nodeValue; $substitution = ""; //$subsNode = $nodeXml->getElementsByTagName("substitution"); //var_dump($subsNode->item(0)->getAttribute("minute")); //$subsMin = $subsNode->item(0)->getAttribute("minute"); if($voteValue != null and $voteValue != "0") { if (!isset($subsMin)) $subsMin = ""; if($subsMin != null and $subsMin != "") $substitution = "background: url(/graphic/img/tempreal/sostituzione.png) no-repeat 95px 2px;"; $styleAll = ""; if ($role == "ALL") $styleAll = " allenatore"; $return .= "
" . $nodeXml->getAttribute("surname") . "
".$voteValue."

"; $return .= "
"; } return $return; } function writePlayerPag($nodeXml) { $return = null; //$nodeXmlTrainer = $nodeXml->item(0)->getElementsByTagName("trainer"); //$return .= checkVotePlayer($nodeXmlTrainer->item(0)); //$return .= "
"; $count=0; $nodeXmlPlayer = $nodeXml->item(0)->getElementsByTagName("player"); foreach ($nodeXmlPlayer as $nodeXmlitem) { $return .= checkVotePlayer($nodeXmlitem); $count++; } return $return; } if (!isset($pagelleTxt)) $pagelleTxt=""; $pagelleTxt .= ""; //*** PRECEDENTI BOX***// /* $matchPrecedent = $matchCommentary->item(0)->getElementsByTagName("precedent"); $matchPrecedents = $matchPrecedent->item(0)->getElementsByTagName("description"); $countItems = 0; $precedentTxt = "
"; foreach ($matchPrecedents as $precedent) { $txtTemp = $precedent->nodeValue; $styleRow = "mod1"; if ($countItems % 2 == 0) $styleRow = "mod2"; $precedentTxt .= "
"; $precedentTxt .= "
" . $txtTemp . "
"; $precedentTxt .= "
"; $precedentTxt .= "
"; $countItems++; } $precedentTxt .= "
"; */ /* LOAD FOTO GALLERY */ $xmlDocMedia = new DomDocument; $xmlDocMedia->preserveWhiteSpace = FALSE; $xmlDocMedia->recover = true; $xmlDocMedia->strictErrorChecking = false; $xmlDocMedia->formatOutput = true; $xmlDocMedia->load($urlWebServicesmatchMedia); $fotogallery = ""; $fotoNode = $xmlDocMedia->getElementsByTagName("match"); $fotoNodes = $fotoNode->item(0)->getElementsByTagName("media"); $countNodeFoto = 1; $fotogallery .="
"; foreach ($fotoNodes as $foto) { $imgTemp = $foto->getElementsByTagName("path"); $img = $imgTemp->item(0)->nodeValue; $img = $urlFoto . $img; $imgTempTh = $foto->getElementsByTagName("path_th"); $imgth = $imgTempTh->item(0)->nodeValue; $imgth = $urlFoto . $imgth; $txtTemp = $foto->getElementsByTagName("description"); $txtDesc = $txtTemp->item(0)->nodeValue; $txtDesc = str_replace("'","’",$txtDesc); $txtDesctemp = explode(" ", $txtDesc); $totElem = count($txtDesctemp); $countWord = 1; $txtDesc1 = ""; for ($i = 0; $i <= $totElem; $i++) { if (isset($txtDesctemp[$i])) $txtDesc1 .= $txtDesctemp[$i] . " "; $countWord++; if ($countWord == 10) { $txtDesc1 .= "
"; $countWord = 1; } } $fotogallery .= "".$txtDesc.""; $countNodeFoto++; } $fotogallery .="
"; $videogallery = ""; $countVideoFoto = 0; /* VIDEO GALLERY 3D $xmlDocVideo = new DomDocument; $xmlDocVideo->preserveWhiteSpace = FALSE; $xmlDocVideo->recover = true; $xmlDocVideo->strictErrorChecking = false; $xmlDocVideo->formatOutput = true; $xmlDocVideo->load($urlWebServicesmatchVideo); $videogallery = ""; $videoNode = $xmlDocVideo->getElementsByTagName("videos"); $videoNodes = $videoNode->item(0)->getElementsByTagName("video"); $countVideoFoto = 0; $videogallery .="
"; foreach ($videoNodes as $video) { $imgTemp = $video->getElementsByTagName("link_thumbnail"); $img = $imgTemp->item(0)->nodeValue; $video_embed = $video->getElementsByTagName("video_embed"); $video_embed = $video_embed->item(0)->nodeValue; $titleTemp = $video->getElementsByTagName("title"); $titleDesc = $titleTemp->item(0)->nodeValue; $txtTemp = $video->getElementsByTagName("abstract"); $txtDesc = $txtTemp->item(0)->nodeValue; $videogallery .= "

".$titleDesc."

".$txtDesc."


"; $countVideoFoto++; } $videogallery .="
"; */ if ($countVideoFoto <= 0) { $classificaVisible=true; $videoVisible=false; } else { $classificaVisible=false; $videoVisible=true; } /**GENERAL STATS**/ function generalStats($teamNode,$teamNode2,$statusMatch) { $output =""; $output .= "
"; $output .= $teamNode->item(0)->getAttribute("team"); $output .= "
"; $output .= "
"; $output .= $teamNode2->item(0)->getAttribute("team"); $output .= "

"; /*$output .= "
"; $output .= $teamNode->item(0)->getAttribute("possessionperc"); $output .= "
"; $output .= "
"; $output .= "% Possesso palla"; $output .= "
"; $output .= "
"; $output .= $teamNode2->item(0)->getAttribute("possessionperc"); $output .= "

"; */ $output .= "
"; if (trim($statusMatch) == "-" or trim($statusMatch) == "formazioni") $output .= "-"; else $output .= $teamNode->item(0)->getAttribute("corner"); $output .= "
"; $output .= "
"; $output .= "Calci d'angolo"; $output .= "
"; $output .= "
"; if (trim($statusMatch) == "-" or trim($statusMatch) == "formazioni") $output .= "-"; else $output .= $teamNode2->item(0)->getAttribute("corner"); $output .= "

"; $output .= "
"; if (trim($statusMatch) == "-" or trim($statusMatch) == "formazioni") $output .= "-"; else $output .= $teamNode->item(0)->getAttribute("fouls"); $output .= "
"; $output .= "
"; $output .= "Falli commessi"; $output .= "
"; $output .= "
"; if (trim($statusMatch) == "-" or trim($statusMatch) == "formazioni") $output .= "-"; else $output .= $teamNode2->item(0)->getAttribute("fouls"); $output .= "

"; $output .= "
"; if (trim($statusMatch) == "-" or trim($statusMatch) == "formazioni") $output .= "-"; else $output .= $teamNode->item(0)->getAttribute("totalthrow"); $output .= "
"; $output .= "
"; $output .= "Tiri totali"; $output .= "
"; $output .= "
"; if (trim($statusMatch) == "-" or trim($statusMatch) == "formazioni") $output .= "-"; else $output .= $teamNode2->item(0)->getAttribute("totalthrow"); $output .= "

"; $output .= "
"; if (trim($statusMatch) == "-" or trim($statusMatch) == "formazioni") $output .= "-"; else $output .= $teamNode->item(0)->getAttribute("totalthrowmirror"); $output .= "
"; $output .= "
"; $output .= "Tiri nello specchio"; $output .= "
"; $output .= "
"; if (trim($statusMatch) == "-" or trim($statusMatch) == "formazioni") $output .= "-"; else $output .= $teamNode2->item(0)->getAttribute("totalthrowmirror"); $output .= "

"; $output .= "
"; if (trim($statusMatch) == "-" or trim($statusMatch) == "formazioni") $output .= "-"; else $output .= $teamNode->item(0)->getAttribute("offside"); $output .= "
"; $output .= "
"; $output .= "Fuorigioco"; $output .= "
"; $output .= "
"; if (trim($statusMatch) == "-" or trim($statusMatch) == "formazioni") $output .= "-"; else $output .= $teamNode2->item(0)->getAttribute("offside"); $output .= "

"; $output .= "
"; if (trim($statusMatch) == "-" or trim($statusMatch) == "formazioni") $output .= "-"; else $output .= $teamNode->item(0)->getAttribute("yellowcard"); $output .= "
"; $output .= "
"; $output .= "Ammonizioni"; $output .= "
"; $output .= "
"; if (trim($statusMatch) == "-" or trim($statusMatch) == "formazioni") $output .= "-"; else $output .= $teamNode2->item(0)->getAttribute("yellowcard"); $output .= "

"; $output .= "
"; if (trim($statusMatch) == "-" or trim($statusMatch) == "formazioni") $output .= "-"; else $output .= $teamNode->item(0)->getAttribute("redcard"); $output .= "
"; $output .= "
"; $output .= "Espulsioni"; $output .= "
"; $output .= "
"; if (trim($statusMatch) == "-" or trim($statusMatch) == "formazioni") $output .= "-"; else $output .= $teamNode2->item(0)->getAttribute("redcard"); $output .= "

"; return $output; } /** DISPOSIZIONE SU CAMPO **/ function disposition($teamNode,$teamNode2) { $aModule4321 = array( 0=>array ('58','112'), 1=>array ('133','37'), 2=>array ('124','90'), 3=>array ('114','139'), 4=>array ('104','184'), 5=>array ('187','66'), 6=>array ('180','119'), 7=>array ('172','170'), 8=>array ('246','80'), 9=>array ('240','160'), 10=>array ('281','112')); $aModule442 = array( 0=>array ('65','113'), 1=>array ('145','51'), 2=>array ('137','90'), 3=>array ('127','139'), 4=>array ('117','184'), 5=>array ('213','46'), 6=>array ('207','90'), 7=>array ('203','139'), 8=>array ('195','186'), 9=>array ('270','90'), 10=>array ('269','139')); $aModule424 = array( 0=>array ('65','113'), 1=>array ('145','51'), 2=>array ('137','90'), 3=>array ('127','139'), 4=>array ('117','184'), 5=>array ('207','90'), 6=>array ('203','139'), 7=>array ('270','46'), 8=>array ('270','90'), 9=>array ('269','139'), 10=>array ('270','186')); $aModule433 = array( 0=>array ('65','113'), 1=>array ('145','46'), 2=>array ('137','90'), 3=>array ('127','139'), 4=>array ('117','184'), 5=>array ('207','69'), 6=>array ('201','113'), 7=>array ('196','161'), 8=>array ('264','69'), 9=>array ('262','113'), 10=>array ('260','161')); $aModule451 = array( 0=>array ('65','113'), 1=>array ('145','51'), 2=>array ('137','90'), 3=>array ('127','139'), 4=>array ('117','184'), 5=>array ('213','39'), 6=>array ('208','78'), 7=>array ('205','117'), 8=>array ('200','159'), 9=>array ('196','200'), 10=>array ('273','113')); $aModule4141 = array( 0=>array ('57','113'), 1=>array ('125','50'), 2=>array ('118','90'), 3=>array ('108','139'), 4=>array ('98','184'), 5=>array ('168','113'), 6=>array ('232','46'), 7=>array ('227','90'), 8=>array ('224','139'), 9=>array ('218','186'), 10=>array ('278','113')); $aModule4411 = array( 0=>array ('57','113'), 1=>array ('125','50'), 2=>array ('118','90'), 3=>array ('108','139'), 4=>array ('98','184'), 5=>array ('189','49'), 6=>array ('182','90'), 7=>array ('177','139'), 8=>array ('173','186'), 9=>array ('235','139'), 10=>array ('278','113')); $aModule4231 = array( 0=>array ('58','112'), 1=>array ('133','37'), 2=>array ('124','90'), 3=>array ('114','139'), 4=>array ('104','184'), 5=>array ('181','90'), 6=>array ('176','139'), 7=>array ('237','60'), 8=>array ('234','113'), 9=>array ('232','167'), 10=>array ('281','113')); $aModule4312 = array( 0=>array ('58','112'), 1=>array ('133','37'), 2=>array ('124','90'), 3=>array ('114','139'), 4=>array ('104','184'), 5=>array ('187','66'), 6=>array ('180','119'), 7=>array ('172','170'), 8=>array ('234','112'), 9=>array ('280','80'), 10=>array ('280','154')); $aModule343 = array( 0=>array ('65','113'), 1=>array ('138','68'), 2=>array ('131','113'), 3=>array ('121','161'), 4=>array ('202','47'), 5=>array ('196','91'), 6=>array ('191','139'), 7=>array ('188','183'), 8=>array ('264','69'), 9=>array ('262','113'), 10=>array ('260','161')); $aModule3412 = array( 0=>array ('55','112'), 1=>array ('118','68'), 2=>array ('111','112'), 3=>array ('101','161'), 4=>array ('180','47'), 5=>array ('174','91'), 6=>array ('169','139'), 7=>array ('166','183'), 8=>array ('225','112'), 9=>array ('273','69'), 10=>array ('272','161')); $aModule3421 = array( 0=>array ('55','112'), 1=>array ('118','68'), 2=>array ('111','112'), 3=>array ('101','161'), 4=>array ('180','47'), 5=>array ('174','91'), 6=>array ('169','139'), 7=>array ('166','183'), 8=>array ('230','69'), 9=>array ('226','161'), 10=>array ('271','112')); $aModule352 = array( 0=>array ('55','112'), 1=>array ('118','68'), 2=>array ('111','112'), 3=>array ('101','161'), 4=>array ('194','39'), 5=>array ('189','77'), 6=>array ('184','114'), 7=>array ('181','154'), 8=>array ('177','192'), 9=>array ('265','69'), 10=>array ('264','161')); $aModule3511 = array( 0=>array ('55','112'), 1=>array ('118','68'), 2=>array ('111','112'), 3=>array ('101','161'), 4=>array ('179','39'), 5=>array ('173','77'), 6=>array ('169','114'), 7=>array ('166','154'), 8=>array ('162','192'), 9=>array ('225','135'), 10=>array ('277','112')); $aModule532 = array( 0=>array ('65','113'), 1=>array ('143','38'), 2=>array ('136','75'), 3=>array ('126','113'), 4=>array ('116','150'), 5=>array ('106','191'), 6=>array ('207','68'), 7=>array ('201','112'), 8=>array ('197','161'), 9=>array ('270','90'), 10=>array ('269','139')); $aModule5311 = array( 0=>array ('65','113'), 1=>array ('137','38'), 2=>array ('130','75'), 3=>array ('120','113'), 4=>array ('110','150'), 5=>array ('100','191'), 6=>array ('188','68'), 7=>array ('181','112'), 8=>array ('178','161'), 9=>array ('232','139'), 10=>array ('275','106')); $logoHome = $teamNode->item(0)->getAttribute("logo"); $logoAway = $teamNode2->item(0)->getAttribute("logo"); $logoHomeBg = ""; $logoAwayBg = ""; $output = ""; $output .= "
"; $output .= $teamNode->item(0)->getAttribute("module") . "
" . $logoHomeBg; $output .= "
"; $output .= "
"; $output .= $teamNode2->item(0)->getAttribute("module") . "
" . $logoAwayBg; $output .= "

"; $output .= "
"; $output .= checkTrainer($teamNode); $output .= "
"; $output .= "
"; $output .= " ALLENATORI "; $output .= "
"; $output .= "
"; $output .= checkTrainer($teamNode2); $output .= "
"; //**TEAM HOME $teamHomePlayers = $teamNode->item(0)->getElementsByTagName("player"); $count=0; foreach ($teamHomePlayers as $nodeXmlitem) { if ($nodeXmlitem->getAttribute("headline") == "N" or $nodeXmlitem->getAttribute("role") == "ALL") break; if($teamNode->item(0)->getAttribute("module") == "4-3-2-1") $positionStyle = "position:absolute; top:" . $aModule4321[$count][1] . "px; left:" . $aModule4321[$count][0] . "px;"; elseif($teamNode->item(0)->getAttribute("module") == "4-4-2") $positionStyle = "position:absolute; top:" . $aModule442[$count][1] . "px; left:" . $aModule442[$count][0] . "px;"; elseif($teamNode->item(0)->getAttribute("module") == "4-2-4") $positionStyle = "position:absolute; top:" . $aModule424[$count][1] . "px; left:" . $aModule424[$count][0] . "px;"; elseif($teamNode->item(0)->getAttribute("module") == "4-3-3") $positionStyle = "position:absolute; top:" . $aModule433[$count][1] . "px; left:" . $aModule433[$count][0] . "px;"; elseif($teamNode->item(0)->getAttribute("module") == "4-5-1") $positionStyle = "position:absolute; top:" . $aModule451[$count][1] . "px; left:" . $aModule451[$count][0] . "px;"; elseif($teamNode->item(0)->getAttribute("module") == "4-1-4-1") $positionStyle = "position:absolute; top:" . $aModule4141[$count][1] . "px; left:" . $aModule4141[$count][0] . "px;"; elseif($teamNode->item(0)->getAttribute("module") == "4-4-1-1") $positionStyle = "position:absolute; top:" . $aModule4411[$count][1] . "px; left:" . $aModule4411[$count][0] . "px;"; elseif($teamNode->item(0)->getAttribute("module") == "4-2-3-1") $positionStyle = "position:absolute; top:" . $aModule4231[$count][1] . "px; left:" . $aModule4231[$count][0] . "px;"; elseif($teamNode->item(0)->getAttribute("module") == "4-3-1-2") $positionStyle = "position:absolute; top:" . $aModule4312[$count][1] . "px; left:" . $aModule4312[$count][0] . "px;"; elseif($teamNode->item(0)->getAttribute("module") == "3-4-3") $positionStyle = "position:absolute; top:" . $aModule343[$count][1] . "px; left:" . $aModule343[$count][0] . "px;"; elseif($teamNode->item(0)->getAttribute("module") == "3-4-1-2") $positionStyle = "position:absolute; top:" . $aModule3412[$count][1] . "px; left:" . $aModule3412[$count][0] . "px;"; elseif($teamNode->item(0)->getAttribute("module") == "3-4-2-1") $positionStyle = "position:absolute; top:" . $aModule3421[$count][1] . "px; left:" . $aModule3421[$count][0] . "px;"; elseif($teamNode->item(0)->getAttribute("module") == "3-5-2") $positionStyle = "position:absolute; top:" . $aModule352[$count][1] . "px; left:" . $aModule352[$count][0] . "px;"; elseif($teamNode->item(0)->getAttribute("module") == "3-5-1-1") $positionStyle = "position:absolute; top:" . $aModule3511[$count][1] . "px; left:" . $aModule3511[$count][0] . "px;"; elseif($teamNode->item(0)->getAttribute("module") == "5-3-2") $positionStyle = "position:absolute; top:" . $aModule532[$count][1] . "px; left:" . $aModule532[$count][0] . "px;"; elseif($teamNode->item(0)->getAttribute("module") == "5-3-1-1") $positionStyle = "position:absolute; top:" . $aModule5311[$count][1] . "px; left:" . $aModule5311[$count][0] . "px;"; $output .= "
".$nodeXmlitem->getAttribute("number")."
" . $nodeXmlitem->getAttribute("surname") . "
"; $output .= "
"; $count++; } //**TEAM AWAY $teamAwayPlayers = $teamNode2->item(0)->getElementsByTagName("player"); $widthCampo=658; $widthElem = 60; $count=0; foreach ($teamAwayPlayers as $nodeXmlitem) { if ($nodeXmlitem->getAttribute("headline") == "no" or $nodeXmlitem->getAttribute("role") == "ALL") break; if($teamNode2->item(0)->getAttribute("module") == "4-3-2-1") $positionStyle = "position:absolute; top:" . $aModule4321[$count][1] . "px; left:" . ($widthCampo -$widthElem- (int)$aModule4321[$count][0]) . "px;"; elseif($teamNode2->item(0)->getAttribute("module") == "4-4-2") $positionStyle = "position:absolute; top:" . $aModule442[$count][1] . "px; left:" . ($widthCampo -$widthElem- (int)$aModule442[$count][0]) . "px;"; elseif($teamNode2->item(0)->getAttribute("module") == "4-2-4") $positionStyle = "position:absolute; top:" . $aModule424[$count][1] . "px; left:" . ($widthCampo -$widthElem- (int)$aModule424[$count][0]) . "px;"; elseif($teamNode2->item(0)->getAttribute("module") == "4-3-3") $positionStyle = "position:absolute; top:" . $aModule433[$count][1] . "px; left:" . ($widthCampo -$widthElem- (int)$aModule433[$count][0]) . "px;"; elseif($teamNode2->item(0)->getAttribute("module") == "4-5-1") $positionStyle = "position:absolute; top:" . $aModule451[$count][1] . "px; left:" . ($widthCampo -$widthElem- (int)$aModule451[$count][0]) . "px;"; elseif($teamNode2->item(0)->getAttribute("module") == "4-1-4-1") $positionStyle = "position:absolute; top:" . $aModule4141[$count][1] . "px; left:" . ($widthCampo -$widthElem- (int)$aModule4141[$count][0]) . "px;"; elseif($teamNode2->item(0)->getAttribute("module") == "4-4-1-1") $positionStyle = "position:absolute; top:" . $aModule4411[$count][1] . "px; left:" . ($widthCampo -$widthElem- (int)$aModule4411[$count][0]) . "px;"; elseif($teamNode2->item(0)->getAttribute("module") == "4-2-3-1") $positionStyle = "position:absolute; top:" . $aModule4231[$count][1] . "px; left:" . ($widthCampo -$widthElem- (int)$aModule4231[$count][0]) . "px;"; elseif($teamNode2->item(0)->getAttribute("module") == "4-3-1-2") $positionStyle = "position:absolute; top:" . $aModule4312[$count][1] . "px; left:" . ($widthCampo -$widthElem- (int)$aModule4312[$count][0]) . "px;"; elseif($teamNode2->item(0)->getAttribute("module") == "3-4-3") $positionStyle = "position:absolute; top:" . $aModule343[$count][1] . "px; left:" . ($widthCampo -$widthElem- (int)$aModule343[$count][0]) . "px;"; elseif($teamNode2->item(0)->getAttribute("module") == "3-4-1-2") $positionStyle = "position:absolute; top:" . $aModule3412[$count][1] . "px; left:" . ($widthCampo -$widthElem- (int)$aModule3412[$count][0]) . "px;"; elseif($teamNode2->item(0)->getAttribute("module") == "3-4-2-1") $positionStyle = "position:absolute; top:" . $aModule3421[$count][1] . "px; left:" . ($widthCampo -$widthElem- (int)$aModule3421[$count][0]) . "px;"; elseif($teamNode2->item(0)->getAttribute("module") == "3-5-2") $positionStyle = "position:absolute; top:" . $aModule352[$count][1] . "px; left:" . ($widthCampo -$widthElem- (int)$aModule352[$count][0]). "px;"; elseif($teamNode2->item(0)->getAttribute("module") == "3-5-1-1") $positionStyle = "position:absolute; top:" . $aModule3511[$count][1] . "px; left:" . ($widthCampo -$widthElem- (int)$aModule3511[$count][0]) . "px;"; elseif($teamNode2->item(0)->getAttribute("module") == "5-3-2") $positionStyle = "position:absolute; top:" . $aModule532[$count][1] . "px; left:" . ($widthCampo -$widthElem- (int)$aModule532[$count][0]) . "px;"; elseif($teamNode2->item(0)->getAttribute("module") == "5-3-1-1") $positionStyle = "position:absolute; top:" . $aModule5311[$count][1] . "px; left:" . ($widthCampo -$widthElem- (int)$aModule5311[$count][0]) . "px;"; if (!isset($positionStyle)) $positionStyle=""; $output .= "
".$nodeXmlitem->getAttribute("number")."
" . $nodeXmlitem->getAttribute("surname") . "
"; $output .= "
"; $count++; } if ($teamNode->item(0)->getAttribute("module") == "" or $teamNode2->item(0)->getAttribute("module") == "") $output = ""; return $output; } ?>

refresh tra
aggiorna ora
  -  

15'
30'
60'
75'

DIRETTA


 Ammonizione
 Doppia Ammonizione
 Espulsione
 Gol
 AutoGol
 Rigore
 Sostituzione


VIDEO GOL 3D

CLASSIFICHE

STATISTICHE PARTITA


Powered By Datasport.it