function getQueryForKey($queryKey) { require_once "bd_utils.php"; $obj_utils = new bd_utils(); $obj_utils->connect(); switch ($queryKey) { case "general5": $query = "select * from runner join resultats on runner.id=FK_runner where distance='" . $obj_utils->getSmalDistance() . "' order by temp"; break; case "man5": $query = "select * from runner join resultats on runner.id=FK_runner where sexe='M' AND distance='" . $obj_utils->getSmalDistance() . "' order by temp"; break; case "woman5": $query = "select * from runner join resultats on runner.id=FK_runner where sexe='F' AND distance='" . $obj_utils->getSmalDistance() . "' order by temp"; break; case "general10": $query = "select * from runner join resultats on runner.id=FK_runner where distance='" . $obj_utils->getBigDistance() . "' order by temp"; break; case "man10": $query = "select * from runner join resultats on runner.id=FK_runner where sexe='M' AND distance='" . $obj_utils->getBigDistance() . "' order by temp"; break; case "woman10": $query = "select * from runner join resultats on runner.id=FK_runner where sexe='F' AND distance='" . $obj_utils->getBigDistance() . "' order by temp"; break; case "runnersAll": $query = "select id from runner"; break; case "runnersDone": $query = "select FK_runner from resultats"; break; } return $query; $obj_utils->close(); }
$obj_utils->connect(); ?> <th><a href="./index.php?page=result.php&query=general5">Résultats général <?php echo $obj_utils->getSmalDistance(); ?> </a></th> <th><a href="./index.php?page=result.php&query=man5">Résultats masculin <?php echo $obj_utils->getSmalDistance(); ?> </a></th> <th><a href="./index.php?page=result.php&query=woman5">Résultats féminin <?php echo $obj_utils->getSmalDistance(); ?> </a></th> <th><a href="./index.php?page=result.php&query=general10">Résultats général <?php echo $obj_utils->getBigDistance(); ?> </a></th> <th><a href="./index.php?page=result.php&query=man10">Résultats masculin <?php echo $obj_utils->getBigDistance(); ?> </a></th> <th><a href="./index.php?page=result.php&query=woman10">Résultats féminin <?php echo $obj_utils->getBigDistance(); ?> </a></th> <?php $obj_utils->close(); ?> </tr> </table>