-
Notifications
You must be signed in to change notification settings - Fork 0
/
logement.php
executable file
·173 lines (119 loc) · 6.94 KB
/
logement.php
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
<?php
require_once("config.php");
$q=$bdd->query("SELECT * FROM logements ORDER BY id desc");
$ligne = $q-> fetch();
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Home Switch Home</title>
<link href="http://fonts.googleapis.com/css?family=Oxygen:400,700,300" rel="stylesheet" />
<link href="style.css" rel="stylesheet" />
<script language="javascript">
function confirme( identifiantLogement ){
var confirmation = confirm( "Voulez vous vraiment supprimer cette annonce ?" ) ;
if( confirmation ){
document.location.href = "confirmSuppr.php?idlog="+identifiantLogement ;
}
}
</script>
</head>
<body>
<div id="wrapper">
<?php include("header.php"); ?>
<div id="logements">
<?php $sql = $bdd->query("SELECT count(*) as nb from logements");
$data = $sql->fetch();
$nb = $data['nb'];?>
<?php
$i = 0;
while ($i < $nb){
?>
<div id="three-column" class="container">
<?php if($i < $nb) {?><div class="tbox1">
<div class="box-style box-style01">
<?php if (isadmin()) { ?>
<a href="" onClick="confirme(<?php echo($ligne['id']);?>)"><img src="cross.svg" width="15px" height="15px" class="boutonsuppr"></a><?php } ?>
<div class="content">
<div class="image"><img src="img/<?php echo($ligne['id']);?>/1.jpg" width="324" height="200" alt="" /></div>
<h2><?php echo ($ligne['titre_annonce']);?></h2>
<p><?php echo ($ligne['description']);?></p>
<a href="page-logement.php?idLogement=<?php echo($ligne['id']);?>" class="button">Plus d'informations</a>
<?php $ligne = $q-> fetch();?>
</div>
</div>
<?php } ?>
</div><?php $i++ ?>
<?php if($i < $nb) {?><div class="tbox2">
<div class="box-style box-style02">
<?php if (isadmin()) { ?>
<a href="" onClick="confirme(<?php echo($ligne['id']);?>)"><img src="cross.svg" width="15px" height="15px" class="boutonsuppr"></a><?php } ?>
<div class="content">
<div class="image"><img src="img/<?php echo($ligne['id']);?>/1.jpg" width="324" height="200" alt="" /></div>
<h2><?php echo ($ligne['titre_annonce']);?></h2>
<p><?php echo ($ligne['description']);?></p>
<a href="page-logement.php?idLogement=<?php echo($ligne['id']);?>" class="button">Plus d'informations</a>
<?php $ligne = $q-> fetch();?>
</div>
</div>
<?php }?>
</div><?php $i++ ?>
<?php if($i < $nb) {?><div class="tbox3">
<div class="box-style box-style03">
<?php if (isadmin()) { ?>
<a href="" onClick="confirme(<?php echo($ligne['id']);?>)"><img src="cross.svg" width="15px" height="15px" class="boutonsuppr"></a><?php } ?>
<div class="content">
<div class="image"><img src="img/<?php echo($ligne['id']);?>/1.jpg" width="324" height="200" alt="" /></div>
<h2><?php echo ($ligne['titre_annonce']);?></h2>
<p><?php echo ($ligne['description']);?></p>
<a href="page-logement.php?idLogement=<?php echo($ligne['id']);?>" class="button">Plus d'informations</a>
<?php $ligne = $q-> fetch();?>
</div>
</div>
</div>
<?php }?>
</div><?php $i++ ?>
<?php } ?>
<!--<div id="three-column" class="container">
<div class="tbox1">
<div class="box-style box-style01">
<div class="content">
<?php $ligne = $q-> fetch();?>
<div class="image"><img src="images/maison1.jpg" width="324" height="200" alt="" /></div>
<h2><?php echo ($ligne['titre_annonce']);?></h2>
<p><?php echo ($ligne['description']);?></p>
<a href="page-logement.php?idLogement=<?php echo($ligne['id']);?>" class="button">Plus d'informations</a>
</div>
</div>
</div>
<div class="tbox2">
<div class="box-style box-style02">
<div class="content">
<div class="image"><img src="images/maison1.jpg" width="324" height="200" alt="" /></div>
<?php $ligne = $q-> fetch();?>
<h2><?php echo ($ligne['titre_annonce']);?></h2>
<p><?php echo ($ligne['description']);?></p>
<a href="page-logement.php?idLogement=<?php echo($ligne['id']);?>" class="button">Plus d'informations</a>
</div>
</div>
</div>
<div class="tbox3">
<div class="box-style box-style03">
<div class="content">
<?php $ligne = $q-> fetch();?>
<div class="image"><img src="images/maison1.jpg" width="324" height="200" alt="" /></div>
<h2><?php echo ($ligne['titre_annonce']);?></h2>
<p><?php echo ($ligne['description']);?></p>
<a href="page-logement.php?idLogement=<?php echo($ligne['id']);?>" class="button">Plus d'informations</a>
</div>
</div>
</div>
</div>
-->
</div>
</div>
</div>
<?php include("footer.php"); ?>
</body>
</html>