DEL Old file.
[appart.git] / list.php
1 <?php
2 header('Content-Type: text/html; charset=UTF-8');
3 echo '<?xml version="1.0" encoding="UTF-8" ?>';
4 require('debug.inc');
5 require ('constantes.php');
6
7 $dbconn = pg_connect("host=localhost dbname=".$BD." user=appart password=soleil") or die('Connexion impossible : ' . pg_last_error());
8 pg_query("SET datestyle = 'SQL, DMY';");
9
10 $inputs;
11 $erreur;
12 $action;
13 require ('traitement_inputs.php');
14
15 ?>
16
17 <html>
18 <head>
19 <title>Appart</title>
20 <link rel="stylesheet" href="style.css" type="text/css" />
21 <script type="text/javascript" src="script.js" ></script>
22 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
23 <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
24 <title>Google Maps JavaScript API Example</title>
25 <script src="http://maps.google.com/maps?file=api&amp;v=2.82&amp;key=ABQIAAAAQLBohykzX4xiepOOUu21GhS2JkdUHwPLqAOasxCB2_i_UFsNUhRbVpRM0k1S9wDSYhOD8Hj8bGnqag" type="text/javascript"></script>
26 </head>
27 <body onload="rafraichirFormulaire(); loadGMap()" onunload="GUnload()">
28 <?php
29 if (isset($erreur) && $erreur != '')
30 {
31 echo '<div id="erreur" >' . utf8_encode($erreur) . '</div>';
32 }
33 ?>
34
35
36 <div id="menus">
37 <div class="amenu" id="appartements" >
38 <h1><a href="?">Appartements</a></h1>
39 <a href="index.php">detail</a> <a href="list.php">liste</a>
40 </div>
41
42 <div id="liste" >
43 <table>
44 <tr>
45 <td style="font-weight:bold">id</td>
46 <td style="font-weight:bold">rue</td>
47 <td style="font-weight:bold">prix</td>
48 <td style="font-weight:bold">pièce</td>
49 <td style="font-weight:bold">contact</td>
50 <td style="font-weight:bold">date visite</td>
51 </tr>
52 <?php
53 $appartData;
54 $statutPrec = "nawak";
55 $result = pg_query("SELECT * FROM appart ORDER BY statut, id");
56 while ($appartData = pg_fetch_array($result, null, PGSQL_ASSOC))
57 {
58 if ($appartData['statut'] != $statutPrec)
59 {
60 echo '<tr><td class="statut" colspan="6">' . $statuts[$appartData['statut']] . '</td></tr>';
61 $statutPrec = $appartData['statut'];
62 }
63
64 echo "<tr class=\"statut".$appartData['statut'] ."\">";
65 echo "<td><a style=\"display:block\" href=\"index.php?action=voir&id=".$appartData['id']."\">&nbsp;".$appartData['id']."</a></td>";
66 echo "<td>&nbsp;".$appartData['rue']."<br><small>etage: " .$appartData['etage'] ."</small></td>";
67 echo "<td>&nbsp;".($appartData['prix'] + $appartData['prixcharges'])."<br><small>" .$appartData['prix'] ."+". $appartData['prixcharges'] . "</small></td>";
68 echo "<td>&nbsp;".$appartData['nbpiece']."</td>";
69 echo "<td>&nbsp;".$appartData['contact']."</td>";
70 echo "<td>&nbsp;".$appartData['date_visite']."</td>";
71 echo "</tr>";
72 }
73 ?>
74 </table>
75
76 <?php
77 pg_free_result($result);
78 ?>
79 </div>
80
81 </body>
82 </html>
83
84 <?php
85 pg_close($dbconn);
86 ?>