Eléphant du PHP |
151 Messages
02 nov. 2005, 12:41
Pardon j'étais connectée comme étant une invitée et j'ai posté 2 fois le meme post
voila je recommence :
non je l'ai pas encore en ligne, bon je vais reéxpliquer mon problème, j'ai une page
"index.php" dans laquelle j'ai mon formulaire avec les combo box et un bouton valider pour rechercher les annonces demandées selon les critères choisis, la page index a comme action après validation du formulaire la page
"result1.php" qui contient mon iframe avec ces paramètres là :
<td colspan="6" rowspan="15" bgcolor="#BC1B2B"><iframe name="milieu" scrolling="auto" frameborder="0" height="394" width="595" marginheight="0" marginwidth="0" src="moteurRech.php"></iframe> </td>
comme vous le voyez dans l'iframe, mon script "moteurRech.php" doit être excuté, et c'est ce que j'ai effectivement (résultats de la recherche+ pagination) mais dès que je choisi une autre page dans ma partie iframe, j'obtient dans ma partie iframe toute la page result1.php (puisque dans "moteurRech.php" le résultat est redirigé vers "result1.php" ) avec une autre frame la dedans sans pouvoir passer au deuxieme page ce qui génére des iframe imbriqué l'une dans l'autre !
dans ma pagination je fais appel à mon iframe qui a pour nom "milieu" :
$barre_nav .= " | <a href=\"". $lien."\" target="milieu" title=\"page ". $p ."\">". $p ."</a>";
voila "moteur.php"
<!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>:: Immo ::</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 bgcolor='#BC1B2B' text=black link=#CCCCCC vlink=#CCCCCC alink=#CCCCCC>
<?php
include("gestion/config.php");
include ("fonctions.php");
$pays_combo = isset($_POST['pays_combo']) ? $_POST['pays_combo'] : (isset($_GET['pays_combo']) ? $_GET['pays_combo'] : 0);
$sub_ville = isset($_POST['sub_ville']) ? $_POST['sub_ville'] : (isset($_GET['sub_ville']) ? $_GET['sub_ville'] : 0);
$sub_type_achat = isset($_POST['sub_type_achat']) ? $_POST['sub_type_achat'] : (isset($_GET['sub_type_achat']) ? $_GET['sub_type_achat'] : 0);
$sub_type_logement = isset($_POST['sub_type_logement']) ? $_POST['sub_type_logement'] : (isset($_GET['sub_type_logement']) ? $_GET['sub_type_logement'] : 0);
$meublier = isset($_POST['meublier']) ? $_POST['meublier'] : (isset($_GET['meublier']) ? $_GET['meublier'] : 0);
$radionchk = isset($_POST['radionchk']) ? $_POST['radionchk'] : (isset($_GET['radionchk']) ? $_GET['radionchk'] : 0);
$radionchk1 = isset($_POST['radionchk1']) ? $_POST['radionchk1'] : (isset($_GET['radionchk1']) ? $_GET['radionchk1'] : "");
$finrequete="";
$k=0;
$url = "./result1.php?page=";
$sql="select * from achat where location='".$radionchk."' and offre='".$radionchk1."'";
//echo '.<p>'.$sql.'</p>';
$result = mysql_query($sql);
$nb_par_page = 10;
$page_en_cours = isset($_GET['page']) ? $_GET['page'] : 0;
$page_affichee = ($page_en_cours + 1);
//$operateur= ($allcriteres == "oui") ? " AND " : " OR ";
$operateur= " AND ";
if ($pays_combo != "0")
{
$sql.= $operateur." pays like '%$pays_combo%' ";
}
if ($sub_ville != "0")
{
$sql.= $operateur." ville like '%$sub_ville%' ";
}
if ($sub_type_achat != "0")
{
$sql.= $operateur." type_achat like '%$sub_type_achat%' ";
}
if ($sub_type_logement != "0")
{
$sql.= $operateur." type_logement like '%$sub_type_logement%' ";
}
if ($meublier != "0")
{
$sql.= $operateur." meuble like '%$meublier%' ";
}
//$debut= (isset($_GET['debut'])) ? addslashes($_GET['debut']) : 0;
$sql.= ' ORDER BY prix ';
$res = mysql_query($sql) or die('Erreur SQL !<br />'.$sql.'<br />'.mysql_error());
$total = mysql_num_rows($res);
$nb_pages = ceil($total / $nb_par_page);
if($nb_pages > 0)
{
$barre_nav = "";
if($nb_pages > 1)
{
if($page_en_cours > 0)
{
for($i = 0; $i < $page_en_cours; $i++)
{
$p = $i + 1;
$lien = $url . $i.'&pays_combo=' .$pays_combo
.'&sub_ville=' .$sub_ville
.'&sub_type_achat=' .$sub_type_achat
.'&sub_type_logement=' .$sub_type_logement
.'&meublier=' .$meublier
.'&radionchk=' .$radionchk
.'&radionchk1=' .$radionchk1;
$barre_nav .= '<a href="'. $lien .'" target=milieu title="page '. $p .'">'. $p .'</a> | ';
}
}
$barre_nav .= "<strong>". $page_affichee ."</strong>";
if(($page_affichee) < $nb_pages)
{
$nb_suivantes = $nb_pages - ($page_affichee);
for($j = ($page_affichee); $j < $nb_pages; $j++)
{
$p = $j + 1;
$lien = $url . $j.'&pays_combo=' .$pays_combo
.'&sub_ville=' .$sub_ville
.'&sub_type_achat=' .$sub_type_achat
.'&sub_type_logement=' .$sub_type_logement
.'&meublier=' .$meublier
.'&radionchk=' .$radionchk
.'&radionchk1=' .$radionchk1;
$barre_nav .= " | <a href=\"". $lien."\" target="milieu" title=\"page ". $p ."\">". $p ."</a>";
}
}
$page_affichee = "Page ". $page_affichee ." sur un total de ". $nb_pages ." pages.";
}
else
{
$barre_nav .= "page 1/1";
}
$debut = $page_en_cours * $nb_par_page;
$sql .= " LIMIT ". $debut .", ". $nb_par_page."";
//echo '<p>'.$sql.'</p>';
$res = mysql_query($sql) or die('Erreur SQL !<br />'.$sql.'<br />'.mysql_error());
echo"<table width='580' border='0' cellpadding='0' cellspacing='2' bgcolor='#FF9900'>
<tr>";
echo"<td width='50%' align='center'><font color='#ECC600' class='txterr' size='4'><b>$total Annonce(s) Trouvées </b></font></td>";
echo"<td align=\"right\" class='txt1'>";
//echo"<font color='#ECC600' size='2'>Visualisation de: </font>";
echo"</td>";
echo"</td>";
echo"</tr>
</table>";
$k=0;
while ($row = mysql_fetch_array($res))
{
$k++ ;
$prix = $row["prix"];
$sub_type_achat = $row["type_achat"];
$sub_type_logement = $row["type_logement"];
$meuble = $row["meuble"];
$ville = $row["ville"];
$location = $row["location"];
$offre = $row["offre"];
$pays = $row["pays"];
$surface = $row["surface"];
$description = $row["description"];
$reference = $row["reference"];
$surle = $row["surle"];
$aproximite = $row["aproximite"];
$description= stripslashes($description);
$description= nl2br($description);
if( $k%2 == 0 )
$color = "#C61C2D";
else
$color = "#BC1B2B";
echo"<table width='580' border='0' cellpadding='0' cellspacing='2' bgcolor='#CC6666' ><tr>
<td bgcolor='$color' align='left' width='367' class='txt1' size='1'> <font color='#FFCC00'> <strong><u>Annonce N° $reference</u></strong><br>
<b>$sub_type_achat à $ville ";
if ($surface !=0)
{
echo"de surface $surface m2<br>";
}
else
{
echo"<br>";
}
echo" $description </b><br>";
$sql_select2 = "select * from client where reference = '$reference' ";
$result2 = mysql_query($sql_select2);
$row = mysql_fetch_array($result2);
$reference = $row["reference"];
$tel = $row["teldomicile"];
$gsm1 = $row["gsm1"];
$gsm2 = $row["gsm2"];
if (($tel!="Pas de téléphone"))
{
if (!empty($tel))
{
echo"<font color='#FF9900'><b>Tél: $tel</b></font>";
}
}
//echo"<br>";
if (($gsm1!="Pas de GSM"))
{
if (!empty($gsm1))
{
echo"<font color='#FF9900'><b>GSM: $gsm1</b></font>";
}
}
echo"<br>";
echo"</font>
</td>
<td bgcolor='$color' width='106' align='center' class='txt1'><font color='#FFFFFF'> <b>Prix :<br>";
if ($prix != 0)
echo"$prix</b></font></td>";
else
echo"N.D</b></font></td>";
echo"</tr>
</table>";
echo "<table align=\"center\" width=\"479\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
echo"<tr>";
//echo"<td align=\"left\" class='menuc'>";
echo"</td>";
echo"</tr>";
echo"</table>";
// affichage de la barre de naviagtion
}
echo"<align='center' class='txt1'> <font color='#FFFFFF' size='2'><b>Pages: $barre_nav</b></font>";
//echo $barre_nav;
}
else
echo"<align='center' class='txt1'> <font color='#FFFFFF' size='1'><b>$total Annonce Trouvée</b></font>";
?>
</body>
</head>
</html>