<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>Best 11 Football Manager</title>
	<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<META HTTP-EQUIV=Refresh CONTENT="10">
<link rel="stylesheet" type="text/css" href="http://best11fm.com/style/style.css" />
    </head>

<body>

   <table width="473" height="62" border="0">
  <tr>
    <th scope="col"> <img src="../images/Top.jpg" width="728" height="80" border="0" usemap="#TopMap" /></th>
  </tr>
</table>
   
    <map name="TopMap">
  <area shape="rect" coords="3,5,916,115" href="http://best11fm.com/best/main" alt="Main" />
  </map>
    
    
<div class="nav-container-outer">
   <img src="http://best11fm.com/images/nav-bg-l.jpg" alt="" class="float-left" />
   <img src="http://best11fm.com/images/nav-bg-r.jpg" alt="" class="float-right" />
   <ul id="nav-container" class="nav-container">
      <li><a class="item-primary" href="../team/teamstatus" target="_self">&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp Team&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp</a>
         <ul style="width:150px;">
            <li><a href="../team/teamstatus" title="Team Properties" target="_self" >Team Properties</a></li>
            <li><a href="../team/league" title="League" target="_self" >League</a></li>
            <li><a href="../team/stadium" title="Stadium" target="_self" >Stadium</a></li>
            <li><a href="../team/staff" title="Staff" target="_self" >Staff</a></li>
            <li><a href="../team/economy" title="Economy" target="_self" >Economy</a></li>
         </ul>
	   </li>
       <li><span class="divider divider-vert" ></span></li>
      <li><a class="item-primary" href="../player/playerstatus" target="_self">&nbsp&nbsp&nbsp&nbsp&nbsp Players&nbsp&nbsp&nbsp&nbsp&nbsp</a>
         <ul style="width:150px;">
            <li><a href="../player/playerstatus" title="Player Attributes" target="_self" >Player Attributes</a></li>
            <li><a href="" title="Training" target="_self" >Training</a></li>
         </ul>
	   </li>
       <li><span class="divider divider-vert" ></span></li>
      <li><a class="item-primary" href="../match/matchmotor" target="_self">&nbsp&nbsp&nbsp&nbsp&nbsp Matches&nbsp&nbsp&nbsp&nbsp&nbsp</a>
         <ul style="width:150px;">
            <li><a href="" title="Fixture" target="_self" >Fixture</a></li>
            <li><a href="" title="Tactics" target="_self" >Tactics</a></li>
         </ul>
	   </li>
       <li><span class="divider divider-vert" ></span></li>
      <li><a class="item-primary" href="../transfer/transferstatus" target="_self">&nbsp&nbsp&nbsp&nbsp&nbsp Transfer&nbsp&nbsp&nbsp&nbsp&nbsp</a>
	   </li>
       <li><span class="divider divider-vert" ></span></li>
      <li class="clear"> </li>
   </ul>
</div>
    
    
    <table id="comments">
		 <?
		 $id2=Session::instance()->get("fbUserId");
	    $file = 'test_file.xml';
	    $xml = simplexml_load_file($file);
	    $file2 = $id2.'.xml';
	    $xml2 = simplexml_load_file($file2);
	    $home=0;
	    $away=0;
	    foreach($xml2-> home as $home);
	    foreach($xml2-> away as $away);
	    foreach($xml-> scoreA[0]->attributes() as $a => $scoreA);
	    foreach($xml-> scoreB[0]->attributes() as $a => $scoreB);
	?>

                <tr>
		    <td align=center><b><li>Positions</li></b></td>                 
		</tr>




		<? $i=0;
			$home=0;
	$away=0;
                $id=(time()-$xml->time[0])/10;?>
		<? foreach($xml->position as $val):?>
		<tr>    
                   <td align=left>
		    <?
                     if($i>$id) break;
                     else $i++;
		    foreach($val->attributes() as $a => $min);?>
		   <b> <?echo $min;
		    echo "min: ";?></b>
		   <?foreach($val->comment as $comment)
		   {
			echo $comment;
		   }
		   foreach($val->flash as $flash)
		   {
		   if(strpos($flash,"Goal")!==true)
			{
			    if(strpos($flash,$xml-> scoreA[0])!==true)
			    {   
				$home++;
				$xml2 = new SimpleXMLElement('<match></match>');
				$xml2->addChild('home',htmlspecialchars(utf8_encode($home)));
				$xml2->addChild('away',htmlspecialchars(utf8_encode($away)));
				$xml2->asXML($id2.'.xml');
			    }else if(strpos($flash,$xml-> scoreB[0])!==true)
			    {   
				$away++;
				$xml2 = new SimpleXMLElement('<match></match>');
				$xml2->addChild('home',htmlspecialchars(utf8_encode($home)));
				$xml2->addChild('away',htmlspecialchars(utf8_encode($away)));
				$xml2->asXML($id2.'.xml');
			    }
			}
			foreach($flash->attributes() as $a => $flashName);
			?>
<a href="" onclick="window.open('http://www.best11fm.com<?="/flash/playflash/".$flashName?>','', 'width=750, height=500, location=no, menubar=no, status=no,toolbar=no, scrollbars=no, resizable=no'); return false">

<? echo $flash; ?>
		   <?}?>
                   </td>
		</tr>
	    <? endforeach;?>
    </table>



</body>

</html>