45 lines
1.5 KiB
PHP
45 lines
1.5 KiB
PHP
<!--
|
|
* nouvelleVisite.php
|
|
-->
|
|
<?php
|
|
include_once("entete.php");
|
|
include_once("modele/accesBDD.php");
|
|
?>
|
|
<h2>Nouvelle visite</h2>
|
|
<form method="POST">
|
|
<label for="listeClient">Sélectionner le client à visiter </label>
|
|
<select name=ldrClient id="listeClient" required>
|
|
<optgroup label="Les clients">
|
|
<?php
|
|
$dbh = connexion();
|
|
$lesClients = rechercherLesClients($dbh);
|
|
while ($unClient = $lesClients->fetch()) { // Lecture 1ère ligne jeu d'enregistrements
|
|
$id = $unClient['id'];
|
|
$lib = $unClient['nom'] . " " . $unClient['prenom'] . ", "
|
|
. $unClient['adresse'] . " " . $unClient['codePostal'] . " " . $unClient['ville'];
|
|
echo "<option value='$id'>$lib</option>";
|
|
$unClient = $lesClients->fetch(); // Lecture suivante
|
|
}
|
|
?>
|
|
</optgroup>
|
|
</select>
|
|
<br /><br />
|
|
<label for="ztDate">Date de la visite </label>
|
|
<input type="date" name="ztDate" id="ztDate" required />
|
|
<label for="ztHeure">Heure de la visite </label>
|
|
<input type="time" name="ztHeure" id="ztHeure" required />
|
|
<br /><br />
|
|
<label for="txtRemarque">Remarque </label>
|
|
<textarea name="txtRemarque" id="txtRemarque"></textarea>
|
|
<br /><br />
|
|
<input type="submit" value="Valider" />
|
|
</form>
|
|
<?php
|
|
if (isset($_GET['msg'])) {
|
|
$message = $_GET['msg'];
|
|
echo "<p>$message</p>";
|
|
}
|
|
?>
|
|
</body>
|
|
</html>
|