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
| <?php
$bdd->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_ASSOC);
$req = $bdd->query("SELECT * FROM etudiant");
//$req->execute();
$result = $req->fetchAll();
$i=0;
?>
</head>
<body>
<h1 align="center">Liste des étudiants </h1>
<form>
<table width="1024" border="1">
<tr>
<td align="center">Numéro</td>
<td align="center">Nom</td>
<td align="center">Prénom</td>
<td align="center">Date de naissance</td>
<td align="center">Niveau</td>
<td align="center">Année universitaire</td>
<td align="center">Tranche 1</td>
<td align="center">Tranche 2</td>
<td align="center">Assiduité</td>
<td align="center">Email</td>
<td align="center">Contact</td>
<td align="center">Option</td>
</tr>
<?php
foreach ($result as $u){
$i=0;
?>
<tr>
<td align="center"><?php echo $u['numero']?><input type="hidden" name="<?php echo "id".$i?>" value="<?php echo $u['numero']?>"/></td>
<td align="center"><?php echo $u['nom']?></td>
<td align="center"><?php echo $u['prenom']?></td>
<td align="center"><?php echo $u['datenaiss']?></td>
<td align="center"><?php echo $u['niveau']?></td>
<td align="center"><?php echo $u['anneeuniv']?></td>
<td align="center"><?php echo $u['sem1']?></td>
<td align="center"><?php echo $u['sem2']?></td>
<td align="center"><?php echo $u['assiduite']?></td>
<td align="center"><?php echo $u['mail']?></td>
<td align="center"><?php echo $u['contact']?></td>
<td align="center"><input type="checkbox" name="<?php echo "cb".$i?>" /></td>
</tr>
<?php
}
?>
</table>
<input type="button" value="Modifier" onclick="javascript:modifierEtudiant(<?php echo $i?>)"/>
</form> |
Partager