1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169
| <?php
// require('fpdf.php');
// $pdf=new FPDF();
// $pdf->Open();
// $pdf->AddPage();
$whereSexe = '';
$whereBassin = '';
$sexe = getVariable('sexe');
if($sexe != ''){
$whereSexe = " nageur.sexe = ".$sexe." ";
}
$bassin = getVariable('bassin');
if($bassin != ''){
$whereBassin = ' A.bassin = "'.$bassin.'m" ';
}
$where = ' ';
if($sexe != '' && $bassin != ''){
$where = $whereSexe." AND ".$whereBassin." AND A.temps > 0 AND ";
}
else if($sexe != ''){
$where = $whereSexe." AND A.temps > 0 AND ";
}
else if($bassin != ''){
$where = $whereBassin." AND A.temps > 0 AND ";
}
if($where == ' '){
$where = "A.temps > 0 AND ";
}
$filtreSexe = '';
if($sexe == 1){
$filtreSexe = 'Garcon';
}
elseif($sexe == 2){
$filtreSexe = 'Fille';
}
echo '<h2>Filtre : '.strtoupper($filtreSexe).'</h2>';
$o_connexionBDD = new connexionBDD();
echo "<table style='width:500px;margin-left : 125px;' cellspacing='0'>";
$req="select distinct categorie
from resultat
order by categorie asc";
$sql = mysql_query($req);
$table_categorie = array();
echo "<tr>";
for($k=0;$k<mysql_num_rows($sql);$k++)
{
$ligne = mysql_fetch_row($sql);
$table_categorie[$k] = $ligne[0];
echo "<td>".$ligne[0]."</td>";
}
echo "</tr>";
$req="select distinct idNage
from resultat
order by idNage asc";
$sql_nage = mysql_query($req);
for($i=0; $i<24; $i++){
$tmp_idnage = mysql_fetch_row($sql_nage);
$tmp_idnage = $tmp_idnage[0];
for($l=0;$l<=count($table_categorie);$l++)
{
//sélection
$requete = "select nageur.nom as nom, nageur.prenom as prenom, A.id as id, A.idNageur as idNageur, A.categorie as categorie, A.idCompetition as idCompetition,
A.idNage as idNage, A.temps as temps, A.place as place, A.bassin as bassin, competition.date, competition.nom as Evenement, piscine.nom as Lieu, piscine.ville, nage.nage as nage
from resultat as A
INNER JOIN nageur ON A.idNageur = nageur.id
INNER JOIN competition On A.idCompetition=competition.id
INNER JOIN piscine On competition.idPiscine=piscine.id
INNER JOIN nage ON A.idNage=nage.id
where ".$where." A.idNage = '".$tmp_idnage."' AND A.place >= 0
AND competition.date >=1283335200
AND competition.date <=1293793200
AND categorie = '".$table_categorie[$l]."'
ORDER BY idNage ASC, temps ASC
LIMIT 0,1";
//competition.date ==> record du 01/09/2010 au 31/12/2010
$sql = mysql_query($requete);
if($sql){
echo "1";
$ligne = mysql_fetch_object($sql);
if($ligne){
$nomCompetition = trim($ligne->Evenement);
$dateCompetition = trim(date('d/m/Y',$ligne->competition.date));
$piscine= trim($ligne->Lieu);
$lieu = trim($ligne->piscine.ville);
$nom= trim($ligne->nom);
$prenom= trim($ligne->prenom);
$temps = '00:00.0';
$minute = 00;
$seconde = 00;
$centieme = 00;
$t = '<tr><td>
<br>
<p style="width:100px;"></p>
<p style="width:100px;">Nom : </p>
<p style="width:200px;" ><strong><a href="index.php?page=nageurs&id='.$ligne['idNageur'].'">'.strtoupper($ligne['nom']).' '.$ligne['prenom'].'</a></strong></p>
<br>
<p style="width:100px;"></p>
<p style="width:100px;background-color : #a0a0a0">Date : </p>
<p style="width:200px;background-color : #a0a0a0">'.$dateCompetition.'</p>
<br>
<p style="width:100px;"></p>
<p style="width:100px;">Temps : </p>
<p style="width:200px;">'.$temps.'</p>
<br>
<p style="width:100px;"></p>
<p style="width:100px;background-color : #a0a0a0">Evenement : </p>
<p style="width:200px;background-color : #a0a0a0">'.$nomCompetition.'</p>
<br>
<p style="width:100px;"></p>
<p style="width:100px;">Piscine : </p>
<p style="width:200px;">'.$piscine.'</p>
<br>
<p style="width:100px;"></p>
<p style="width:100px;background-color : #a0a0a0">Lieu : </p>
<p style="width:200px;background-color : #a0a0a0">'.$lieu.'</p>
<br></td></tr>';
echo $t;
}
}
}
}
echo "</table>";
$o_connexionBDD->fermerConnexion();
?> |
Partager