1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
|
<script language="javascript">
function toutcocher()
{
var valeur=document.getElementById("allsuppr").checked;
for(i=0;i<document.forms['formAdminGestUser'].length;i++)
{
if(document.forms['formAdminGestUser'].elements[i].type=="checkbox")
document.forms['formAdminGestUser'].elements[i].checked=valeur;
}
}
</script>
<?php
if(!defined('IN_INDEX')){
exit();
}
$_SESSION['action']="module/administration/action.php";
echo'
<form method="post" id="formAdminGestUser">
<table border="3">
<caption>Liste des utilisateurs</caption>
<tr align="center" height="40">
<th><input id="allsuppr" type="checkbox" name="allsuppr" onclick="toutcocher();" value="'.$ligne->id.'"</th>
<th>Login</th>
<th>Nom</th>
<th>Prénom</th>
<th>Profil</th>
<th>Mail</th>
<th>Rue</th>
<th>Code Postal</th>
<th>Ville</th>
<th>Téléphone Fixe</th>
<th>Téléphone Portable</th>
</tr>';
$resultats=$connexion->query('SELECT id,login,nom,prenom,profil,mail,rue,cp,ville,tel_fixe,tel_portable FROM collaborateur ORDER BY id'); // on va chercher tous les membres de la table
while( $ligne = $resultats->fetch(PDO::FETCH_OBJ) ) // on récupère la liste des membres
{
echo '<tr align="center" height="40">';
echo '<td><input type="checkbox" name="check[]" value="'.$ligne->id .'"</td>'; //cela va permettre de pouvoir supprimer
echo '<td>'.$ligne->login.'</td>';
echo '<td>'.$ligne->nom.'</td/>';
echo '<td>'.$ligne->prenom.'</td>';
echo '<td>'.$ligne->profil.'</td>';
echo '<td>'.$ligne->mail.'</td>';
echo '<td>'.$ligne->rue.'</td>';
echo '<td>'.$ligne->cp.'</td>';
echo '<td>'.$ligne->ville.'</td>';
echo '<td>'.$ligne->tel_fixe.'</td>';
echo '<td>'.$ligne->tel_portable.'</td>';
echo '</tr>';
}
$resultats->closeCursor(); // on ferme le curseur des résultats
echo "</table>";
?>
<br/>
<input type="submit" value="Ajouter un utilisateur" name="gesAjou"> |
Partager