<?php
ob_start();
// session_start();
require_once("Sigma.php");

// mb_http_output('UTF-8');
$tpl =& new HTML_Template_Sigma('.','./template/cache');

//redireccionamientos.
$tpl->loadTemplateFile('afl.html');
$tpl->setVariable('fecha', date("d/m/Y"));
$colores = "";
$archivo = $_GET['file'];
if (file_exists($archivo))
{

  if(is_readable($archivo))
  {

   if (!$myxml=simplexml_load_file($archivo))
        echo 'Error al Cargar Archivo AFL.XML';
       else
       {

        foreach($myxml as $node)
        {
             if ($colores == "#B4D397")
             {
                $tpl->setVariable('colores', 'bgcolor=""');
                $colores = "";
             }
             else
             {
               $tpl->setVariable('colores', 'bgcolor="#B4D397"');
               $colores = "#B4D397";
             }

               $timegame = explode(":", $node->TimeGame);
               $hora = $timegame[0].':'.$timegame[1];
               $meridian = $timegame[2];

                  $tpl->setVariable('hora2',$hora);
                  $tpl->setVariable('espa2',$meridian);
                  $tpl->setVariable('vId2',$node->VisTeam);

                  $tpl->setVariable('eq_visitante2', $node->EquipoVisitante);
                  $tpl->setVariable('lId2', $node->LocTeam);

                  $tpl->setVariable('eq_local2',   ($node->EquipoLocal));
                  $tpl->setVariable('jc_mlv2',     ($node->PriceMLJCVis));

                  $tpl->setVariable('jc_mll2',     ($node->PriceMLJCLoc));
                  $tpl->setVariable('jc_rlv2',     ($node->RLJCVis));

                  $tpl->setVariable('jc_rll2',     ($node->RLJCLoc));

                  $tpl->setVariable('h1_mlv2',     ($node->PriceMLPMVis));
                  $tpl->setVariable('h1_mll2',     ($node->PriceMLPMLoc));

                  $tpl->setVariable('h1_rlv2',     ($node->RLPMVis));
                  $tpl->setVariable('h1_rll2',     ($node->RLPMLoc));

                  $tpl->setVariable('q1_mlv2',     ($node->PriceMLPPVis));
                  $tpl->setVariable('q1_mll2',     ($node->PriceMLPPLoc));

                  $tpl->setVariable('q1_rlv2',     ($node->RLPPVis));
                  $tpl->setVariable('q1_rll2',     ($node->RLPPLoc));
                  $registro++;

               $tpl->parse('bloque2');

        }//for.
       }//else
   }//is readable.
}
$tpl->show();


?>