<?
include 'concha_guiadeargentina.php';

mysql_connect ("$host2", "$usuario2", "$contra2");
mysql_select_db ("$basedatos2");


$sql23 = "SELECT * 
FROM  `resultados_loterias` 
WHERE  `cual` =  '$IDl' ORDER BY ID desc
LIMIT 1";



$consulta23 = mysql_query ($sql23);
while ($row23 = mysql_fetch_array($consulta23))
{ 
$cual  = $row23["cual"];
$fecha  = $row23["fecha"];
$a1  = $row23["a1"];
$cabeza = substr("$a1", -2);    // devuelve "ef"
$a2  = $row23["a2"];
$a3  = $row23["a3"];
$a4  = $row23["a4"];
$a5  = $row23["a5"];
$a6  = $row23["a6"];
$a7  = $row23["a7"];
$a8  = $row23["a8"];
$a9  = $row23["a9"];
$a10  = $row23["a10"];
$a11  = $row23["a11"];
$a12  = $row23["a12"];
$a13  = $row23["a13"];
$a14  = $row23["a14"];
$a15  = $row23["a15"];
$a16  = $row23["a16"];
$a17  = $row23["a17"];
$a18  = $row23["a18"];
$a19  = $row23["a19"];
$a20 = $row23["a20"];

$letras = $row23["letras"];


}
mysql_free_result($consulta23);

?>




<table class="table" width="<? if ($ancho_tabla == '') { ?>100%<? } else {echo $ancho_tabla;}; ?>" border="0" style="font-family: 'Roboto', sans-serif;">
  <tr>
    <td colspan="4" bgcolor="#333333"><div align="center" class="estilo-blanco"><?php echo $cual11 ?></div></td>
  </tr>
  <tr>
    <td colspan="4" bgcolor="#B7B7B7"><div style="font-size:14px;" align="center">
        <?php  $fecha = mb_strtoupper($fecha); $fecha = utf8_encode($fecha); echo $fecha; ?>
    </div></td>
  </tr>
  <tr>
    <td colspan="4"  bgcolor="#FF0000" class="estilo-blanco"><div align="center"><span style="font-size:13px;">A LA CABEZA</span></div></td>
  </tr>
  <tr>
    <td colspan="4"  bgcolor="#666666" class="estilo-blanco"><div align="center"><span style="font-size:30px;"><strong><?php echo $cabeza ?></strong></span><br />
      <?


mysql_select_db ("$basedatos2");



$sql24 = "SELECT * 
FROM  `numeros_loteria` 
WHERE  `numero` = $cabeza
LIMIT 1";



$consulta24 = mysql_query ($sql24);

while ($row24 = mysql_fetch_array($consulta24))

{

$que_cabeza = $row24["que"];
$que_cabeza = utf8_encode($que_cabeza);

}

mysql_free_result($consulta24);

?>
      
      <span style="font-size:15px;"><strong><?php echo $que_cabeza ?></strong></span></div></td>
  </tr>
  <tr>
    <td width="5%"  bgcolor="#FF0000"><span class="estilo-blanco">1º</span></td>
    <td width="45%"  bgcolor="#E4E4E4"><strong><?php echo $a1 ?></strong></td>
    <td width="5%"  bgcolor="#333333"><span class="estilo-blanco">11º</span></td>
    <td width="45%"  bgcolor="#E4E4E4"><?php echo $a11 ?></td>
  </tr>
  <tr>
    <td bgcolor="#333333"><span class="estilo-blanco">2º</span></td>
    <td bgcolor="#C7C7C7"><?php echo $a2 ?></td>
    <td bgcolor="#333333"><span class="estilo-blanco">12º</span></td>
    <td bgcolor="#C7C7C7"><?php echo $a12 ?></td>
  </tr>
  <tr>
    <td bgcolor="#333333"><span class="estilo-blanco">3º</span></td>
    <td bgcolor="#E4E4E4"><?php echo $a3 ?></td>
    <td bgcolor="#333333"><span class="estilo-blanco">13º</span></td>
    <td bgcolor="#E4E4E4"><?php echo $a13 ?></td>
  </tr>
  <tr>
    <td bgcolor="#333333"><span class="estilo-blanco">4º</span></td>
    <td bgcolor="#C7C7C7"><?php echo $a4 ?></td>
    <td bgcolor="#333333"><span class="estilo-blanco">14º</span></td>
    <td bgcolor="#C7C7C7"><?php echo $a14 ?></td>
  </tr>
  <tr>
    <td bgcolor="#333333"><span class="estilo-blanco">5º</span></td>
    <td bgcolor="#E4E4E4"><?php echo $a5 ?></td>
    <td bgcolor="#333333"><span class="estilo-blanco">15º</span></td>
    <td bgcolor="#E4E4E4"><?php echo $a15 ?></td>
  </tr>
  <tr>
    <td bgcolor="#333333"><span class="estilo-blanco">6º</span></td>
    <td bgcolor="#C7C7C7"><?php echo $a6 ?></td>
    <td bgcolor="#333333"><span class="estilo-blanco">16º</span></td>
    <td bgcolor="#C7C7C7"><?php echo $a16 ?></td>
  </tr>
  <tr>
    <td bgcolor="#333333"><span class="estilo-blanco">7º</span></td>
    <td bgcolor="#E4E4E4"><?php echo $a7 ?></td>
    <td bgcolor="#333333"><span class="estilo-blanco">17º</span></td>
    <td bgcolor="#E4E4E4"><?php echo $a17 ?></td>
  </tr>
  <tr>
    <td bgcolor="#333333"><span class="estilo-blanco">8º</span></td>
    <td bgcolor="#C7C7C7"><?php echo $a8 ?></td>
    <td bgcolor="#333333"><span class="estilo-blanco">18º</span></td>
    <td bgcolor="#C7C7C7"><?php echo $a18 ?></td>
  </tr>
  <tr>
    <td bgcolor="#333333"><span class="estilo-blanco">9º</span></td>
    <td bgcolor="#E4E4E4"><?php echo $a9 ?></td>
    <td bgcolor="#333333"><span class="estilo-blanco">19º</span></td>
    <td bgcolor="#E4E4E4"><?php echo $a19 ?></td>
  </tr>
  <tr>
    <td bgcolor="#333333"><span class="estilo-blanco">10º</span></td>
    <td bgcolor="#C7C7C7"><?php echo $a10 ?></td>
    <td bgcolor="#333333"><span class="estilo-blanco">20º</span></td>
    <td bgcolor="#C7C7C7"><?php echo $a20 ?></td>
  </tr>
  <?php if ($letras == '') {} else {?>
  <tr>
    <td colspan="4" bgcolor="#333333" class="estilo-blanco"><div align="center">LETRAS: <strong><?php echo $letras ?></strong></div></td>
  </tr> <?php };?>
</table>
