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 64 65 66 67 68
| <form id="form1" name="form1" method="post" action="update.php">
<button type="submit" value="envoyer" />
<table width="100%" class="resultats">
<tr>
<th width="17%" class="resultats" scope="col">Nom</th>
<th width="14%" scope="col">Prénom</th>
<th width="7%" scope="col">Classe</th>
<th width="13%" scope="col">Date de naissance</th>
<th width="7%" scope="col">Inscription</th>
<th width="18%" scope="col">N° élève</th>
<th width="24%" scope="col">Remarques</th>
</tr>
<?php
// Connexion
require_once('login.php');
// Variables
$nom = $_POST['nom'];
$prenom = $_POST['prenom'];
$classe = $_POST['classe'];
// On se connecte à la base
$connexion = mysql_connect("$host_bdd", "$user_bdd", "$pass_bdd");
mysql_select_db("$bdd");
// On effectue la recherche de l'élève
mysql_query("SET NAMES UTF8");
$sql = "SELECT * FROM eleves WHERE nom LIKE '".$nom."%' AND prenom LIKE '".$prenom."%' AND classe LIKE '".$classe."%'";
$requete = mysql_query($sql,$connexion);
mysql_close();
// On affiche les résultats
while ($resultats = mysql_fetch_array($requete))
{
if ($resultats['nom'] == NULL)
{
echo "Erreur";
}
else
{
?>
<tr>
<td class="resultats"><?php echo $resultats['nom'] ?></td>
<td><?php echo $resultats['prenom'] ?></td>
<td><?php echo $resultats['classe'] ?></td>
<td><?php echo $resultats['naissance'] ?></td>
<td><label>
<input name="inscrit" type="checkbox" id="inscrit" value="1" <?php if ($resultats['inscrit']=="1") {echo "checked=\"checked\"";} ?> />
</label>
<input name="id" type="hidden" id="id" value="<?php echo $resultats['id'] ?>" /></td>
<td><label>
<input name="no_eleve" type="text" class="no_eleve" id="no_eleve" value="<?php echo $resultats['no_eleve'] ?>" size="13" maxlength="7" />
</label></td>
<td><label>
<textarea name="remarques" cols="45" rows="5" class="remarques_results" id="remarques"><?php echo stripslashes($resultats['remarques']) ?></textarea>
</label></td>
</tr>
<?php
}
} //on ferme while
?>
</table>
</form> |
Partager