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(); }
function listRunnersLeft($tabRunners, $title) { if ($tabRunners != 0) { require_once "bd_utils.php"; $obj_utils = new bd_utils(); $obj_utils->connect(); $time = $obj_utils->getTime(); $obj_utils->close(); ?> <table class="principale"> <tr><th colspan="8"><h2><?php echo $title; ?> </h2></th></tr> <tr><th>Num</th><th>Nom</th><th>Prénom</th><th>Dossard</th><th>distance</th><th>Club</th></tr> <?php for ($i = 0; $i < sizeof($tabRunners); $i++) { $j = $i + 1; ?> <tr class="list"> <td class="listing"><?php echo $j; ?> </td> <td class="listing"><?php echo $tabRunners[$i]['nom']; ?> </td> <td class="listing"><?php echo $tabRunners[$i]['prenom']; ?> </td> <td class="listing" align="center"><?php echo $tabRunners[$i]['dossard']; ?> </td> <td class="listing" align="center"><?php echo $tabRunners[$i]['distance']; ?> </td> <td class="listing" align="center"><?php echo $tabRunners[$i]['club']; ?> </td> </tr> <?php } ?> </table> <?php } }
function setFocus(){ document.forms['form1'].elements['dossard'].focus(); } </script> </head> <body onLoad="setFocus()"> <?php require_once "tools.php"; $dossard = 0; if (isset($_POST['dossard'])) { require_once "bd_utils.php"; $obj_utils = new bd_utils(); $obj_utils->connect(); $dossard = $obj_utils->setRunner($_POST['dossard']); $obj_utils->close(); } ?> <h1>Arrivée</h1> <form name="form1" method="post" action="./index.php?page=timer.php" autocomplete="off" > <table class="principale"> <tr> <td class="style1"><strong>Numéro de dossard: </strong></td> <td> <input type="text" name="dossard"></td> <td><input type="submit" name="Submit" value="Submit"></td> </tr> <tr> <td nowrap style="width:250; text-align:right; "><br>Last: <?php if ($dossard != 0) {