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 } }
<title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <script> 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>
<title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link href="./style.css" rel="stylesheet" type="text/css"> </head> <body> <table class="principale"> <tr> <th> <?php if (isset($_POST['login']) && isset($_POST['password'])) { $login = $_POST['login']; $password = $_POST['password']; if ($login == "set" && ($password = "******")) { require_once "bd_utils.php"; $obj_utils = new bd_utils(); $obj_utils->connect(); $obj_utils->setTime(); $time = $obj_utils->getTime(); $obj_utils->close(); echo "La valeur du temp de référence est: " . $time; } ?> <?php } ?> </th> </tr> <tr><th><a href="./index.php?page=inscriptions.php">Retour à l'index</a></th></tr>
<br> <script> function check(id){ document.getElementById(id).checked=!document.getElementById(id).checked; } </script> <?php require_once "bd_utils.php"; require_once "tools.php"; $obj_utils = new bd_utils(); $obj_utils->connect(); $tabRunners = $obj_utils->getAllRunners(); $obj_utils->close(); if ($tabRunners != 0) { ?> <form action="./admin/updateInscription.php" method="post" name="updateInscription"> <table class="principale"> <tr><th colspan="6"><h2>Inscriptions Précédentes</h2></th></tr> <tr><th></th><th>Nom</th><th>Prénom</th><th>Dossard</th><th>Distance</th><th colspan="2">Club</th></tr> <?php for ($i = 0; $i < sizeof($tabRunners); $i++) { ?> <tr class="list" > <td class="listing"> <input id="<?php echo $tabRunners[$i]['id']; ?> " name="toUpdate[]" type="checkbox" value="<?php
<?php require_once "bd_utils.php"; require_once "tools.php"; require_once "queries.php"; $obj_utils = new bd_utils(); $obj_utils->connect(); $tabRequest = $obj_utils->getleftRunners(); listRunnersLeft($tabRequest, "Runners left"); ?> <?php include "footer.php";
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link href="./style.css" rel="stylesheet" type="text/css"> </head> <body> <fieldset><legend>Configuration des distances</legend> <form action="./setDistances.php" method="post" name="form4"> <table class="principale"> <tr> <th colspan="3"><?php if (isset($_POST['login']) && isset($_POST['password'])) { $login = $_POST['login']; $password = $_POST['password']; if ($login == "set" && ($password = "******")) { require_once "bd_utils.php"; $obj_utils = new bd_utils(); $obj_utils->connect(); if (isset($_POST['small']) && isset($_POST['big'])) { $smallDist = $_POST['small']; $bigDist = $_POST['big']; } if ($smallDist > $bigDist) { $temp = $smallDist; $smallDist = $bigDist; $bigDist = $temp; } $obj_utils->setDistances($smallDist, $bigDist); $obj_utils->close(); echo "Les distances courrantes sont " . $smallDist . " & " . $bigDist; } ?>
<?php require_once "bd_utils.php"; require_once "tools.php"; require_once "queries.php"; include "result_header.php"; $queryKey = $_GET['query']; $obj_utils = new bd_utils(); $obj_utils->connect(); $query = getQueryForKey($queryKey); $tabRequest = $obj_utils->executeQuery($query); ?> <br> <h1>Resultats</h1> <?php listQuery($tabRequest, "Résultats");
<table> <tr> <?php require_once "bd_utils.php"; $obj_utils = new bd_utils(); $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 require_once "../tools.php"; require_once "../bd_utils.php"; if (isset($_POST['toUpdate'])) { $obj_utils = new bd_utils(); $obj_utils->connect(); $ids = $_POST['idListing']; $toUpdate = $_POST['toUpdate']; $nom = $_POST['nom']; $prenom = $_POST['prenom']; $dossard = $_POST['dossard']; $distance = $_POST['distance']; $club = $_POST['club']; $separator = ","; $br = "<br>"; $cpt = ""; for ($i = 0; $i < sizeof($toUpdate); $i++) { for ($j = 0; $j < sizeof($ids); $j++) { if ($ids[$j] == $toUpdate[$i]) { $cpt[$i] = $j; } } } for ($i = 0; $i < sizeof($cpt); $i++) { $indice = $cpt[$i]; $currentIds = $ids[$indice]; $currentNom = $nom[$indice]; $currentPrenom = $prenom[$indice]; $currentDossard = $dossard[$indice]; $currentDistance = $distance[$indice];
} --> </style> <script> </script> </head> <body> <?php require_once "bd_utils.php"; require_once "tools.php"; $obj_utils = new bd_utils(); $obj_utils->connect(); if (isset($_POST['nom']) && isset($_POST['prenom']) && isset($_POST['sexe']) && isset($_POST['dossard'])) { $date = $_POST['y'] . $_POST['m'] . $_POST['d']; $club = ""; $distance = $_POST['distance']; $obj_utils->saveRunner($_POST['nom'], $_POST['prenom'], $date, $_POST['sexe'], $_POST['dossard'], $club, $distance); } ?> <h1>Inscriptions</h1> <form action="./index.php?page=inscriptions.php" method="post"> <br> <a href="#" onClick="closeSearch();">close Suggest</a> <table class="principale"> <tr> <td class="style1"><strong>Nom: </strong></td>
<title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link href="./style.css" rel="stylesheet" type="text/css"> </head> <body> <table class="principale"> <tr> <th> <?php if (isset($_POST['login']) && isset($_POST['password'])) { $login = $_POST['login']; $password = $_POST['password']; if ($login == "reset" && ($password = "******")) { require_once "bd_utils.php"; $obj_utils = new bd_utils(); $obj_utils->connect(); $obj_utils->resetDB(); $obj_utils->close(); echo "La base de donnée a été réinitialisée"; } ?> <?php } ?> </th> </tr> <tr><th><a href="./index.php?page=inscriptions.php">Retour à l'index</a></th></tr> </table>