<div class="home">
    <div id="Home_title">Gestion des marques de véhicules</div>
        <form id="connexion" method = "POST" action="index.php?uc=marque&action=ajouter">Ajouter une nouvelle marque <input type="submit" src="includes/img/plus.png" value="+"></form>
        <br>
    <table class="table table-striped">   
        <tr>
            <th>Libellé</th>
            <th></th>
            <th></th>
        </tr>
        <?php
        $cpt = 1;
        foreach ($lesMarques as $laMarque) {
            echo '<tr>';
            if(isset($_REQUEST['action']) && ($_REQUEST ['action'] == 'modifier') && isset($_REQUEST['id']) && ($_REQUEST['id'] == $laMarque['mq_id']))
            {
               echo'<form method="POST" action="index.php?uc=marque&action=validMotif"> <td> <input type="hidden" name="id" value="'.$_REQUEST['id'].'"> <input type="text" id="marqueLibelle" name="marquelibelle" placeHolder="Libelle de la marque"> <input type="submit" value="valider"</td></form>'
               .'<td></td>';
            }
            else
            {
                echo '<td>' . $laMarque['mq_libelle'] . '</td>'
                . '<td> <form method="POST" action="index.php?uc=marque&action=modifier"><input type="hidden" name="id" value="'.$laMarque['mq_id'].'"> <input type="submit" value="modifier"></form></td>'
                . '<td> <form method="POST" action="index.php?uc=marque&action=supprimer"><input type="hidden" name="id" value="'.$laMarque['mq_id'].'"> <input type="submit" value="supprimer"></form></td>'
                . '</tr>';
            }
        }
        ?>
    </table>  