par
starTing » 04 oct. 2006, 11:40
Bonjour, j'ai un grand problème dans mon formulaire de recherche avancée, je voulais faire 2 listes déroulantes qui seront liées l'une à l'autre ( pays et villes ), et d'autre listes déroulantes non liées avec un botons Recherche, le problème c'est que dès que je choisit le pays, ça me donne les résulats associés à ce pays sans pouvoir choisir la ville ni les autres options ( nb pieces, ventes ... ), donc elle envoie directement la page "result1.php"
je vous passe mon code :
<?php
echo("<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n");
$serveur = "localhost";
$admin = "root";
$mdp = "";
$base = "mabase";
$idr = isset($_POST['pays_combo'])?$_POST['pays_combo']:null;
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- saved from url=(0014)about:internet -->
<html>
<head>
<link href="style.css" rel="stylesheet" type="text/css">
<title>:: LACENTRALE IMMOBILIERE ::</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<!--Fireworks 8 Dreamweaver 8 target. Created Mon Oct 31 13:28:32 GMT+0000 (Greenwich) 2005-->
<style type="text/css">
<!--
body {
background-color: #F49902;
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
.style2 {FONT-FAMILY:Tahoma; COLOR: #ECC600; font-size: 11px;}
.style1 {color: #FFFFFF}
-->
</style></head>
<body>
<?
include("gestion/config.php");
//$query = "SELECT * FROM visites";
//$result = mysql_query($query);
//$row = mysql_fetch_array($result);
//$NbrVisites = $row[NbrVisites] + 1;
//$query2 = "UPDATE visites SET NbrVisites='$NbrVisites' WHERE id=1";
//mysql_query($query2) or die ("Erreur SQL");
?>
<table width="785" border="0" align="center" cellpadding="0" cellspacing="0">
<!-- fwtable fwsrc="charte1.png" fwbase="index.jpg" fwstyle="Dreamweaver" fwdocid = "742308039" fwnested="0" -->
<tr>
<td><img src="images/spacer.gif" width="12" height="1" border="0" alt=""></td>
<td><img src="images/spacer.gif" width="12" height="1" border="0" alt=""></td>
<td><img src="images/spacer.gif" width="14" height="1" border="0" alt=""></td>
<td><img src="images/spacer.gif" width="118" height="1" border="0" alt=""></td>
<td><img src="images/spacer.gif" width="16" height="1" border="0" alt=""></td>
<td><img src="images/spacer.gif" width="1" height="1" border="0" alt=""></td>
<td><img src="images/spacer.gif" width="49" height="1" border="0" alt=""></td>
<td><img src="images/spacer.gif" width="50" height="1" border="0" alt=""></td>
<td><img src="images/spacer.gif" width="61" height="1" border="0" alt=""></td>
<td><img src="images/spacer.gif" width="407" height="1" border="0" alt=""></td>
<td><img src="images/spacer.gif" width="28" height="1" border="0" alt=""></td>
<td><img src="images/spacer.gif" width="17" height="1" border="0" alt=""></td>
<td><img src="images/spacer.gif" width="1" height="1" border="0" alt=""></td>
</tr>
<tr>
<td colspan="12"><img name="index_r1_c1" src="images/index_r1_c1.jpg" width="785" height="4" border="0" alt=""></td>
<td><img src="images/spacer.gif" width="1" height="4" border="0" alt=""></td>
</tr>
<tr>
<td rowspan="4" colspan="3"><img name="index_r2_c1" src="images/index_r2_c1.jpg" width="38" height="71" border="0" alt=""></td>
<td rowspan="3" colspan="4"><img name="index_r2_c4" src="images/index_r2_c4.jpg" width="184" height="68" border="0" alt=""></td>
<td colspan="5"><img name="index_r2_c8" src="images/index_r2_c8.jpg" width="563" height="5" border="0" alt=""></td>
<td><img src="images/spacer.gif" width="1" height="5" border="0" alt=""></td>
</tr>
<tr>
<td rowspan="3"><img name="index_r3_c8" src="images/index_r3_c8.jpg" width="50" height="66" border="0" alt=""></td>
<td colspan="2"><img name="index_r3_c9" src="images/CIH.gif" width="468" height="60" border="0" alt=""></td>
<td rowspan="3" colspan="2"><img name="index_r3_c11" src="images/index_r3_c11.jpg" width="45" height="66" border="0" alt=""></td>
<td><img src="images/spacer.gif" width="1" height="60" border="0" alt=""></td>
</tr>
<tr>
<td rowspan="2" colspan="2"><img name="index_r4_c9" src="images/index_r4_c9.jpg" width="468" height="6" border="0" alt=""></td>
<td><img src="images/spacer.gif" width="1" height="3" border="0" alt=""></td>
</tr>
<tr>
<td colspan="4"><img name="index_r5_c4" src="images/index_r5_c4.jpg" width="184" height="3" border="0" alt=""></td>
<td><img src="images/spacer.gif" width="1" height="3" border="0" alt=""></td>
</tr>
<tr>
<td colspan="12" background="images/index_r6_c1.jpg"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="39%"> </td>
<td width="57%" class="txt11"><div align="center"><a href="index.php" class="txt11">Home</a>
| <a href="presentation.php" class="txt11">Qui sommes-nous</a> |
<a href="ContactPub.php" class="txt11">Contact & Publicité</a>
| <a href="abonnement.php" class="txt11">S'abonner</a> | <a href="favoris.php" class="txt11">Favoris</a></div></td>
<td width="4%"> </td>
</tr>
</table></td>
<td><img src="images/spacer.gif" width="1" height="36" border="0" alt=""></td>
</tr>
<tr>
<td colspan="12"><img name="index_r7_c1" src="images/index_r7_c1.jpg" width="785" height="9" border="0" alt=""></td>
<td><img src="images/spacer.gif" width="1" height="9" border="0" alt=""></td>
</tr>
<tr>
<td colspan="5"><img name="index_r8_c1" src="images/index_r8_c1.jpg" width="172" height="10" border="0" alt=""></td>
<td colspan="6" rowspan="10" bgcolor="#BC1B2B"><table width="596" height="135" border="0" cellpadding="0" cellspacing="0">
<?php
$connexion = mysql_pconnect($serveur, $admin, $mdp);
if($connexion != false)
{
$choixbase = mysql_select_db($base, $connexion);
$sql1 = "SELECT `id_pays`, `pays`".
" FROM `pays`".
" ORDER BY `id_pays`";
$rech_pays = mysql_query($sql1);
$code_pays = array();
$pays = array();
/* On active un compteur pour les régions */
$nb_pays = 0;
if($rech_pays != false)
{
while($ligne = mysql_fetch_assoc($rech_pays))
{
array_push($code_pays, $ligne['id_pays']);
array_push($pays, $ligne['pays']);
/* On incrémente de compteur */
$nb_pays++;
}
}
?>
<form action="result1.php" method="post" id="chgdept">
<tr>
<td height="12" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="12" height="12" valign="top"><img src="img-/coin1.jpg"></td>
<td><div align="right">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="txt11"><label> </label> <label> </label>
<input name="radionchk1" type="radio" value="0" checked>
Offres
<label>
<input name="radionchk1" type="radio" value="1">
Demandes</label></td>
<td width="240" class="txt10"><div align="right"><span class="txt11">
<? include("gestion/config.php");
$sql="select * from achat ";
$res = mysql_query($sql) or die('Erreur SQL !<br />'.$sql.'<br />'.mysql_error());
$total = mysql_num_rows($res);
echo"$total Annonces Actuellement";
?>
</span> </div></td>
</tr>
</table>
</div></td>
<td> </td>
<td width="12" align="right" valign="top"><img src="img-/coin2.jpg" width="12" height="12"></td>
</tr>
</table></td>
</tr>
<tr>
<td valign="middle"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="30" valign="top"><img src="images/charte1_r10_c7.jpg" width="160" height="20"></td>
</tr>
<tr>
<td valign="middle"><table width="100%" border="0" cellpadding="0" cellspacing="0" >
<tr>
<td> <table width="100%" border="0" cellpadding="0" cellspacing="0" class="txt11">
<tr>
<td><input name="radionchk" type="radio" value="0" checked class="Textzone"></td>
<td>Vente</td>
</tr>
<tr>
<td><input name="radionchk" type="radio" value="1" class="Textzone"></td>
<td>Location</td>
</tr>
</table></td>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0" class="txt11">
<tr>
<td width="43%">Pays</td>
<td><select name="pays_combo" id="pays" class="txt1" onchange="document.forms['chgdept'].submit();">
<option value="0">Sélectionnez</option>
<?php
for($i = 0; $i < $nb_pays; $i++)
{
?>
<option value="<?php echo($code_pays[$i]); ?>"<?php echo((isset($idr) && $idr == $code_pays[$i])?" selected=\"selected\"":null); ?>><?php echo($pays[$i]); ?></option>
<?php
}
?>
</select>
<?php
mysql_free_result($rech_pays);
/* On commence par vérifier si on a envoyé un numéro de région et le cas échant s'il est différent de -1 */
if(isset($idr) && $idr != -1)
{
/* Cération de la requête pour avoir les départements de cette région */
$sql2 = "SELECT `id_ville`, `ville`".
" FROM `villes`".
" WHERE `id_pays` = ". $idr ."".
" ORDER BY `id_ville`;";
if($connexion != false)
{
$rech_ville = mysql_query($sql2, $connexion);
/* Un petit compteur pour les départements */
$nd = 0;
/* On crée deux tableaux pour les numéros et les noms des départements */
$code_ville = array();
$nom_ville = array();
/* On va mettre les numéros et noms des départements dans les deux tableaux */
while($ligne_ville = mysql_fetch_assoc($rech_ville))
{
array_push($code_ville, $ligne_ville['id_ville']);
array_push($nom_ville, $ligne_ville['ville']);
$nd++;
}
/* Maintenant on peut construire la liste déroulante */
?> </td>
</tr>
<tr>
<td>Ville</td>
<td>
<select name="ville" id="ville" class="txt1">
<?php
for($d = 0; $d<$nd; $d++)
{
?>
<option value="<?php echo($code_ville[$d]); ?>"><?php echo($nom_ville[$d]); ?></option>
<?php
}
?>
</select>
<?php
}
mysql_free_result($rech_ville);
}
?>
<tr>
<td>Type de bien </td>
<td><select name="sub_type_achat" class="txt1">
<option value="0">Sélectionnez</option>
<?
$select = mysql_query("select * from typeachat");
while ($row = mysql_fetch_array($select))
{
$type_achat = $row["type_achat"];
echo"<option value=\"$type_achat\">";
echo"$type_achat";
echo"</option>";
}
?>
</select></td>
</tr>
</table></td>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0" class="txt11">
<tr>
<td>NB Pièces </td>
<td><select name="sub_type_logement" class="txt1">
<option value="0">Sélectionnez</option>
<?
$select2 = mysql_query("select * from logement");
while ($row = mysql_fetch_array($select2))
{
$sub_type_logement = $row["type_logement"];
echo"<option value=\"$sub_type_logement\">";
echo"$sub_type_logement";
echo"</option>";
}
?>
<option value="0">Autres</option>
</select></td>
</tr>
<tr>
<td>Meublé</td>
<td><select name="meublier" class="txt1">
<option value="0">Sélectionnez</option>
<?
$select2 = mysql_query("select * from meublier");
while ($row = mysql_fetch_array($select2))
{
$meuble = $row["meuble"];
echo"<option value=\"$meuble\">";
echo"$meuble";
echo"</option>";
}
?>
</select> </td>
</tr>
<tr>
<td colspan="2"> <div align="left"></div></td>
</tr>
</table>
<div align="right"></div></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td height="12" valign="bottom"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="12" height="12" valign="bottom"><img src="img-/coin3.jpg"></td>
<td width="551" align="center" valign="middle"><div align="right" class="style1"><img src="img-/trouv.jpg" width="82" height="20" onClick="form.submit()"></div></td>
<td width="33" align="right" valign="bottom"><img src="img-/coin4.jpg" width="12" height="12"></td>
</tr>
</table></td>
</tr>
</form>
</table></td>
<td rowspan="16"><img name="index_r8_c12" src="images/index_r8_c12.jpg" width="17" height="404" border="0" alt=""></td>
<td><img src="images/spacer.gif" width="1" height="10" border="0" alt=""></td>
</tr>
<tr>
<td rowspan="15"><img name="index_r9_c1" src="images/index_r9_c1.jpg" width="12" height="394" border="0" alt=""></td>
<td rowspan="2" colspan="3"><img name="index_r9_c2" src="images/index_r9_c2.jpg" width="144" height="24" border="0" alt=""></td>
<td rowspan="15"><img name="index_r9_c5" src="images/index_r9_c5.jpg" width="16" height="394" border="0" alt=""></td>
<td><img src="images/spacer.gif" width="1" height="20" border="0" alt=""></td>
</tr>
<tr>
<td><img src="images/spacer.gif" width="1" height="4" border="0" alt=""></td>
</tr>
<tr>
<td colspan="3"><img name="index_r11_c2" src="images/index_r11_c2.jpg" width="144" height="4" border="0" alt=""></td>
<td><img src="images/spacer.gif" width="1" height="4" border="0" alt=""></td>
</tr>
<tr>
<td colspan="3"><a href="passannonce.php"><img name="index_r12_c2" src="images/index_r12_c2.jpg" width="144" height="16" border="0" alt=""></a></td>
<td><img src="images/spacer.gif" width="1" height="16" border="0" alt=""></td>
</tr>
<tr>
<td colspan="3"><img name="index_r13_c2" src="images/index_r13_c2.jpg" width="144" height="4" border="0" alt=""></td>
<td><img src="images/spacer.gif" width="1" height="4" border="0" alt=""></td>
</tr>
<tr>
<td colspan="3"><a href="index.php"><img name="index_r14_c2" src="images/index_r14_c2.jpg" width="144" height="17" border="0" alt=""></a></td>
<td><img src="images/spacer.gif" width="1" height="17" border="0" alt=""></td>
</tr>
<tr>
<td colspan="3"><img name="index_r15_c2" src="images/index_r15_c2.jpg" width="144" height="5" border="0" alt=""></td>
<td><img src="images/spacer.gif" width="1" height="5" border="0" alt=""></td>
</tr>
<tr>
<td colspan="3"><img name="index_r16_c2" src="images/index_r16_c2.jpg" width="144" height="22" border="0" alt=""></td>
<td><img src="images/spacer.gif" width="1" height="22" border="0" alt=""></td>
</tr>
<tr>
<td rowspan="2" colspan="3"><img name="index_r17_c2" src="images/index_r17_c2.jpg" width="144" height="41" border="0" alt=""></td>
<td><img src="images/spacer.gif" width="1" height="33" border="0" alt=""></td>
</tr>
<tr>
<td colspan="6"><img name="index_r18_c6" src="images/index_r18_c6.jpg" width="596" height="8" border="0" alt=""></td>
<td><img src="images/spacer.gif" width="1" height="8" border="0" alt=""></td>
</tr>
<tr>
<td><img name="index_r19_c2" src="images/index_r19_c2.jpg" width="12" height="70" border="0" alt=""></td>
<td colspan="2" bgcolor="#BC1B2B"><a href="architectes.php" class="style2">Architectes</a><br>
<a href="promoteurs.php" class="style2">Promoteurs</a><br>
<a href="bureauOrdre.php" class="style2">Bureaux d'études</a><br> <a href="topographes.php" class="style2">Géomètres/Topographes</a><br>
<a href="notaires.php" class="style2"> Notaires</a></td>
<td rowspan="4" colspan="6"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="422" height="251">
<param name="movie" value="images/banniere.swf">
<param name="quality" value="high">
<embed src="images/banniere.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="422" height="251"></embed>
</object>
<a href="http://www.philips.fr" target="_blank"></a></td>
<td><img src="images/spacer.gif" width="1" height="70" border="0" alt=""></td>
</tr>
<tr>
<td colspan="3"><a href="Reactions.php"><img name="index_r20_c2" src="images/index_r20_c2.jpg" width="144" height="69" border="0" alt=""></a></td>
<td><img src="images/spacer.gif" width="1" height="69" border="0" alt=""></td>
</tr>
<tr>
<td colspan="3"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="144" height="96">
<param name="movie" value="images/bancentral.swf">
<param name="quality" value="high">
<embed src="images/bancentral.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="144" height="96"></embed>
</object></td>
<td><img src="images/spacer.gif" width="1" height="96" border="0" alt=""></td>
</tr>
<tr>
<td rowspan="2" colspan="3"><img name="index_r22_c2" src="images/index_r22_c2.jpg" width="144" height="26" border="0" alt=""></td>
<td><img src="images/spacer.gif" width="1" height="16" border="0" alt=""></td>
</tr>
<tr>
<td colspan="6"><img name="index_r23_c6" src="images/index_r23_c6.jpg" width="596" height="10" border="0" alt=""></td>
<td><img src="images/spacer.gif" width="1" height="10" border="0" alt=""></td>
</tr>
<tr>
<td colspan="12"><img name="index_r24_c1" src="images/index_r24_c1.jpg" width="785" height="20" border="0" alt=""></td>
<td><img src="images/spacer.gif" width="1" height="20" border="0" alt=""></td>
</tr>
<tr>
<td colspan="12"><img name="index_r25_c1" src="images/index_r25_c1.jpg" width="785" height="1" border="0" alt=""></td>
<td><img src="images/spacer.gif" width="1" height="1" border="0" alt=""></td>
</tr>
</table>
<?php
}
?>
</body>
</html>
Bonjour, j'ai un grand problème dans mon formulaire de recherche avancée, je voulais faire 2 listes déroulantes qui seront liées l'une à l'autre ( pays et villes ), et d'autre listes déroulantes non liées avec un botons Recherche, le problème c'est que dès que je choisit le pays, ça me donne les résulats associés à ce pays sans pouvoir choisir la ville ni les autres options ( nb pieces, ventes ... ), donc elle envoie directement la page "result1.php"
je vous passe mon code :
[php]<?php
echo("<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n");
$serveur = "localhost";
$admin = "root";
$mdp = "";
$base = "mabase";
$idr = isset($_POST['pays_combo'])?$_POST['pays_combo']:null;
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- saved from url=(0014)about:internet -->
<html>
<head>
<link href="style.css" rel="stylesheet" type="text/css">
<title>:: LACENTRALE IMMOBILIERE ::</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<!--Fireworks 8 Dreamweaver 8 target. Created Mon Oct 31 13:28:32 GMT+0000 (Greenwich) 2005-->
<style type="text/css">
<!--
body {
background-color: #F49902;
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
.style2 {FONT-FAMILY:Tahoma; COLOR: #ECC600; font-size: 11px;}
.style1 {color: #FFFFFF}
-->
</style></head>
<body>
<?
include("gestion/config.php");
//$query = "SELECT * FROM visites";
//$result = mysql_query($query);
//$row = mysql_fetch_array($result);
//$NbrVisites = $row[NbrVisites] + 1;
//$query2 = "UPDATE visites SET NbrVisites='$NbrVisites' WHERE id=1";
//mysql_query($query2) or die ("Erreur SQL");
?>
<table width="785" border="0" align="center" cellpadding="0" cellspacing="0">
<!-- fwtable fwsrc="charte1.png" fwbase="index.jpg" fwstyle="Dreamweaver" fwdocid = "742308039" fwnested="0" -->
<tr>
<td><img src="images/spacer.gif" width="12" height="1" border="0" alt=""></td>
<td><img src="images/spacer.gif" width="12" height="1" border="0" alt=""></td>
<td><img src="images/spacer.gif" width="14" height="1" border="0" alt=""></td>
<td><img src="images/spacer.gif" width="118" height="1" border="0" alt=""></td>
<td><img src="images/spacer.gif" width="16" height="1" border="0" alt=""></td>
<td><img src="images/spacer.gif" width="1" height="1" border="0" alt=""></td>
<td><img src="images/spacer.gif" width="49" height="1" border="0" alt=""></td>
<td><img src="images/spacer.gif" width="50" height="1" border="0" alt=""></td>
<td><img src="images/spacer.gif" width="61" height="1" border="0" alt=""></td>
<td><img src="images/spacer.gif" width="407" height="1" border="0" alt=""></td>
<td><img src="images/spacer.gif" width="28" height="1" border="0" alt=""></td>
<td><img src="images/spacer.gif" width="17" height="1" border="0" alt=""></td>
<td><img src="images/spacer.gif" width="1" height="1" border="0" alt=""></td>
</tr>
<tr>
<td colspan="12"><img name="index_r1_c1" src="images/index_r1_c1.jpg" width="785" height="4" border="0" alt=""></td>
<td><img src="images/spacer.gif" width="1" height="4" border="0" alt=""></td>
</tr>
<tr>
<td rowspan="4" colspan="3"><img name="index_r2_c1" src="images/index_r2_c1.jpg" width="38" height="71" border="0" alt=""></td>
<td rowspan="3" colspan="4"><img name="index_r2_c4" src="images/index_r2_c4.jpg" width="184" height="68" border="0" alt=""></td>
<td colspan="5"><img name="index_r2_c8" src="images/index_r2_c8.jpg" width="563" height="5" border="0" alt=""></td>
<td><img src="images/spacer.gif" width="1" height="5" border="0" alt=""></td>
</tr>
<tr>
<td rowspan="3"><img name="index_r3_c8" src="images/index_r3_c8.jpg" width="50" height="66" border="0" alt=""></td>
<td colspan="2"><img name="index_r3_c9" src="images/CIH.gif" width="468" height="60" border="0" alt=""></td>
<td rowspan="3" colspan="2"><img name="index_r3_c11" src="images/index_r3_c11.jpg" width="45" height="66" border="0" alt=""></td>
<td><img src="images/spacer.gif" width="1" height="60" border="0" alt=""></td>
</tr>
<tr>
<td rowspan="2" colspan="2"><img name="index_r4_c9" src="images/index_r4_c9.jpg" width="468" height="6" border="0" alt=""></td>
<td><img src="images/spacer.gif" width="1" height="3" border="0" alt=""></td>
</tr>
<tr>
<td colspan="4"><img name="index_r5_c4" src="images/index_r5_c4.jpg" width="184" height="3" border="0" alt=""></td>
<td><img src="images/spacer.gif" width="1" height="3" border="0" alt=""></td>
</tr>
<tr>
<td colspan="12" background="images/index_r6_c1.jpg"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="39%"> </td>
<td width="57%" class="txt11"><div align="center"><a href="index.php" class="txt11">Home</a>
| <a href="presentation.php" class="txt11">Qui sommes-nous</a> |
<a href="ContactPub.php" class="txt11">Contact & Publicité</a>
| <a href="abonnement.php" class="txt11">S'abonner</a> | <a href="favoris.php" class="txt11">Favoris</a></div></td>
<td width="4%"> </td>
</tr>
</table></td>
<td><img src="images/spacer.gif" width="1" height="36" border="0" alt=""></td>
</tr>
<tr>
<td colspan="12"><img name="index_r7_c1" src="images/index_r7_c1.jpg" width="785" height="9" border="0" alt=""></td>
<td><img src="images/spacer.gif" width="1" height="9" border="0" alt=""></td>
</tr>
<tr>
<td colspan="5"><img name="index_r8_c1" src="images/index_r8_c1.jpg" width="172" height="10" border="0" alt=""></td>
<td colspan="6" rowspan="10" bgcolor="#BC1B2B"><table width="596" height="135" border="0" cellpadding="0" cellspacing="0">
<?php
$connexion = mysql_pconnect($serveur, $admin, $mdp);
if($connexion != false)
{
$choixbase = mysql_select_db($base, $connexion);
$sql1 = "SELECT `id_pays`, `pays`".
" FROM `pays`".
" ORDER BY `id_pays`";
$rech_pays = mysql_query($sql1);
$code_pays = array();
$pays = array();
/* On active un compteur pour les régions */
$nb_pays = 0;
if($rech_pays != false)
{
while($ligne = mysql_fetch_assoc($rech_pays))
{
array_push($code_pays, $ligne['id_pays']);
array_push($pays, $ligne['pays']);
/* On incrémente de compteur */
$nb_pays++;
}
}
?>
<form action="result1.php" method="post" id="chgdept">
<tr>
<td height="12" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="12" height="12" valign="top"><img src="img-/coin1.jpg"></td>
<td><div align="right">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="txt11"><label> </label> <label> </label>
<input name="radionchk1" type="radio" value="0" checked>
Offres
<label>
<input name="radionchk1" type="radio" value="1">
Demandes</label></td>
<td width="240" class="txt10"><div align="right"><span class="txt11">
<? include("gestion/config.php");
$sql="select * from achat ";
$res = mysql_query($sql) or die('Erreur SQL !<br />'.$sql.'<br />'.mysql_error());
$total = mysql_num_rows($res);
echo"$total Annonces Actuellement";
?>
</span> </div></td>
</tr>
</table>
</div></td>
<td> </td>
<td width="12" align="right" valign="top"><img src="img-/coin2.jpg" width="12" height="12"></td>
</tr>
</table></td>
</tr>
<tr>
<td valign="middle"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="30" valign="top"><img src="images/charte1_r10_c7.jpg" width="160" height="20"></td>
</tr>
<tr>
<td valign="middle"><table width="100%" border="0" cellpadding="0" cellspacing="0" >
<tr>
<td> <table width="100%" border="0" cellpadding="0" cellspacing="0" class="txt11">
<tr>
<td><input name="radionchk" type="radio" value="0" checked class="Textzone"></td>
<td>Vente</td>
</tr>
<tr>
<td><input name="radionchk" type="radio" value="1" class="Textzone"></td>
<td>Location</td>
</tr>
</table></td>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0" class="txt11">
<tr>
<td width="43%">Pays</td>
<td><select name="pays_combo" id="pays" class="txt1" onchange="document.forms['chgdept'].submit();">
<option value="0">Sélectionnez</option>
<?php
for($i = 0; $i < $nb_pays; $i++)
{
?>
<option value="<?php echo($code_pays[$i]); ?>"<?php echo((isset($idr) && $idr == $code_pays[$i])?" selected=\"selected\"":null); ?>><?php echo($pays[$i]); ?></option>
<?php
}
?>
</select>
<?php
mysql_free_result($rech_pays);
/* On commence par vérifier si on a envoyé un numéro de région et le cas échant s'il est différent de -1 */
if(isset($idr) && $idr != -1)
{
/* Cération de la requête pour avoir les départements de cette région */
$sql2 = "SELECT `id_ville`, `ville`".
" FROM `villes`".
" WHERE `id_pays` = ". $idr ."".
" ORDER BY `id_ville`;";
if($connexion != false)
{
$rech_ville = mysql_query($sql2, $connexion);
/* Un petit compteur pour les départements */
$nd = 0;
/* On crée deux tableaux pour les numéros et les noms des départements */
$code_ville = array();
$nom_ville = array();
/* On va mettre les numéros et noms des départements dans les deux tableaux */
while($ligne_ville = mysql_fetch_assoc($rech_ville))
{
array_push($code_ville, $ligne_ville['id_ville']);
array_push($nom_ville, $ligne_ville['ville']);
$nd++;
}
/* Maintenant on peut construire la liste déroulante */
?> </td>
</tr>
<tr>
<td>Ville</td>
<td>
<select name="ville" id="ville" class="txt1">
<?php
for($d = 0; $d<$nd; $d++)
{
?>
<option value="<?php echo($code_ville[$d]); ?>"><?php echo($nom_ville[$d]); ?></option>
<?php
}
?>
</select>
<?php
}
mysql_free_result($rech_ville);
}
?>
<tr>
<td>Type de bien </td>
<td><select name="sub_type_achat" class="txt1">
<option value="0">Sélectionnez</option>
<?
$select = mysql_query("select * from typeachat");
while ($row = mysql_fetch_array($select))
{
$type_achat = $row["type_achat"];
echo"<option value=\"$type_achat\">";
echo"$type_achat";
echo"</option>";
}
?>
</select></td>
</tr>
</table></td>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0" class="txt11">
<tr>
<td>NB Pièces </td>
<td><select name="sub_type_logement" class="txt1">
<option value="0">Sélectionnez</option>
<?
$select2 = mysql_query("select * from logement");
while ($row = mysql_fetch_array($select2))
{
$sub_type_logement = $row["type_logement"];
echo"<option value=\"$sub_type_logement\">";
echo"$sub_type_logement";
echo"</option>";
}
?>
<option value="0">Autres</option>
</select></td>
</tr>
<tr>
<td>Meublé</td>
<td><select name="meublier" class="txt1">
<option value="0">Sélectionnez</option>
<?
$select2 = mysql_query("select * from meublier");
while ($row = mysql_fetch_array($select2))
{
$meuble = $row["meuble"];
echo"<option value=\"$meuble\">";
echo"$meuble";
echo"</option>";
}
?>
</select> </td>
</tr>
<tr>
<td colspan="2"> <div align="left"></div></td>
</tr>
</table>
<div align="right"></div></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td height="12" valign="bottom"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="12" height="12" valign="bottom"><img src="img-/coin3.jpg"></td>
<td width="551" align="center" valign="middle"><div align="right" class="style1"><img src="img-/trouv.jpg" width="82" height="20" onClick="form.submit()"></div></td>
<td width="33" align="right" valign="bottom"><img src="img-/coin4.jpg" width="12" height="12"></td>
</tr>
</table></td>
</tr>
</form>
</table></td>
<td rowspan="16"><img name="index_r8_c12" src="images/index_r8_c12.jpg" width="17" height="404" border="0" alt=""></td>
<td><img src="images/spacer.gif" width="1" height="10" border="0" alt=""></td>
</tr>
<tr>
<td rowspan="15"><img name="index_r9_c1" src="images/index_r9_c1.jpg" width="12" height="394" border="0" alt=""></td>
<td rowspan="2" colspan="3"><img name="index_r9_c2" src="images/index_r9_c2.jpg" width="144" height="24" border="0" alt=""></td>
<td rowspan="15"><img name="index_r9_c5" src="images/index_r9_c5.jpg" width="16" height="394" border="0" alt=""></td>
<td><img src="images/spacer.gif" width="1" height="20" border="0" alt=""></td>
</tr>
<tr>
<td><img src="images/spacer.gif" width="1" height="4" border="0" alt=""></td>
</tr>
<tr>
<td colspan="3"><img name="index_r11_c2" src="images/index_r11_c2.jpg" width="144" height="4" border="0" alt=""></td>
<td><img src="images/spacer.gif" width="1" height="4" border="0" alt=""></td>
</tr>
<tr>
<td colspan="3"><a href="passannonce.php"><img name="index_r12_c2" src="images/index_r12_c2.jpg" width="144" height="16" border="0" alt=""></a></td>
<td><img src="images/spacer.gif" width="1" height="16" border="0" alt=""></td>
</tr>
<tr>
<td colspan="3"><img name="index_r13_c2" src="images/index_r13_c2.jpg" width="144" height="4" border="0" alt=""></td>
<td><img src="images/spacer.gif" width="1" height="4" border="0" alt=""></td>
</tr>
<tr>
<td colspan="3"><a href="index.php"><img name="index_r14_c2" src="images/index_r14_c2.jpg" width="144" height="17" border="0" alt=""></a></td>
<td><img src="images/spacer.gif" width="1" height="17" border="0" alt=""></td>
</tr>
<tr>
<td colspan="3"><img name="index_r15_c2" src="images/index_r15_c2.jpg" width="144" height="5" border="0" alt=""></td>
<td><img src="images/spacer.gif" width="1" height="5" border="0" alt=""></td>
</tr>
<tr>
<td colspan="3"><img name="index_r16_c2" src="images/index_r16_c2.jpg" width="144" height="22" border="0" alt=""></td>
<td><img src="images/spacer.gif" width="1" height="22" border="0" alt=""></td>
</tr>
<tr>
<td rowspan="2" colspan="3"><img name="index_r17_c2" src="images/index_r17_c2.jpg" width="144" height="41" border="0" alt=""></td>
<td><img src="images/spacer.gif" width="1" height="33" border="0" alt=""></td>
</tr>
<tr>
<td colspan="6"><img name="index_r18_c6" src="images/index_r18_c6.jpg" width="596" height="8" border="0" alt=""></td>
<td><img src="images/spacer.gif" width="1" height="8" border="0" alt=""></td>
</tr>
<tr>
<td><img name="index_r19_c2" src="images/index_r19_c2.jpg" width="12" height="70" border="0" alt=""></td>
<td colspan="2" bgcolor="#BC1B2B"><a href="architectes.php" class="style2">Architectes</a><br>
<a href="promoteurs.php" class="style2">Promoteurs</a><br>
<a href="bureauOrdre.php" class="style2">Bureaux d'études</a><br> <a href="topographes.php" class="style2">Géomètres/Topographes</a><br>
<a href="notaires.php" class="style2"> Notaires</a></td>
<td rowspan="4" colspan="6"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="422" height="251">
<param name="movie" value="images/banniere.swf">
<param name="quality" value="high">
<embed src="images/banniere.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="422" height="251"></embed>
</object>
<a href="http://www.philips.fr" target="_blank"></a></td>
<td><img src="images/spacer.gif" width="1" height="70" border="0" alt=""></td>
</tr>
<tr>
<td colspan="3"><a href="Reactions.php"><img name="index_r20_c2" src="images/index_r20_c2.jpg" width="144" height="69" border="0" alt=""></a></td>
<td><img src="images/spacer.gif" width="1" height="69" border="0" alt=""></td>
</tr>
<tr>
<td colspan="3"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="144" height="96">
<param name="movie" value="images/bancentral.swf">
<param name="quality" value="high">
<embed src="images/bancentral.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="144" height="96"></embed>
</object></td>
<td><img src="images/spacer.gif" width="1" height="96" border="0" alt=""></td>
</tr>
<tr>
<td rowspan="2" colspan="3"><img name="index_r22_c2" src="images/index_r22_c2.jpg" width="144" height="26" border="0" alt=""></td>
<td><img src="images/spacer.gif" width="1" height="16" border="0" alt=""></td>
</tr>
<tr>
<td colspan="6"><img name="index_r23_c6" src="images/index_r23_c6.jpg" width="596" height="10" border="0" alt=""></td>
<td><img src="images/spacer.gif" width="1" height="10" border="0" alt=""></td>
</tr>
<tr>
<td colspan="12"><img name="index_r24_c1" src="images/index_r24_c1.jpg" width="785" height="20" border="0" alt=""></td>
<td><img src="images/spacer.gif" width="1" height="20" border="0" alt=""></td>
</tr>
<tr>
<td colspan="12"><img name="index_r25_c1" src="images/index_r25_c1.jpg" width="785" height="1" border="0" alt=""></td>
<td><img src="images/spacer.gif" width="1" height="1" border="0" alt=""></td>
</tr>
</table>
<?php
}
?>
</body>
</html>[/php]