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
| <tr>
<td bgcolor ="white" align="center" width ="20%" class ="tx4" > <?php echo $row ['CD_NOM' ] ; ?> </td>
<td bgcolor ="white" align="center" width ="20%" class ="tx4" > <?php echo $row ['CD_PRENOM' ] ; ?> </td>
<?php
$conn = mysqli_connect("localhost","root","","emak");
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
if(isset($_POST['appel'])){
$req = $conn->prepare('INSERT INTO tableau_journalier(CD_PRESENT, CD_NOM, CD_PRENOM, HEURE_COURS, DF_CLASSE) VALUES(?, ?, ?, ?, ?)');
$req->bind_param(
'sssss',
$_POST['appel'],
$_POST['CD_NOM'],
$_POST['CD_PRENOM'],
$_POST['HEURE_COURS'],
$_POST['DF_CLASSE']
);
if($req->execute()) { // execute() répond true/false
echo " La requête fonctionne ! ";
} else {
echo "Echec lors de l'exécution de la multi-requête : (" . $req->errno . ") " . $req->error;
}
}
elseif(!isset($_POST['appel'])){
echo 'Vous n\'avez rien selectionné ';
}
?>
<td bgcolor ="white" align="center" width ="20%" class ="tx4" >
<form method="post" action="rolecontents.php">
<p>
<input type="radio" name="appel" value='P' id="P" /> <label for="P">Présent</label><br />
<input type="radio" name="appel" value='A' id="A" /> <label for="A">Absent</label><br />
</p>
<input type="submit" name="submit" value="Envoyer" />
</form>
</td>
<td bgcolor ="white" align="center" width ="20%" class ="tx4" > <?php echo $row ['HEURE_COURS' ] ; ?> </td>
<td bgcolor ="white" align="center" width ="20%" class ="tx4" > <?php echo $row ['DF_CLASSE' ] ; ?> </td> |
Partager