Commit 03835a3a authored by JonathanMM's avatar JonathanMM

Ajout d'un selecteur rapide de commune

parent 9a37ad8c
......@@ -24,6 +24,14 @@ $smarty->assign(array(
'dateDerniereConso' => (new DateTime($conso['date']))->format('d/m/Y à H:i')
));
//On récupère les communes
$requete = $pdo->query('SELECT insee, nom_complet FROM commune');
$communes = $requete->fetchAll(PDO::FETCH_ASSOC);
$smarty->assign(array(
'communes' => $communes
));
$smarty->display('index.tpl');
exit();
?>
......@@ -29,6 +29,15 @@
</tr>
</table>
<i>Dernière mise à jour : {$dateDerniereConso}</i>
<form method="GET" action="commune.php">
<label for="insee">Filtrer par commune :</label>
<select name="insee">
{foreach $communes as $commune}
<option value="{$commune.insee}">{$commune.nom_complet}</option>
{/foreach}
</select>
<input type="submit" value="Filtrer" />
</form>
</div>
<div id="carteArea"></div>
</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment