voirClients.php 1.12 KB
Newer Older
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
<html>
  <head> <title> Voir à tous les clients </title> </head>
  <body>
      	<button onclick="location.href='ajouterClient.html'">Add </button>
	<table border = "1">
	      <tr>
	        <th> id </th>
	        <th> nom </th>
	        <th> prenom </th>
	        <th> ddn </th>
	        <th> adresse </th>
	        <th> numero </th>
	      </tr>
	      <?php
	        $vHost = 'tuxa.sme.utc';
	        $vPort = '5432';
	        $vData = 'dbbdd0p020';
	        $vUser = 'bdd0p020';
	        $vPass = 'uLd6pAgM';
       		$vConn = new PDO("pgsql:host=$vHost;port=$vPort;dbname=$cData", $vUser, $vPass);

	        $vSql ='SELECT * FROM client';
	        $vSt = $vConn->prepare($vSql);
	        $vSt->execute();
	        while ($vResult = $vSt->fetch(PDO::FETCH_ASSOC)) 
		{
	          echo '<tr>';
	          echo "<td>$vResult[idClient]</td>";
	          echo "<td>$vResult[nom]</td>";
	          echo "<td>$vResult[prenom]</td>";
	          echo "<td>$vResult[ddn]</td>";
	          echo "<td>$vResult[adresse]</td>";
	          echo "<td>$vResult[numero]</td>";
	          echo '</tr>';
	        }
       ?>
    </table>
	
  </body>
</html>