assistants.php 1.3 KB
Newer Older
Osvaldo Valdivia Salas's avatar
Osvaldo Valdivia Salas committed
1
2
<html>
<head>
Gaetan Carabetta's avatar
Gaetan Carabetta committed
3
  <title>Clinique Vétérinaire</title>
Osvaldo Valdivia Salas's avatar
Osvaldo Valdivia Salas committed
4
5
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <link rel="stylesheet" type="text/css" href="style.css">
Gaetan Carabetta's avatar
Gaetan Carabetta committed
6
</head>
Osvaldo Valdivia Salas's avatar
Osvaldo Valdivia Salas committed
7
<body>
Gaetan Carabetta's avatar
Gaetan Carabetta committed
8
  <h1>Information sur les assitants</h1>
Osvaldo Valdivia Salas's avatar
Osvaldo Valdivia Salas committed
9
10
  <table border="1">
    <tr>
Gaetan Carabetta's avatar
Gaetan Carabetta committed
11
      <th>idAssistant</th>
Osvaldo Valdivia Salas's avatar
Osvaldo Valdivia Salas committed
12
      <th>Nom</th>
Gaetan Carabetta's avatar
Gaetan Carabetta committed
13
14
15
16
17
      <th>Prenom</th>
      <th>Date de naissance</th>
      <th>Adresse</th>
      <th>Numéro</th>
      <th>Spécialité</th>
Osvaldo Valdivia Salas's avatar
Osvaldo Valdivia Salas committed
18
19
20
    </tr>
    <?php
    // Connexion à la base de données
Gaetan Carabetta's avatar
Gaetan Carabetta committed
21
    include("connexion.php");
Osvaldo Valdivia Salas's avatar
Osvaldo Valdivia Salas committed
22
23
24
25

    try{
      $vConn = new PDO("pgsql:host=$vHost;port=$vPort;dbname=$vData", $vUser, $vPass);
    } catch(PDOException $e){
Gaetan Carabetta's avatar
Gaetan Carabetta committed
26
      echo "Erreur de connexion '$e'";
Osvaldo Valdivia Salas's avatar
Osvaldo Valdivia Salas committed
27
28
29
    }

    // Affichage du tableau de données
Gaetan Carabetta's avatar
Gaetan Carabetta committed
30
    $vSql = "select * from assistant";
Osvaldo Valdivia Salas's avatar
Osvaldo Valdivia Salas committed
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
    try{
      $vSt = $vConn->prepare($vSql);
      $vSt->execute();

      while ($vResult = $vSt->fetch(PDO::FETCH_BOTH)) {
        echo '<tr>';
        echo "<td>$vResult[0]</td>";
        echo "<td>$vResult[1]</td>";
        echo "<td>$vResult[2]</td>";
        echo "<td>$vResult[3]</td>";
        echo "<td>$vResult[4]</td>";
        echo "<td>$vResult[5]</td>";
        echo "<td>$vResult[6]</td>";
        echo '</tr>';
      }

    } catch(PDOException $e){
      echo "Erreur de requete '$e'";
    }
    ?>

  </table>
</body>
</html>