Viewing file: PodiumExcel.php (9.89 KB) -rw-rw-r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
header ( "Content-type: application/vnd.ms-excel" );
header ( "Content-Disposition: attachment; filename=Podium.xls" );
include('class.MySqliDB.php');
include('globals.php');
$Debug= 1;
$ConnectionArray= array('Server'=>Server,
'Usser'=>User,
'Pass'=>Pass,
'Db'=>Db);
$ConnMysql= new MysqliDB($ConnectionArray);
$Sql= ("SET NAMES UTF8");
$ConnMysql->EnviarQuery($Sql);
$Sql= '';
$Title= '';
$Sql= '';
?>
<!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>
<meta charset="UTF-8" />
<title>Informes</title>
<link rel="shortcut icon" href="favicon.ico">
<style>
.Logo {
font-family: Georgia, 'Times New Roman', Times, serif;
font-size: 50px;
font-weight: bold;
color: #33C;
margin-left:10px;
}
.Titulo {
font-family: Georgia, 'Times New Roman', Times, serif;
font-size: 30px;
font-weight: bold;
color: #393;
margin-left:10px;
}
.Clasificacion {
font-family: Georgia, 'Times New Roman', Times, serif;
font-size: 30px;
font-weight: bold;
color: #369;
margin-left:10px;
}
.Categoria {
font-family: Georgia, 'Times New Roman', Times, serif;
font-size: 18px;
font-weight: bold;
color: #369;
margin-left:10px;
}
.Inicio {
font-family: Georgia, 'Times New Roman', Times, serif;
font-size: 20px;
font-weight: bold;
color: Red;
margin-left:10px;
}
.TEncabezado {
font-family: "Times New Roman", Times, serif;
font-size: 14px;
color: #000;
background-color: #C6F1FF;
}
.TPar {
font-family: "Times New Roman", Times, serif;
font-size: 12px;
text-align:center;
color: #000;
background-color: #FFF;
}
.TImpar {
font-family: "Times New Roman", Times, serif;
font-size: 12px;
text-align:center;
color: #000;
background-color: #E5E5E5;
}
</style>
</head>
<body>
<table><tr><td colspan="6" class="Logo"><?php echo VarTitle;?></td></tr></table>
<div id="ContenedorLargaSexo" class="Contenedor">
<?php
$AuxCategoria= array( 'LARGA'=>array('FEMENINA','MASCULINA'));
$AuxClasificacion= array();
$AuxClasificacion['LARGA']= array();
$Sql= "SELECT `Dorsal`,`Nombre`,`Apellidos`,`CATEGORIA`,`Carrera`,`Crono`,`General`,`GeneralSexo`,`SEXO`
FROM `".Db."`.`inscripcion_unificada_mini` WHERE `Carrera`= 'LARGA' AND `Crono` IS NOT NULL AND `GeneralSexo` < 4 ORDER BY `GeneralSexo` ASC";
$ConnMysql->EnviarQuery($Sql);
$ConnMysql->ResultadoObjeto();
//echo "<pre>";print_r($ConnMysql->ArrayResultado);die();
$Title= 'Podium 30,3 Km General';
if($ConnMysql->MySqliResult->num_rows != 0)
{
foreach($ConnMysql->ArrayResultado as $FDatos)
{
$AuxClasificacion[$FDatos->Carrera][$FDatos->SEXO][$FDatos->GeneralSexo]= $FDatos;
}
unset($FDatos);
//echo "<pre>";print_r($AuxClasificacion);die();
?>
<br />
<span class="Titulo"><?php echo $Title;?></span>
<br /> <?php
foreach($AuxCategoria as $KCarrera=>$VCarrera)
{
foreach($VCarrera as $Categoria)
{
/*
[Dorsal] => 301
[Nombre] => BELEN
[Apellidos] => CASTRO CASTELLANOS
[Categoria] => FEMENINA
[Carrera] => CORTA
[Crono] => 00:01:19
[Puesto] => 1
[General] => 1
*/
?>
<p><span class="Categoria"><?php echo 'PODIUM CARRERA '.strtoupper($KCarrera).' GENERAL '.strtoupper($Categoria);?></span></p>
<table style="margin-left:10px;" width="95%">
<tr>
<th class="TEncabezado">Orden<br />Llegada</th>
<th class="TEncabezado">Dorsal</th>
<th class="TEncabezado">Nombre</th>
<th class="TEncabezado">Apellidos</th>
<th class="TEncabezado">Categoria</th>
<th class="TEncabezado">Crono</th>
<th class="TEncabezado">General</th>
</tr>
<?php
$i= 1;
foreach($AuxClasificacion[$KCarrera][$Categoria] as $FDatos)
{
if($i%2)echo '<tr class="TImpar">';else echo '<tr class="TPar">';
echo sprintf("<td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>",
$FDatos->GeneralSexo,$FDatos->Dorsal,$FDatos->Nombre,$FDatos->Apellidos,$FDatos->CATEGORIA,$FDatos->Crono,$FDatos->General);
$i++;
if(isset($_REQUEST['Tipo']) and $_REQUEST['Tipo'] == 'podium' and $i == 4)
{
break;
}
}
unset($FDatos);
?> </table> <?php
}
}
}
else{echo '<span>NO HAY CORREDORES FINALIZADOS</span>';}
?>
</div>
<br/>
<div id="ContenedorLarga" class="Contenedor">
<?php
$AuxCategoria= array( 'LARGA'=>array( 'Femenina Senior','Femenina Veteranas A','Femenina Veteranas B',
'Masculina Senior','Masculina Veteranos A','Masculina Veteranos B')
);
$AuxClasificacion= array();
$AuxClasificacion['CORTA']= array();
$AuxClasificacion['LARGA']= array();
$Sql= "SELECT `Dorsal`,`Nombre`,`Apellidos`,`CATEGORIA`,`Carrera`,`Crono`,`Puesto`,`General`
FROM `".Db."`.`inscripcion_unificada_mini` WHERE `Carrera`= 'LARGA' AND `Crono` IS NOT NULL AND `Puesto` < 4 ORDER BY `Puesto` ASC";
$ConnMysql->EnviarQuery($Sql);
$ConnMysql->ResultadoObjeto();
//echo "<pre>";print_r($ConnMysql->ArrayResultado);die();
$Title= 'Podium 30,3 Km por Categorias';
if($ConnMysql->MySqliResult->num_rows != 0)
{
foreach($ConnMysql->ArrayResultado as $FDatos)
{
$AuxClasificacion[$FDatos->Carrera][$FDatos->CATEGORIA][$FDatos->Puesto]= $FDatos;
}
unset($FDatos);
//echo "<pre>";print_r($AuxClasificacion);die();
?>
<br />
<span class="Titulo"><?php echo $Title;?></span>
<br /> <?php
foreach($AuxCategoria as $KCarrera=>$VCarrera)
{
foreach($VCarrera as $Categoria)
{
/*
[Dorsal] => 301
[Nombre] => BELEN
[Apellidos] => CASTRO CASTELLANOS
[Categoria] => FEMENINA
[Carrera] => CORTA
[Crono] => 00:01:19
[Puesto] => 1
[General] => 1
*/
?>
<p><span class="Categoria"><?php echo 'PODIUM CARRERA '.strtoupper($KCarrera).' CATEGORIA '.strtoupper($Categoria);?></span></p>
<table style="margin-left:10px;" width="95%">
<tr>
<th class="TEncabezado">Orden<br />Llegada</th>
<th class="TEncabezado">Dorsal</th>
<th class="TEncabezado">Nombre</th>
<th class="TEncabezado">Apellidos</th>
<th class="TEncabezado">Categoria</th>
<th class="TEncabezado">Crono</th>
<th class="TEncabezado">General</th>
</tr>
<?php
$i= 1;
foreach($AuxClasificacion[$KCarrera][$Categoria] as $FDatos)
{
if($i%2)echo '<tr class="TImpar">';else echo '<tr class="TPar">';
echo sprintf("<td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>",
$FDatos->Puesto,$FDatos->Dorsal,$FDatos->Nombre,$FDatos->Apellidos,$FDatos->CATEGORIA,$FDatos->Crono,$FDatos->General);
$i++;
if(isset($_REQUEST['Tipo']) and $_REQUEST['Tipo'] == 'podium' and $i == 4)
{
break;
}
}
unset($FDatos);
?> </table> <?php
}
}
}
else{echo '<span>NO HAY CORREDORES FINALIZADOS</span>';}
?>
</div>
<br />
<div id="ContenedorCorta" class="Contenedor">
<?php
$AuxCategoria= array( 'CORTA'=>array('FEMENINA','MASCULINA'));
$AuxClasificacion= array();
$AuxClasificacion['CORTA']= array();
$Sql= "SELECT `Dorsal`,`Nombre`,`Apellidos`,`CATEGORIA`,`Carrera`,`Crono`,`Puesto`,`General`
FROM `".Db."`.`inscripcion_unificada_mini` WHERE `Carrera`= 'CORTA' AND `Crono` IS NOT NULL AND `Puesto` < 4 ORDER BY `Puesto` ASC";
$ConnMysql->EnviarQuery($Sql);
$ConnMysql->ResultadoObjeto();
//echo "<pre>";print_r($ConnMysql->ArrayResultado);die();
$Title= 'Podium 13 Km por Categorias';
if($ConnMysql->MySqliResult->num_rows != 0)
{
foreach($ConnMysql->ArrayResultado as $FDatos)
{
$AuxClasificacion[$FDatos->Carrera][$FDatos->CATEGORIA][$FDatos->Puesto]= $FDatos;
}
unset($FDatos);
//echo "<pre>";print_r($AuxClasificacion);die();
?>
<br />
<span class="Titulo"><?php echo $Title;?></span>
<br /> <?php
foreach($AuxCategoria as $KCarrera=>$VCarrera)
{
foreach($VCarrera as $Categoria)
{
/*
[Dorsal] => 301
[Nombre] => BELEN
[Apellidos] => CASTRO CASTELLANOS
[Categoria] => FEMENINA
[Carrera] => CORTA
[Crono] => 00:01:19
[Puesto] => 1
[General] => 1
*/
?>
<p><span class="Categoria"><?php echo 'PODIUM CARRERA '.strtoupper($KCarrera).' CATEGORIA '.strtoupper($Categoria);?></span></p>
<table style="margin-left:10px;" width="95%">
<tr>
<th class="TEncabezado">Orden<br />Llegada</th>
<th class="TEncabezado">Dorsal</th>
<th class="TEncabezado">Nombre</th>
<th class="TEncabezado">Apellidos</th>
<th class="TEncabezado">Categoria</th>
<th class="TEncabezado">Crono</th>
<th class="TEncabezado">General</th>
</tr>
<?php
$i= 1;
foreach($AuxClasificacion[$KCarrera][$Categoria] as $FDatos)
{
if($i%2)echo '<tr class="TImpar">';else echo '<tr class="TPar">';
echo sprintf("<td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>",
$FDatos->Puesto,$FDatos->Dorsal,$FDatos->Nombre,$FDatos->Apellidos,$FDatos->CATEGORIA,$FDatos->Crono,$FDatos->General);
$i++;
if(isset($_REQUEST['Tipo']) and $_REQUEST['Tipo'] == 'podium' and $i == 4)
{
break;
}
}
unset($FDatos);
?> </table> <?php
}
}
}
else{echo '<span>NO HAY CORREDORES FINALIZADOS</span>';}
?>
</div>
</body>
</html>
|