-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdetailbien.php
68 lines (60 loc) · 1.99 KB
/
detailbien.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
<form method="post" action="index.php?p=detailbien">
<?php
if (isset($_GET['idbien']))
{
$req = mysql_query("SELECT b.idbien, b.titrebien, b.detailbien, b.adrbien, b.prixbien, t.nomtype, b.photobien FROM bien b, typebien t
WHERE b.idtype=t.idtype AND b.idbien = '" .$_GET['idbien']. "'
group by 1 ");
if (($donnees = mysql_fetch_array($req)))
{
$req2 = mysql_query("SELECT count(v.idbien) from visiter v where v.idbien = '" .$_GET['idbien']. "' group by 1");
?>
<table>
<caption><?php
if ($req2 == 0)
{echo ("Personne n'a encore visité ce bien !");}
else if ($req2 >0)
{ echo ("Il y a '".$req2."' personnes qui veulent visiter ce bien."); } ?>
</caption>
<tr>
<td>Nom du bien</td>
<td>Detail bien</td>
<td>Adresse</td>
<td>Type</td>
<td>Photo</td>
<td>Prix</td><?php
}?>
</tr>
<tr>
<td><?php echo $donnees['titrebien']; ?></td>
<td><?php echo $donnees['detailbien'] ?></td>
<td><?php echo $donnees['adrbien'] ?></td>
<td><?php echo $donnees['nomtype'] ?></td>
<td><a href="index.php?p=detailbien&idbien=<?php echo $donnees['idbien'];?>"><img src="images//<?php echo $donnees['photobien']; ?>"></a></td>
<td><?php echo $donnees['prixbien'] ?></td>
</tr>
</table>
<table>
<tr>
<?php $req = mysql_query("SELECT b.photobien, b.idbien, b.titrebien FROM bien b WHERE b.idbien in (SELECT idbien2 FROM ressembler WHERE idbien1 = '" .$_GET['idbien']. "')");
$images=mysql_fetch_array($req);
if (empty($images)){
echo("Aucun bien ne lui ressemble...");
}else{
?><caption> Ces biens lui ressemble : </caption><?php
while ($images=mysql_fetch_array($req))
{ ?>
<td><?php echo $donnees['titrebien']; ?></td>
<td><a href="index.php?p=detailbien&idbien=<?php echo $images['idbien'];?>"><img src="images/<?php echo $images['photobien']; ?>"></a></td> <?php
}
} ?>
</tr>
</table>
<?php
}
else
{
echo "Erreur aucun bien selectionne";
}
?>
</form>