<?php
 ob_start();
// session_start();
header("Expires: Mon, 20 Mar 1998 12:01:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");

 require_once("Sigma.php");
 mb_http_output('UTF-8');
 $tpl =& new HTML_Template_Sigma('.','./template/cache');
 $tpl->loadTemplateFile('pon_si_no.htm');
 $file = $_GET['file'];

  $colores = "";
  $tpl->setVariable('fecha', date("d/m/Y"));
if(file_exists($file) && is_readable($file))
{
  if (!$myxml=simplexml_load_file($file))
   echo 'Error al Cargar Archivo XML';
  else
  {

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

        $tpl->setVariable('nu'  ,BlankSpace($node->Orden));

        $timegame = explode(":", $node->TimeGame);
        $hora = $timegame[0].':'.$timegame[1];
        //$meridian = $timegame[2];
         if($timegame[2] == 'p.' || $timegame[2] == 'P.')
                 $meridian = 'PM';
               elseif($timegame[2] == 'a.' || $timegame[2] == 'A.')
                 $meridian = 'AM';
               else
                 $meridian = $timegame[2];

           $tpl->setVariable('dep',   $node->Liga);
           $tpl->setVariable('hora',$hora);
           $tpl->setVariable('espa',$meridian);
           $tpl->setVariable('vId',$node->VisTeam);

           $tpl->setVariable('eq_visitante',   $node->EquipoVisitante);
           $tpl->setVariable('lId', $node->LocTeam);

           $tpl->setVariable('eq_local',   utf8_decode(BlankSpace($node->EquipoLocal)));
          // $tpl->setVariable('ml_vjc',     utf8_decode(BlankSpace($node->PriceMLJCVis)));

           $tpl->setVariable('mly',        utf8_decode(BlankSpace($node->PriceSIJC)));
           $tpl->setVariable('mln',        utf8_decode(BlankSpace($node->PriceNOJC)));

           $tpl->setVariable('ml2y',       utf8_decode(BlankSpace($node->PriceSI2JC)));
           $tpl->setVariable('ml2n',       utf8_decode(BlankSpace($node->PriceNO2JC)));

           $tpl->setVariable('pitvis',     utf8_decode(BlankSpace($node->VisPitcher)));
           $tpl->setVariable('pitloc',     utf8_decode(BlankSpace($node->LocPitcher)));

           $tpl->setVariable('tsv',        utf8_decode(BlankSpace($node->VisPitcherValue)));
           $tpl->setVariable('tsl',        utf8_decode(BlankSpace($node->LocPitcherValue)));

          // $tpl->setVariable('sv',   utf8_decode($node->PriceSINOJCVis));

           $tpl->setVariable('matchv',     utf8_decode(BlankSpace($node->RLPXEJCVis)));
           $tpl->setVariable('matchl',     utf8_decode(BlankSpace($node->RLPXEJCLoc)));
         //  $tpl->setVariable('name', $node->year);
        //   $tpl->setVariable('totalpit',   utf8_decode(BlankSpace($node->TotalPit)));

        $tpl->parse('bloque1');

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


?>