formulaireTraitement.php 1.87 KB
Newer Older
Gaetan Carabetta's avatar
Gaetan Carabetta committed
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
<html>
<head>
  <title>Clinique Vétérinaire</title>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <link rel="stylesheet" type="text/css" href="style.css">
  </head>
<body>
  <h1>Ajout d'un Traitement</h1>
  <?php
  // Connexion à la base de données
    include("connexion.php");
    $vConn = new PDO("pgsql:host=$vHost;port=$vPort;dbname=$vData", $vUser, $vPass);
  ?>
  <div>
    <form  action="addTraitement.php" method="post">
      <p>Animal:
        <select name="animal" required/>
        <?php
            $vSql ='select idAnimal from Animal;';
            $vSt = $vConn->prepare($vSql);
            $vSt->execute();
            while ($vResult = $vSt->fetch(PDO::FETCH_BOTH)) {
              echo "<option>$vResult[0]</option>";
            }
        ?>
       </select>
      </p>
       <p>ID Vétérinaire:
         <select name="veterinaire" required/>
         <?php
             $vSql ='select idVeterinaire from Veterinaire;';
             $vSt = $vConn->prepare($vSql);
             $vSt->execute();
             while ($vResult = $vSt->fetch(PDO::FETCH_BOTH)) {
               echo "<option>$vResult[0]</option>";
             }
         ?>
        </select>
       </p>
       <p>Médicament:
         <select name="medicament" required/>
         <?php
             $vSql ='select nomMolec from Medicament;';
             $vSt = $vConn->prepare($vSql);
             $vSt->execute();
             while ($vResult = $vSt->fetch(PDO::FETCH_BOTH)) {
               echo "<option>$vResult[0]</option>";
             }
         ?>
        </select>
       </p>
       <p>Date de debut: <input type="date" name="ddebut" required/></p>
       <p>Durée: <input type="number" name="duree" required/></p>
       <p>Quantité par jour: <input type="number" name="qteJour" required/></p>
       <p><input type="submit" value="OK"></p>
    </form>
  </div>
</body>
</html>