<?php 
if(!isset($_SESSION['tl_login'])){
    echo '<div class = "authen">
    <form name="authentif" method= "POST" action = "index.php?uc=authentification">
        
        <input type= text name="Login">
        <input type= text name="mdp">
        <button type=submit>OK <button/>
    </form>
    </div>';
}
?>
<div class="home">
    <div id="Home_title">Liste de tous les véhicules</div>
    <table class="table table-striped">   
        <tr>
            <th>N°</th>
            <th>Marque</th>
            <th>Modèle</th>  
            <th>Km</th>
            <th>Prix</th>
        </tr>
        <?php
        $compteur=0;
        $lesVehicules= getLesVehicules();
        foreach ($lesVehicules as $leVehicule) {
            $compteur++;
            echo '<tr>'
            . '<td><a href= index.php?uc=accueil&action=detail&id='.$leVehicule['vh_id'].'>'.$compteur.' </td>'
            . '<td>' . $leVehicule['mq_libelle'] . '</td>'
            . '<td>' . $leVehicule['md_libelle'] . '</td>'
            . '<td>' . $leVehicule['vh_km'] . '</td>'
            . '<td>' . number_format($leVehicule['vh_prix'], 2, ',', ' ') . ' €</td>'
            . '</tr>';
        }
        ?>
    </table>
</div>';

