- reset +
Home

Last message

No posts to display.

Advertise here ?

French (Fr)English (United Kingdom)

La conciergerie de Lily propose un service de gestion locative, conciergerie et intendance privée, propriétaires et locataires, sur le bassin d'Arcachon, le Cap Ferret et Lacanau, locations touristiques de résidences principales ou secondaires, appartements meublés, bungalows, chalets.

En savoir +

Last Post's

Welcome, Guest
Username Password: Remember me

Faire une recherche par nombre d'occupant
(1 viewing) (1) Guest
Feel free to use this forum to suggest things ...

TOPIC: Faire une recherche par nombre d'occupant

Re: Faire une recherche par nombre d'occupant 7 years, 10 months ago #1004

  • admin
  • OFFLINE
  • Administrateur
  • Posts: 397
  • Karma: 3
ok essayons autre chose alors
enlevez les trucs de la partie recherche remettez comme avant

et ajoutez ceci arès if($s_situation){ $and .=" and s_situation = $s_situation "; } la ou vous aviez mis if($pax){ $andpax = " and $room->pax = $pax "; }

 
if($pax>0){ $and .=" and exists(select ro.id from --#__lbresa_rooms as ro where ro.id=id and ro.published>0 and ro.pax>=$pax and ro.pax<=$pax ) "; }
 
Laubro
The following user(s) said Thank You: kaza

Re: Faire une recherche par nombre d'occupant 7 years, 10 months ago #1005

  • kaza
  • OFFLINE
  • Junior Boarder
  • Posts: 35
  • Karma: 0
ça me renvoi l'erreur
Warning: Invalid argument supplied for foreach() in C:\xampp\htdocs\la londe loc\components\com_joomloc\views\engine\tmpl\advanced.php on line 929

soit le foreach($infos as $info)

Re: Faire une recherche par nombre d'occupant 7 years, 10 months ago #1006

  • kaza
  • OFFLINE
  • Junior Boarder
  • Posts: 35
  • Karma: 0
ça marche comme ça mais type de duree ne fonctionne plus
if($action)
{
echo "<br><br>";
$infos = JRequest::getVar( 'info' );
$nbinfos = count($infos);
 
 
$and = "";
 
if($type){ $and .=" and s_type = $type "; }
if($continent){ $and .=" and s_continent = $continent "; }
if($pays){ $and .=" and s_pays = $pays "; }
if($region){ $and .=" and s_region = $region "; }
if($dep){ $and .=" and s_dep = $dep "; }
if($ville){ $and .=" and s_ville = $ville "; }
if($s_situation){ $and .=" and s_situation = $s_situation "; }
 
 
if($name) { $and .=" and s_nom LIKE '%$name%' "; }
if($mer_a)
{
 
$and .=" and mer_a <= $mer_a and mer_m = '$mer_m' ";
 
}
if($piste_a)
{
$and .=" and piste_a <= $piste_a and piste_m = '$piste_m' ";
if($altitude) { $and .= " altitude <= $altitude and altitude_m = '$altitude_m' "; }
}
if($maxtime) { $and .= " and DATE_SUB(CURDATE(),INTERVAL $maxdays DAY) < create_date "; }
 
 
if($ref){ $and =" and id = $ref "; } // if ref present, then the search only do on this criteria
 
 
 
 
 
if($dispo>0 and !$date_debut or $dispo>0 and !$date_fin or $dispo>0 and !$date_d or $dispo>0 and !$date_f)
{
echo "<div id='error' style='color:red; font-weight:bold; font-size:14px; width:100%; text-align:center'>".JText::_( 'Erreur : Veuillez indiquer des dates au format valide : jj-mm-aaaa')."</div>";
echo "<FORM><table width='100%'><tr><td width='100%' align='center'><bR><INPUT TYPE='button' VALUE='<< ".JText::_( 'Retour au formulaire' )."' onClick='history.back()'></td></tr></table></FORM>";
}
else {
echo "<div id='afflocsdispo' style='width:100%; text-align:center; font-weight:bold;'></div><bR>";
echo "<div id='afflocsdispo2' style='width:100%; text-align:center; font-weight:bold'></div><br>";
}
 
 
 
 
 
if($byorder == "dateasc") { $order = " order by create_date asc "; }
elseif($byorder == "datedesc" or !$byorder) { $order = " order by create_date desc "; if(!$byorder) { $byorder= "datedesc"; } }
elseif($byorder == "priceasc") { $order = " order by best_price asc "; }
elseif($byorder == "pricedesc") { $order = " order by best_price desc "; }
elseif($byorder == "sit") { $order = " order by s_situation asc "; }
else { $order = " order by create_date desc "; }
 
 
echo "<form method='post' action='index.php?option=com_joomloc&view=engine&layout=advanced&action=find'>";
echo "<table border='0'>
<tr>
<td>"
;
echo "<select name='byorder' class='inputbox' onchange='this.form.submit()'>
<option value=''>"
.JText::_( 'Classement r&eacute;sultats')."</option>
<option"
; if($byorder == "datedesc") { echo " selected "; } echo " value='datedesc'>".JText::_( 'Date de publication desc')."</option>
<option"
; if($byorder == "dateasc") { echo " selected "; } echo " value='dateasc'>".JText::_( 'Date de publication asc')."</option>
<option"
; if($byorder == "priceasc") { echo " selected "; } echo " value='priceasc'>".JText::_( 'Prix croissant')."</option>
<option"
; if($byorder == "pricedesc") { echo " selected "; } echo " value='pricedesc'>".JText::_( 'Prix d&eacute;croissant')."</option>
<option"
; if($byorder == "sit") { echo " selected "; } echo " value='sit'>".JText::_( 'Situation')."</option>
</select>"
;
 
 
 
echo "<input type='hidden' name='continent' value='$continent'>
<input type='hidden' name='pays' value='$pays'>
<input type='hidden' name='ville' value='$ville'>
<input type='hidden' name='dep' value='$dep'>
<input type='hidden' name='region' value='$region'>
<input type='hidden' name='type' value='$type'>
<input type='hidden' name='dispo' value='$dispo'>
<input type='hidden' name='maxtime' value='$maxtime'>
<input type='hidden' name='maxdays' value='$maxdays'>
<input type='hidden' name='cal' value='$cal'>
<input type='hidden' name='ref' value='$ref'>
<input type='hidden' name='s_situation' value='$s_situation'>
<input type='hidden' name='pax' value='$pax'>
<input type='hidden' name='mer_a' value='$mer_a'><input type='hidden' name='mer_m' value='$mer_m'>
<input type='hidden' name='piste_a' value='$piste_a'><input type='hidden' name='piste_m' value='$piste_m'>
<input type='hidden' name='altitude' value='$altitude'><input type='hidden' name='altitude_m' value='$altitude_m'>
<input type='hidden' name='date_debut' value='$date_debut'><input type='hidden' name='date_fin' value='$date_fin'>"
;
 
if($infos)
{
foreach($infos as $info) {
 
echo "<input type='hidden' name='info[]' value='$info'>";
 
}
 
}// END IF INFOS
 
echo "</td><td>";
echo "<select name='max_page' class='inputbox' onchange='this.form.submit()'>
<option selected value='"
.$this->config->loc_page."'>".$this->config->loc_page." ".JText::_( 'r&eacute;sultats par page')."</option>";
$nbr = $this->config->loc_page;
 
for($i=0; $i<=4; $i++)
{
$nbr = $nbr + 10;
echo "<option"; if($max_page == "$nbr") { echo " selected "; } echo " value='$nbr'>$nbr ".JText::_( 'r&eacute;sultats par page')."</option>";
 
}
 
echo "</select>";
echo "<input type='hidden' name='max_page2' value='$max_page'>";
echo "<input type='hidden' name='byorder2' value='$byorder'>";
echo "</td><td>";
echo "<div id='navresultsadv' style='width:100%'></div>";
echo "</tD></tr></table>";
echo "</form><bR>";
 
 
if($max_page)
{
$limit = $max_page;
}
else
{
$limit = $this->config->loc_page;
}
 
if(!$nb) { $nb=0; }
 
 
if($debut==""){$debut=0;}
 
$debut=$nb*$limit;
 
 
 
$query = "SELECT * FROM --#__lbresa_sites where published = 1 $and $order";
$db->setQuery( $query);
$allsites= $db->loadObjectList();
$nballsites= count($db->loadObjectList());
 
 
echo "<div id='results' class='module-results'>
<table border='0' cellpadding='0' cellspacing='0'>"
;
 
$l=0;
 
 
$u=0;
$tableau = array();
 
foreach($allsites as $site)
{
 
 
 
if($infos)
{
$i=0;
foreach($infos as $info) {
 
$query = "SELECT info FROM --#__lbresa_infos_sites where id_info='$info' and id_site='$site->id' and act > 0";
 
$db->setQuery( $query);
$allinfos= count($db->loadObject());
 
if($allinfos>0) { $i++; }
 
}
 
}// END IF INFOS
 
 
if(!$infos or $i==$nbinfos)
{
 
{
 
$query = "SELECT pax FROM --#__lbresa_rooms where id_site='$site->id' and pax='$pax' and published > 0";
$db->setQuery( $query);
$nbrooms= count($db->loadObjectList());
 
if($nbrooms >0){ $c++; }
 
 
}
 
if($rooms or $nbrooms and $pax >0)//ect... a verifier les combinaisons
{
 
$tableau[$u] = $site->id; $u++;
 
}
 
 
 
 
 
}// END
 
 
 
 
 
 
if(!$infos or $i==$nbinfos)
{
$p=0;
if($cal)
{
 
$query = "SELECT cal FROM --#__lbresa_rooms where id_site='$site->id' and cal='$cal' and published > 0";
$db->setQuery( $query);
$nbcals= count($db->loadObjectList());
 
if($nbcals>0) { $p++; }
 
}
 
if(!$cal or $nbcals>0)
{
 
 
 
 
}// END FOR CALENDAR TYPE CONTROL : NO CAL OR CAL TYPE IS EXIST
 
 
 
 
 
}// // END IF NO INFO OR LOCATION OPTIONS = ASKING OPTIONS
 
}//end for each sites
 

Re: Faire une recherche par nombre d'occupant 7 years, 10 months ago #1007

  • kaza
  • OFFLINE
  • Junior Boarder
  • Posts: 35
  • Karma: 0
a la rigueur je pourrais me contenter de croiser la duree avec le nbre de personne cela me suffirait..

Re: Faire une recherche par nombre d'occupant 7 years, 10 months ago #1008

  • admin
  • OFFLINE
  • Administrateur
  • Posts: 397
  • Karma: 3
non mais testez ma derniers proposition , plus rapide et plus simple a mettre en place

reprenez le fichier advanced de base
remettez les $pax pour récupérer les variable + le select choix de durée + le hidden

puis ajoute le bout de requête
if($pax>0){ $and .=" and exists(select ro.id from --#__lbresa_rooms as ro  where ro.id=id and ro.published>0 and ro.pax>=$pax and ro.pax<=$pax ) "; }
Laubro

Re: Faire une recherche par nombre d'occupant 7 years, 10 months ago #1009

  • kaza
  • OFFLINE
  • Junior Boarder
  • Posts: 35
  • Karma: 0
ok je reteste...

Voici la copie du fichier entier mais cela me donne une erreur a la ligne 926 a cause du foreach
<?php
/**
* @version $Id: header.php 756 2008-12-08 14:24:02Z elkuku $
* @package joomloc
*/

 
// no direct access
defined( '_JEXEC' ) or die( '=;)' );
 
JHTML::_('behavior.calendar');
 
$myroot = $this->myroot;
 
$db =& JFactory::getDBO();
 
$action = JRequest::getVar('action');
 
$continent = JRequest::getVar('continents');
$pays = JRequest::getVar('pays');
$ville = JRequest::getVar('ville');
$dep = JRequest::getVar('dep');
$region = JRequest::getVar('region');
$type = JRequest::getVar('type');
$dispo = JRequest::getVar('dispo');
$maxtime = JRequest::getVar('maxtime');
$maxdays = JRequest::getVar('maxdays');
$cal = JRequest::getVar('cal');
$pax = JRequest::getVar('pax');
$ref = JRequest::getVar('ref');
$name = JRequest::getVar('name');
$s_situation = JRequest::getVar('s_situation');
$mer_a = JRequest::getVar('mer_a');
$mer_m = JRequest::getVar('mer_m');
$piste_a = JRequest::getVar('piste_a');
$piste_m = JRequest::getVar('piste_m');
$altitude = JRequest::getVar('altitude');
$altitude_m = JRequest::getVar('altitude_m');
$byorder = JRequest::getVar('byorder');
$max_page = JRequest::getVar('max_page');
$byorder2 = JRequest::getVar('byorder2');
$max_page2 = JRequest::getVar('max_page2');
$nb=JRequest::getVar('nb');
$debut = JRequest::getVar('debut');
 
$quickv = JRequest::getVar('quickv');
$msgquick ="";
//********IF QUICK SEARCH USED********
if($quickv)
{
 
$query ="SELECT * FROM --#__lbresa_continents where nom LIKE '%$quickv%' order by nom asc";
$db->setQuery( $query);
$allquickvs = $db->loadObjectList();
$NBquickvs = count($allquickvs);
 
 
if($NBquickvs==1)
{
 
foreach($allquickvs as $allquickv)
{
if($allquickv->id_parent==0)
{
$continent = $allquickv->id;
}
elseif($allquickv->id_parent>0 and $allquickv->pays==1)
{
$pays = $allquickv->id;
$continent = $allquickv->id_parent;
}
elseif($allquickv->id_parent>0 and $allquickv->region==1)
{
$region = $allquickv->id;
$pays = $allquickv->id_parent;
 
$query ="SELECT * FROM --#__lbresa_continents where id = '$pays'";
$db->setQuery( $query);
$adp = $db->loadObject();
 
$continent = $adp->id_parent;
 
}
elseif($allquickv->id_parent>0 and $allquickv->dep==1)
{
$dep = $allquickv->id;
$region = $allquickv->id_parent;
 
$query ="SELECT * FROM --#__lbresa_continents where id = '$region'";
$db->setQuery( $query);
$adp = $db->loadObject();
 
$pays = $adp->id_parent;
 
$query ="SELECT * FROM --#__lbresa_continents where id = '$pays'";
$db->setQuery( $query);
$adp = $db->loadObject();
 
$continent = $adp->id_parent;
 
 
}
elseif($allquickv->id_parent>0 and $allquickv->ville==1)
{
$ville = $allquickv->id;
$dep = $allquickv->id_parent;
 
$query ="SELECT * FROM --#__lbresa_continents where id = '$dep'";
$db->setQuery( $query);
$adp = $db->loadObject();
 
$region = $adp->id_parent;
 
$query ="SELECT * FROM --#__lbresa_continents where id = '$region'";
$db->setQuery( $query);
$adp = $db->loadObject();
 
$pays = $adp->id_parent;
 
$query ="SELECT * FROM --#__lbresa_continents where id = '$pays'";
$db->setQuery( $query);
$adp = $db->loadObject();
 
$continent = $adp->id_parent;
 
}
 
}//END forach 1
 
}//end if NBquick == 1
//***********************************************************************
 
if($NBquickvs>1)
{
 
echo "<h1>".JText::_( 'Vous recherchiez :' )."</h1>";
 
 
foreach($allquickvs as $allquickv)
{
 
 
echo "<form method='post' action='index.php?option=com_joomloc&view=engine&layout=advanced&action=find' id='form_$allquickv->id' name='form_$allquickv->id'>";
 
echo "<a href='javascript:document.form_$allquickv->id.submit();'><h4>".JText::_( 'LOCATION DE VACANCES, HEBERGEMENT :' )."</h4>";
 
if($allquickv->id_parent==0) { echo JText::_( 'Continent :' )." ".ucfirst($allquickv->nom)."</a>"; echo "<input type='hidden' name='continent' value='$allquickv->id'>"; }
if($allquickv->id_parent>0 and $allquickv->pays==1) { echo JText::_( 'Pays :' )." ".ucfirst($allquickv->nom)."</a>"; echo "<input type='hidden' name='pays' value='$allquickv->id'>"; }
 
if($allquickv->id_parent>0 and $allquickv->region==1) { echo JText::_( 'Region :' )." ".ucfirst($allquickv->nom)."</a>"; echo "<input type='hidden' name='region' value='$allquickv->id'>"; }
 
if($allquickv->id_parent>0 and $allquickv->dep==1) { echo JText::_( 'Departement :' )." ".ucfirst($allquickv->nom)."</a>"; echo "<input type='hidden' name='dep' value='$allquickv->id'>"; }
 
if($allquickv->id_parent>0 and $allquickv->ville==1) { echo JText::_( 'Ville :' )." ".ucfirst($allquickv->nom)."</a>"; echo "<input type='hidden' name='ville' value='$allquickv->id'>"; }
 
 
echo "</form><hr>";
}
 
 
}//end if nbquick > 1
 
 
 
}//END QUICK SEARCH DEFINE
//***********************************************************************
if($max_page != $max_page2 and $max_page2 or $byorder != $byorder2)
{
$nb=0;
$debut=0;
}
 
$today = date('Y-m-d H:i:s');
 
$date_d = JRequest::getVar( 'date_debut');
if(JRequest::getVar( 'mod_date_debut'))
{
$date_d = JRequest::getVar( 'mod_date_debut');
}
 
$date_f = JRequest::getVar( 'date_fin');
if(JRequest::getVar( 'mod_date_fin'))
{
$date_f = JRequest::getVar( 'mod_date_fin');
}
$date_debut_fr = JHTML::_('date', $date_d, '%d-%m-%Y');
$date_fin_fr = JHTML::_('date', $date_f, '%d-%m-%Y');
$date_debut = JHTML::_('date', $date_d, '%Y-%m-%d');
$date_fin= JHTML::_('date', $date_f, '%Y-%m-%d');
$nuits = round((strtotime($date_fin) - strtotime($date_debut))/(60*60*24));
$day_d = JHTML::_('date', $date_debut, '%d');
$day_m = JHTML::_('date', $date_debut, '%m');
$day_Y = JHTML::_('date', $date_debut, '%Y');
$day = date('D', mktime(0,0,0, $day_m, $day_d, $day_Y));
$mois = date('M', mktime(0,0,0, $day_m, $day_d, $day_Y));
$an = date('Y', mktime(0,0,0, $day_m, $day_d, $day_Y));
$cma = date('Y');
$cmm = date('M');
$cmM = date('m');
?>
<script language='javascript'>
 
function writenavresultsadv(texte)
{
var Box = document.getElementById("navresultsadv");
 
while (Box.firstChild) {
 
Box.removeChild(Box.firstChild);
 
}
 
var Ndiv = document.createElement("msgbox");
 
Ndiv.innerHTML = texte;
 
Box.appendChild(Ndiv);
 
//document.getElementById('navresultsadv').innerHTML = texte;
}
 
 
 
function navresultsadv(nbsites, limit, nb){
 
if(texte = file('index.php?option=com_joomloc&task=navresultsadv&nbsites='+nbsites+'&limit='+limit+'&nb='+nb))
{
writenavresultsadv(texte);
writenavresultsadv2(texte);
}
 
}
 
 
function writedivafflocsdispos(texte)
{
 
var Box = document.getElementById("afflocsdispo");
 
while (Box.firstChild) {
 
Box.removeChild(Box.firstChild);
 
}
 
var Ndiv = document.createElement("msgboxdispos");
 
Ndiv.innerHTML = texte;
 
Box.appendChild(Ndiv);
 
//document.getElementById('afflocsdispo').innerHTML = texte;
}
 
function afflocsdispo(nb, nb2, dispo)
{
 
if(dispo == 1)
{
texte = nb+" <?php echo JText::_( 'location(s) r&eacute;f&eacute;renc&eacute;e(s)')."<br>"; ?> "+nb2+" <?php echo JText::_( 'location(s) disponible(s)'); ?>";
}
else if(dispo == 0)
{
texte = ""+nb+" <?php echo JText::_( 'location(s) r&eacute;f&eacute;renc&eacute;e(s)'); ?>";
}
 
writedivafflocsdispos(texte);
}
 
function opendivadv()
{
document.getElementById('advanced').style.display ="block";
document.getElementById('opadvanced').style.display ="none";
document.getElementById('cladvanced').style.display ="block";
}
function closedivadv()
{
document.getElementById('advanced').style.display ="none";
document.getElementById('opadvanced').style.display ="block";
document.getElementById('cladvanced').style.display ="none";
}
 
function opendiv(div)
{
document.getElementById(div).style.display ="block";
document.getElementById('open_'+div).style.display ="none";
document.getElementById('close_'+div).style.display ="block";
}
 
function closediv(div, lien)
{
document.getElementById(div).style.display ="none";
document.getElementById('close_'+div).style.display ="none";
document.getElementById('open_'+div).style.display ="block";
}
 
function writedivGetpays(texte)
{
 
document.getElementById('selectpays').innerHTML = texte;
}
 
 
function getPays(id_cont, pays)
{
 
if(texte = file('index.php?option=com_joomloc&task=getPaysSelect&id_cont='+id_cont+'&pays='+pays))
{
 
writedivGetpays(texte);
 
}
 
}
 
 
function writedivGetregions(texte)
{
document.getElementById('selectregions').innerHTML = texte;
}
 
 
function getRegions(id_pays, region)
{
if(texte = file('index.php?option=com_joomloc&task=getRegionsSelect&id_pays='+id_pays+'&region='+region))
{
 
writedivGetregions(texte);
 
}
 
}
 
 
function writedivGetdeps(texte)
{
document.getElementById('selectdep').innerHTML = texte;
}
 
 
function getDeps(id_region, dep)
{
 
if(texte = file('index.php?option=com_joomloc&task=getDepsSelect&id_region='+id_region+'&dep='+dep))
{
 
writedivGetdeps(texte);
 
}
 
}
 
function writedivGetvilles(texte)
{
document.getElementById('selectvilles').innerHTML = texte;
}
 
 
function getVilles(id_dep, ville)
{
 
if(texte = file('index.php?option=com_joomloc&task=getVillesSelect&id_dep='+id_dep+'&ville='+ville))
{
 
writedivGetvilles(texte);
 
}
 
}
 
 
function file(fichier)
{
if(window.XMLHttpRequest) // FIREFOX
xhr_object = new XMLHttpRequest();
else if(window.ActiveXObject) // IE
xhr_object = new ActiveXObject("Microsoft.XMLHTTP");
else
return(false);
xhr_object.open("GET", fichier, false);
xhr_object.send(null);
if(xhr_object.readyState == 4) return(xhr_object.responseText);
else return(false);
}
</script>
 
 
<?php
if($msgquick)
{
echo $msgquick;
}
//****************************DEFAULT ADVANCED FORM DISPLAY****************
if($action) {
$display="none";
echo "<div id='wait' style='width:100%; text-align:center; display:block'><h2 style='width:100%; text-align:center'>".JText::_( 'Veuillez patienter' )."</h2><img src='".$myroot."/components/com_joomloc/images/loading.gif' border='0' width='120'></div>";
 
echo "<center><a href='javascript:opendivadv();' style='display:none' id='opadvanced'><b>".JText::_( 'Modifier les criteres' )."</b></a></center>";
echo "<center><a href='javascript:closedivadv();' style='display:none' id='cladvanced'><b>".JText::_( 'Fermer le formulaire' )."</b></a></center>";
 
} else { $display = "block"; }
?>
 
<div id="advanced" style="display:<?php echo $display; ?>">
<h4><?php echo JText::_( 'Recherches Avanc&eacute;es' ); ?></h4>
<h1><?php echo JText::_( 'Formulaire de recherches multi-crit&egrave;res' ); ?></h1>
<u><?php echo JText::_( 'Tous les crit&egrave;res sont optionnels.' ); ?></u><bR /><bR />
<form method="post" action="index.php?option=com_joomloc&view=engine&layout=advanced&action=find">
 
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><b><?php echo JText::_( 'Recherche par r&eacute;f&eacute;rence de l annonce :' ); ?></b></td>
<td><input type="text" class="inputbox" name="ref" size="10" value="<?php echo $ref; ?>" /></td>
<td><u style="font-size:smaller"><?php echo JText::_( 'Indiquer le num&eacute;ro de l annonce puis valider' ); ?></u></td>
</tr>
<tr>
<td><b><?php echo JText::_( 'Nom:' ); ?></b></td>
<td><input type="text" class="inputbox" name="name" size="10" value="<?php echo $name; ?>" /></td>
<td><u style="font-size:smaller"><?php echo JText::_( 'Indiquer le nom du site' ); ?></u></td>
</tr>
<tr>
<td><b><?php echo JText::_( 'Type de locations :' ); ?></b></td>
<td>
<select name="type" id="type" class="inputbox">
<?php
getTypes(0, $type);
?>
</select>
</td>
<td></td>
</tr>
 
<?php
if($this->config->cal > 0)
{
?>
<tr>
<td><b><?php echo JText::_( 'Type de dur&eacute;e :' ); ?></b></td>
<td>
 
<select name="cal" id="cal" class="inputbox">
<option value="" ><?php echo JText::_( 'Dur&eacute;e...' ); ?></option>
<option value="J" <?php if($cal=="J") { echo " selected "; } ?>><?php echo JText::_( 'Nuit' ); ?></option>
<option value="S" <?php if($cal=="S") { echo " selected "; } ?>><?php echo JText::_( 'Semaine' ); ?></option>
<option value="M" <?php if($cal=="M") { echo " selected "; } ?>><?php echo JText::_( 'Mois' ); ?></option>
</select>
</td>
<td></td>
</tr>
<?php
}
?>
<table width="100%">
</tr>
<tr>
<td valign="top">
<label for="greeting">
<?php echo JText::_( 'Personnes' ); ?>:
</label>
</td>
<td>
 
<select class="inputbox" name="pax" id="pax">
<option selected value=""><?php echo JText::_( 'Personnes' ); ?></option>
<option <?php if($room->pax==4) { echo " selected "; } ?> value="4" ><?php echo JText::_( '2/4 pers' ); ?></option>
<option <?php if($room->pax==6) { echo " selected "; } ?> value="6" ><?php echo JText::_( '4/6 pers' ); ?></option>
<option <?php if($room->pax==8) { echo " selected "; } ?> value="8"> <?php echo JText::_( '6/8 pers' ); ?></option>
 
</select>
</td>
 
</table>
<hr /><div id="waitoptions" style="width:100%; text-align:center"><h4 style="width:100%; text-align:center"><?php echo JText::_( 'Veuillez patienter'); ?></h4><img src='<?php echo $myroot."/components/com_joomloc/images/loading.gif"; ?>' border='0' width="80"></div>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<?php
if($this->config->adv_cont==0)
{
?>
<tr>
<td><b><?php echo JText::_( 'Continent :' ); ?></b></td>
<td><?php
if($action)
{
getContinentsSelect(1, $continent, 0);
}
else
{
getContinentsSelect(1, 0, 0);
}
 
?></td>
</tr>
<?php
}
?>
<?php
if($this->config->adv_pays==0)
{
?>
<tr>
<td><b><?php echo JText::_( 'Pays :' ); ?></b></td>
<td><div id="selectpays"></div></td>
</tr>
 
<?php
 
if($continent>0)
{
if(!$pays) { $pays =0; }
 
?>
<script>
getPays(<?php echo $continent.", ".$pays; ?>);
</script>
<?php
}
 
}
?>
 
 
<?php
if($this->config->adv_region==0)
{
?>
<tr>
<td><b><?php echo JText::_( 'R&eacute;gion :' ); ?></b></td>
<td><div id="selectregions"></div></td>
</tr>
<?php
 
if($pays>0)
{
if(!$region) { $region =0; }
?>
<script>
getRegions(<?php echo $pays.", ".$region; ?>);
</script>
<?php
}
}
?>
<?php
if($this->config->adv_dep==0)
{
?>
<tr>
<td><b><?php echo JText::_( 'D&eacute;partement :' ); ?></b></td>
<td><div id="selectdep"></div></td>
</tr>
<?php
 
if($region>0)
{
if(!$dep) { $dep =0; }
?>
<script>
getDeps(<?php echo $region.", ".$dep; ?>);
</script>
<?php
}
}
?>
<tr>
<td><b><?php echo JText::_( 'Ville :' ); ?></b></td>
<td><div id="selectvilles"></div></td>
</tr>
<?php
 
if($dep>0)
{
if(!$ville) { $ville =0; }
?>
<script>
getVilles(<?php echo $dep.", ".$ville; ?>);
</script>
<?php
}
?>
 
</table>
 
 
<?php
if($this->config->adv_cont==1)
{
getContinentsSelect(0, $this->config->adv_cont_id, $pays);
}
 
if($this->config->adv_pays==1)
{
if(!$region) { $region=0; }
?>
<script>
getRegions(<?php echo $this->config->adv_pays_id.", ".$region; ?>);
</script>
<?php
}
if($this->config->adv_region==1)
{
if(!$dep) { $dep=0; }
?>
<script>
getDeps(<?php echo $this->config->adv_region_id.", ".$dep; ?>);
</script>
<?php
}
if($this->config->adv_dep==1)
{
if(!$ville) { $ville=0; }
?>
<script>
getVilles(<?php echo $this->config->adv_dep_id.", ".$ville; ?>);
</script>
<?php
}
?>
<hr />
<?php
 
$d=date('d'); $m=date('m'); $y=date('Y');
$du = date("d-m-Y", mktime(0, 0, 0, $m ,$d, $y));
$au = date("d-m-Y", mktime(0, 0, 0, $m ,$d+1, $y));
 
$du = JHTML::_('date', $du, JText::_( '%D-%M-%Y'));
$au = JHTML::_('date', $au, JText::_( '%D-%M-%Y'));
 
 
?>
 
<table width="100%" border="0" cellpadding="0" cellspacing="">
<tr>
<td><b><?php echo JText::_( 'Disponibilit&eacute;s :' ); ?></b></td>
<td><?php echo JText::_( 'Du:' ); ?></td>
<td><input class="inputbox" type="text" name="date_debut" id="date_debut" size="11" value="<?php if($date_d) { echo $date_debut_fr; } else { echo $du; } ?>" />
<img src="templates/system/images/calendar.png" alt="calendar" name="intro_date_img" align="absbottom" class="calendar" id="intro_date_img" />
<script type="text/javascript">
Calendar.setup(
{
inputField : "date_debut", // ID of the input field
ifFormat : "<?php echo JText::_( '%D-%M-%Y'); ?>", // the date format
button : "intro_date_img" // ID of the button
}
);
</script> </td>
<td><?php echo JText::_( 'Au :' ); ?></td>
<td>
<input class="inputbox" type="text" name="date_fin" id="date_fin" size="11" value="<?php if($date_f) { echo $date_fin_fr; } else { echo $au; } ?>" />
<img src="templates/system/images/calendar.png" alt="calendar" name="intro_date_img2" align="absbottom" class="calendar" id="intro_date_img2" />
<script type="text/javascript">
Calendar.setup(
{
inputField : "date_fin", // ID of the input field
ifFormat : "<?php echo JText::_( '%D-%M-%Y'); ?>", // the date format
button : "intro_date_img2" // ID of the button
}
);
</script>
 
</td>
</tr>
<tr><td colspan="5" align="center"><input type='checkbox' name='dispo' id='dispo' value='1' <?php if($dispo) { echo " checked"; } ?>><?php echo JText::_( 'Afficher uniquement les locations proposant des disponibilit&eacute;s' ); ?></td>
</tr>
<tr><td colspan="5" align="center">
<input type='checkbox' name='maxtime' id='maxtime' value='1' <?php if($maxtime) { echo " checked"; } ?>>
<?php echo JText::_( 'Ne s&eacute;lectionner que les annonces r&eacute;centes de moins de' ); ?>
<input type='text' name='maxdays' class="inputbox" id='maxdays' size="3" value='<?php if($maxdays) { echo "$maxdays"; } else { echo "15"; } ?>'><?php echo JText::_( 'jours' ); ?></td>
</tr>
</table>
<hr />
<h2 style="width:100%; text-align:center"><?php echo JText::_( 'Criteres pratiques' ); ?></h2>
<a href="javascript:opendiv('situation');" id="open_situation" style="display:block"><b><?php echo JText::_( 'Environnement' ); ?></b></a>
<a href="javascript:closediv('situation');" id="close_situation" style="display:none"><b><?php echo JText::_( 'Fermer Environnement' ); ?></b></a>
<div id="situation" class="divadvanced" style="display:none">
 
<table width="100%">
</tr>
<tr>
<td valign="top">
<label for="greeting">
<?php echo JText::_( 'Situation' ); ?>:
</label>
</td>
<td>
<select class="inputbox" name="s_situation" id="s_situation">
<option selected value=""><?php echo JText::_( 'S&eacute;lectionnez une situation' ); ?></option>
 
<option <?php if($s_situation==1) { echo " selected "; } ?> value="1"><?php echo JText::_( 'Mer' ); ?></option>
<option <?php if($s_situation==2) { echo " selected "; } ?> value="2"><?php echo JText::_( 'Campagne' ); ?></option>
<option <?php if($s_situation==3) { echo " selected "; } ?> value="3"><?php echo JText::_( 'Montagne' ); ?></option>
<option <?php if($s_situation==4) { echo " selected "; } ?> value="4"><?php echo JText::_( 'Grande ville' ); ?></option>
</select>
 
</td>
<td>
 
</td>
</tr>
<tr>
<td valign="top">
<label for="greeting">
<?php echo JText::_( 'Distance Mer (si concerne)' ); ?>:
</label>
</td>
<td>
<input type="text" class="inputbox" name="mer_a" id="mer_a" size="11" maxlength="10" value="<?php echo $mer_a; ?>" />
<select name="mer_m">
<option value="Km">Km</option>
<option <?php if($mer_m=="m") { echo " selected "; } ?> value="m">m</option>
</select>
</td>
<td>
 
</td>
</tr>
<tr>
<td valign="top">
<label for="greeting">
<?php echo JText::_( 'Distance Pistes (si concerne)' ); ?>:
</label>
</td>
<td>
<input type="text" class="inputbox" name="piste_a" id="piste_a" size="11" maxlength="10" value="<?php echo $piste_a; ?>" />
<select name="piste_m">
<option value="Km">Km</option>
<option <?php if($piste_m=="m") { echo " selected "; } ?> value="m">m</option>
</select>
 
</td>
<td>
 
</td>
</tr>
<tr>
<td valign="top">
<label for="greeting">
<?php echo JText::_( 'Altitude (si concerne)' ); ?>:
</label>
</td>
<td>
<input type="text" class="inputbox" name="altitude" id="altitude" size="11" maxlength="10" value="<?php echo $altitude; ?>" />
<select name="altitude_m">
 
<option value="m">m</option>
<option <?php if($altitude_m=="foot") { echo " selected "; } ?> value="foot">foot/pieds</option>
 
</select>
</td><td></td>
</tr>
</table>
 
</div><br />
<?php
 
if($action)
{
$infos = JRequest::getVar( 'info' );
}
else { $infos=0; }
GetAlloptionschoice($infos);
 
?>
 
<center><input type="submit" value="<?php echo JText::_( 'Rechercher'); ?> >>" class="button" /></center>
</form>
</div>
<?php
//***********************END OF DISLYING THE DEFAULT ACTION FORM
 
if($action)
{
echo "<br><br>";
$infos = JRequest::getVar( 'info' );
$nbinfos = count($infos);
 
 
$and = "";
 
if($type){ $and .=" and s_type = $type "; }
if($continent){ $and .=" and s_continent = $continent "; }
if($pays){ $and .=" and s_pays = $pays "; }
if($region){ $and .=" and s_region = $region "; }
if($dep){ $and .=" and s_dep = $dep "; }
if($ville){ $and .=" and s_ville = $ville "; }
if($s_situation){ $and .=" and s_situation = $s_situation "; }
if($pax>0){ $and .=" and exists(select ro.id from --#__lbresa_rooms as ro where ro.id=id and ro.published>0 and ro.pax>=$pax and ro.pax<=$pax ) "; }
if($name) { $and .=" and s_nom LIKE '%$name%' "; }
if($mer_a)
{
 
$and .=" and mer_a <= $mer_a and mer_m = '$mer_m' ";
 
}
if($piste_a)
{
$and .=" and piste_a <= $piste_a and piste_m = '$piste_m' ";
if($altitude) { $and .= " altitude <= $altitude and altitude_m = '$altitude_m' "; }
}
if($maxtime) { $and .= " and DATE_SUB(CURDATE(),INTERVAL $maxdays DAY) < create_date "; }
 
 
if($ref){ $and =" and id = $ref "; } // if ref present, then the search only do on this criteria
 
 
 
 
 
if($dispo>0 and !$date_debut or $dispo>0 and !$date_fin or $dispo>0 and !$date_d or $dispo>0 and !$date_f)
{
echo "<div id='error' style='color:red; font-weight:bold; font-size:14px; width:100%; text-align:center'>".JText::_( 'Erreur : Veuillez indiquer des dates au format valide : jj-mm-aaaa')."</div>";
echo "<FORM><table width='100%'><tr><td width='100%' align='center'><bR><INPUT TYPE='button' VALUE='<< ".JText::_( 'Retour au formulaire' )."' onClick='history.back()'></td></tr></table></FORM>";
}
else {
echo "<div id='afflocsdispo' style='width:100%; text-align:center; font-weight:bold;'></div><bR>";
echo "<div id='afflocsdispo2' style='width:100%; text-align:center; font-weight:bold'></div><br>";
}
 
 
 
 
 
if($byorder == "dateasc") { $order = " order by create_date asc "; }
elseif($byorder == "datedesc" or !$byorder) { $order = " order by create_date desc "; if(!$byorder) { $byorder= "datedesc"; } }
elseif($byorder == "priceasc") { $order = " order by best_price asc "; }
elseif($byorder == "pricedesc") { $order = " order by best_price desc "; }
elseif($byorder == "sit") { $order = " order by s_situation asc "; }
else { $order = " order by create_date desc "; }
 
 
echo "<form method='post' action='index.php?option=com_joomloc&view=engine&layout=advanced&action=find'>";
echo "<table border='0'>
<tr>
<td>"
;
echo "<select name='byorder' class='inputbox' onchange='this.form.submit()'>
<option value=''>"
.JText::_( 'Classement r&eacute;sultats')."</option>
<option"
; if($byorder == "datedesc") { echo " selected "; } echo " value='datedesc'>".JText::_( 'Date de publication desc')."</option>
<option"
; if($byorder == "dateasc") { echo " selected "; } echo " value='dateasc'>".JText::_( 'Date de publication asc')."</option>
<option"
; if($byorder == "priceasc") { echo " selected "; } echo " value='priceasc'>".JText::_( 'Prix croissant')."</option>
<option"
; if($byorder == "pricedesc") { echo " selected "; } echo " value='pricedesc'>".JText::_( 'Prix d&eacute;croissant')."</option>
<option"
; if($byorder == "sit") { echo " selected "; } echo " value='sit'>".JText::_( 'Situation')."</option>
</select>"
;
 
 
 
echo "<input type='hidden' name='continent' value='$continent'>
<input type='hidden' name='pays' value='$pays'>
<input type='hidden' name='ville' value='$ville'>
<input type='hidden' name='dep' value='$dep'>
<input type='hidden' name='region' value='$region'>
<input type='hidden' name='type' value='$type'>
<input type='hidden' name='dispo' value='$dispo'>
<input type='hidden' name='maxtime' value='$maxtime'>
<input type='hidden' name='maxdays' value='$maxdays'>
<input type='hidden' name='cal' value='$cal'>
<input type='hidden' name='pax' value='$pax'>
<input type='hidden' name='ref' value='$ref'>
<input type='hidden' name='s_situation' value='$s_situation'>
<input type='hidden' name='mer_a' value='$mer_a'><input type='hidden' name='mer_m' value='$mer_m'>
<input type='hidden' name='piste_a' value='$piste_a'><input type='hidden' name='piste_m' value='$piste_m'>
<input type='hidden' name='altitude' value='$altitude'><input type='hidden' name='altitude_m' value='$altitude_m'>
<input type='hidden' name='date_debut' value='$date_debut'><input type='hidden' name='date_fin' value='$date_fin'>"
;
 
if($infos)
{
foreach($infos as $info) {
 
echo "<input type='hidden' name='info[]' value='$info'>";
 
}
 
}// END IF INFOS
 
echo "</td><td>";
echo "<select name='max_page' class='inputbox' onchange='this.form.submit()'>
<option selected value='"
.$this->config->loc_page."'>".$this->config->loc_page." ".JText::_( 'r&eacute;sultats par page')."</option>";
$nbr = $this->config->loc_page;
 
for($i=0; $i<=4; $i++)
{
$nbr = $nbr + 10;
echo "<option"; if($max_page == "$nbr") { echo " selected "; } echo " value='$nbr'>$nbr ".JText::_( 'r&eacute;sultats par page')."</option>";
 
}
 
echo "</select>";
echo "<input type='hidden' name='max_page2' value='$max_page'>";
echo "<input type='hidden' name='byorder2' value='$byorder'>";
echo "</td><td>";
echo "<div id='navresultsadv' style='width:100%'></div>";
echo "</tD></tr></table>";
echo "</form><bR>";
 
 
if($max_page)
{
$limit = $max_page;
}
else
{
$limit = $this->config->loc_page;
}
 
if(!$nb) { $nb=0; }
 
 
if($debut==""){$debut=0;}
 
$debut=$nb*$limit;
 
 
 
$query = "SELECT * FROM --#__lbresa_sites where published = 1 $and $order";
$db->setQuery( $query);
$allsites= $db->loadObjectList();
$nballsites= count($db->loadObjectList());
 
 
echo "<div id='results' class='module-results'>
<table border='0' cellpadding='0' cellspacing='0'>"
;
 
$l=0;
 
 
$u=0;
$tableau = array();
 
foreach($allsites as $site)
{
 
 
 
if($infos)
{
$i=0;
foreach($infos as $info) {
 
$query = "SELECT info FROM --#__lbresa_infos_sites where id_info='$info' and id_site='$site->id' and act > 0";
 
$db->setQuery( $query);
$allinfos= count($db->loadObject());
 
if($allinfos>0) { $i++; }
 
}
 
}// END IF INFOS
 
 
if(!$infos or $i==$nbinfos)
{
$c=0;
if($cal)
{
 
$query = "SELECT cal FROM --#__lbresa_rooms where id_site='$site->id' and cal='$cal' and published > 0";
$db->setQuery( $query);
$nbcals= count($db->loadObjectList());
 
if($nbcals>0) { $c++; }
 
}
 
if(!$cal or $nbcals>0)
{
 
 
$tableau[$u] = $site->id; $u++;
 
 
}// END FOR CALENDAR TYPE CONTROL : NO CAL OR CAL TYPE IS EXIST
 
 
}// // END IF NO INFO OR LOCATION OPTIONS = ASKING OPTIONS
 
}//end for each sites
 
 
if($limit>$u)
{
$limit2 = $u;
}
else
{
$limit2 = $debut+$limit;
}
 
 
if(!$dispo)// displaying location respond of all the criterias
{
$k=1;
if($limit2>$u) { $limit2 = $u; }
for($i=$debut;$i<$limit2;$i++)
 
{
$query = "SELECT * FROM --#__lbresa_sites where id = ".$tableau[$i]."";
$db->setQuery( $query);
$site = $db->loadObject();
 
 
$query = "SELECT img FROM --#__lbresa_img where id_site = '$site->id' order by id asc limit 0, 1";
$db->setQuery( $query);
$ispic = count($db->loadObject());
$pic = $db->loadObject();
 
 
echo "<tr class='sectiontableentry$k' height='100'>";
echo "<td width='15%' align='center' valign='middle'>";
if($ispic>0) { echo "<a href='index.php?option=com_joomloc&controller=loc&view=loc&layout=loc&task=edit&cid[]=".$site->id."&id=".$site->id."&liste=".$site->s_dep."'><div id='roompic'><img src='".$myroot."/components/com_joomloc/images/vignettes/".$pic->img."' border='0' width='".$this->config->vwimg."'></a></div>"; }
else { echo "<a href='index.php?option=com_joomloc&controller=loc&view=loc&layout=loc&task=edit&cid[]=".$site->id."&id=".$site->id."&liste=".$site->s_dep."'><div id='roompic'><img src='".$myroot."/components/com_joomloc/images/no_picloc.png' border='0' width='".$this->config->vwimg."'></a></div>"; }
echo "</td><td width='85%' valign='top'>";
//----------display information
echo "<table border='0' cellpadding='0' cellspacing='0' width='100%'>";
echo "<tr>";
echo "<td colspan='2'><a class='linktoloc' href='index.php?option=com_joomloc&controller=loc&view=loc&layout=loc&task=edit&cid[]=".$site->id."&id=".$site->id."&liste=".$site->s_dep."'>".ucfirst($site->s_nom)."</a>";
echo "<b>";
if($site->s_niv and $site->s_nivnom) { echo " ".$site->s_niv; }
if($site->s_nivnom) { echo " ".$site->s_nivnom; }
echo " : </b>";
//villle
$query = "SELECT * FROM --#__lbresa_continents where id = $site->s_ville";
$db->setQuery( $query);
$ville = $db->loadObject();
echo "<a class='linktolocgeo' href='index.php?option=com_joomloc&controller=loc&view=loc&layout=loc&task=edit&cid[]=".$site->id."&id=".$site->id."&liste=".$site->s_dep."'>$ville->nom -> ";
 
//dep
$query = "SELECT * FROM --#__lbresa_continents where id = $site->s_dep";
$db->setQuery( $query);
$dep = $db->loadObject();
 
echo "$dep->nom -> ";
 
 
$query = "SELECT * FROM --#__lbresa_continents where id = $site->s_pays";
$db->setQuery( $query);
$pays = $db->loadObject();
 
echo "$pays->nom";
 
 
echo "</a>";
 
if($this->config->reviews==1) {
 
$query = "SELECT COUNT(id) FROM --#__lbresa_rew where id_site = '".$site->id."' and published>0";
$db->setQuery( $query );
$nbcomments = $db->loadResult();
 
getStars($site->id, $site->rew, $nbcomments);
}
 
 
 
 
echo "</td>";
echo "</tr>";
echo "<tr><td colspan='2'>";
echo "<table border='0' width='100%' cellpadding='0' cellspacing='0'>";
echo "<tr><td width='40%'>".JText::_( 'Annonce Ref :' )." $site->id</td>";
echo "<td class='modlocinfos'>";
 
$query = "SELECT type FROM --#__lbresa_types where id = '$site->s_type'";
$db->setQuery( $query);
$type= $db->loadObject();
 
echo "<b>$type->type</b> -> ";
 
if($site->s_situation == 1) { echo JText::_( 'Mer' ); }
if($site->s_situation == 2) { echo JText::_( 'Campagne' ); }
if($site->s_situation == 3) { echo JText::_( 'Montagne' ); }
if($site->s_situation == 4) { echo JText::_( 'Grande ville' ); }
echo "</td>";
echo "</tr>";
echo "</table>";
echo "</td></tr>";
echo "<tr>";
echo "<td valign='top'>";
 
$site->intro = ereg_replace("\n","<br>",$site->intro);
echo $site->intro;
 
echo "</td>";
echo "<td width='20%'>";
$query = "SELECT --#__lbresa_rooms.from, cal FROM --#__lbresa_rooms where id_site = '$site->id' and --#__lbresa_rooms.from > 0 order by --#__lbresa_rooms.from asc limit 0, 1";
$db->setQuery( $query);
$from= $db->loadObject();
$nbfrom= count($from);
 
 
 
if($nbfrom>0 and $from->from >0)
{
echo JText::_( 'A partir de :' )."<bR><b>".$from->from." ".$this->config->monaie."</b><bR>";
if($from->cal == "J") { echo JText::_( 'La nuit' ); }
elseif($from->cal == "S") { echo JText::_( 'La semaine' ); }
elseif($from->cal== "M") { echo JText::_( 'Le mois' ); }
 
}
"</td>";
echo "</tr>";
echo "<tr>";
echo "<td colspan='2'><a href='index.php?option=com_joomloc&controller=loc&view=loc&layout=loc&task=edit&cid[]=".$site->id."&id=".$site->id."&liste=".$site->s_dep."'>".JText::_( 'voir en details >>' )."</a></td>";
echo "</tr>";
 
echo "</table>";
//-------------------------------
echo "</td>";
echo "</tr>";
 
 
$k++;
if($k==3) { $k=1; }
$l++;
 
 
}// END DISPLAYING LOCATION no dispo wanted
}
 
//***********************
 
 
if($dispo)// if only location with disponibility is wanted
{
$k=1;
$location = array();
$h=0;
 
for($i=0;$i<$u;$i++)
 
{
$query = "SELECT * FROM --#__lbresa_sites where id = ".$tableau[$i]."";
$db->setQuery( $query);
$site = $db->loadObject();
 
 
$query = "SELECT * FROM --#__lbresa_rooms where id_site='$site->id'";
$db->setQuery( $query);
$rooms= $db->loadObjectList();
$d=0;
 
foreach($rooms as $room)
{
 
if($cal == "J" or $cal == "S" or !$cal and $room->cal!="M")
{
$query = "SELECT id FROM --#__lbresa_cal where id_room='$room->id' and date >= '$date_debut' and date < '$date_fin' and dispo > 0 and prix > 0";
 
}
elseif($cal == "M" or !$cal and $room->cal=="M")
{
if($an == $cma and $day_m <= $cmM) { $query=""; }
else
{
$query = "SELECT id FROM --#__lbresa_cal where id_room='$room->id' and mois = '$mois' and an = '$an' and dispo > 0 and prix > 0";
}
 
}
 
$db->setQuery( $query);
$dispos= count($db->loadObjectList());
 
 
 
$weekdispo = $nuits/7;
 
 
 
 
if($cal) { $andcal = " and $room->cal == $cal "; }
 
if($room->cal == "J" and $room->nb_nuits<=$nuits and $dispos==$nuits)
{
$d++;
}
if($room->cal == "S" and $room->nb_nuits<=$nuits and $dispos==$weekdispo and $room->jarrivee==$day)
{
 
$d++;
}
if($room->cal == "M" and $dispos>0 )
{
$d++;
}
 
 
}//ENF FOR EACH ROOM
 
if($d>0) { $location[$h] = $site->id; $h++; }
 
}//end FOR
 
 
if($limit>$h)
{
$limit2 = $h;
}
else
{
$limit2 = $debut+$limit;
}
 
if($limit2>$h) { $limit2 = $h; }
 
for($j=$debut;$j<$limit2;$j++)
 
{
$query = "SELECT * FROM --#__lbresa_sites where id = ".$location[$j]."";
$db->setQuery( $query);
$site = $db->loadObject();
 
 
$query = "SELECT img FROM --#__lbresa_img where id_site = '$site->id' order by id asc limit 0, 1";
$db->setQuery( $query);
$ispic = count($db->loadObject());
$pic = $db->loadObject();
 
 
echo "<tr class='sectiontableentry$k' height='100'>";
echo "<td width='15%' align='center' valign='middle'>";
if($ispic>0) { echo "<a href='index.php?option=com_joomloc&controller=loc&view=loc&layout=loc&task=edit&cid[]=".$site->id."&id=".$site->id."&liste=".$site->s_dep."'><div id='roompic'><img src='".$myroot."/components/com_joomloc/images/vignettes/".$pic->img."' border='0' width='".$this->config->vwimg."'></a></div>"; }
else { echo "<a href='index.php?option=com_joomloc&controller=loc&view=loc&layout=loc&task=edit&cid[]=".$site->id."&id=".$site->id."&liste=".$site->s_dep."'><div id='roompic'><img src='".$myroot."/components/com_joomloc/images/no_picloc.png' border='0' width='".$this->config->vwimg."'></a></div>"; }
echo "</td><td width='85%' valign='top'>";
//----------display information
echo "<table border='0' cellpadding='0' cellspacing='0' width='100%'>";
echo "<tr>";
echo "<td colspan='2'><a class='linktoloc' href='index.php?option=com_joomloc&controller=loc&view=loc&layout=loc&task=edit&cid[]=".$site->id."&id=".$site->id."&liste=".$site->s_dep."'>".ucfirst($site->s_nom)."</a>";
echo "<b>";
if($site->s_niv and $site->s_nivnom) { echo " ".$site->s_niv; }
if($site->s_nivnom) { echo " ".$site->s_nivnom; }
echo " : </b>";
//villle
$query = "SELECT * FROM --#__lbresa_continents where id = $site->s_ville";
$db->setQuery( $query);
$ville = $db->loadObject();
echo "<a class='linktolocgeo' href='index.php?option=com_joomloc&controller=loc&view=loc&layout=loc&task=edit&cid[]=".$site->id."&id=".$site->id."&liste=".$site->s_dep."'>$ville->nom -> ";
 
//dep
$query = "SELECT * FROM --#__lbresa_continents where id = $site->s_dep";
$db->setQuery( $query);
$dep = $db->loadObject();
 
echo "$dep->nom -> ";
 
 
$query = "SELECT * FROM --#__lbresa_continents where id = $site->s_pays";
$db->setQuery( $query);
$pays = $db->loadObject();
 
echo "$pays->nom";
 
 
echo "</a>";
 
if($this->config->reviews==1) {
 
$query = "SELECT COUNT(id) FROM --#__lbresa_rew where id_site = '".$site->id."' and published>0";
$db->setQuery( $query );
$nbcomments = $db->loadResult();
 
getStars($site->id, $site->rew, $nbcomments);
}
 
 
echo "</td>";
echo "</tr>";
echo "<tr><td colspan='2'>";
echo "<table border='0' width='100%' cellpadding='0' cellspacing='0'>";
echo "<tr><td width='40%'>".JText::_( 'Annonce Ref :' )." $site->id</td>";
echo "<td class='modlocinfos'>";
 
$query = "SELECT type FROM --#__lbresa_types where id = '$site->s_type'";
$db->setQuery( $query);
$type= $db->loadObject();
 
echo "<b>$type->type</b> -> ";
 
if($site->s_situation == 1) { echo JText::_( 'Mer' ); }
if($site->s_situation == 2) { echo JText::_( 'Campagne' ); }
if($site->s_situation == 3) { echo JText::_( 'Montagne' ); }
if($site->s_situation == 4) { echo JText::_( 'Grande ville' ); }
echo "</td>";
echo "</tr>";
echo "</table>";
echo "</td></tr>";
echo "<tr>";
echo "<td valign='top'>";
 
$site->intro = ereg_replace("\n","<br>",$site->intro);
echo $site->intro;
 
echo "</td>";
echo "<td width='20%'>";
$query = "SELECT --#__lbresa_rooms.from, cal FROM --#__lbresa_rooms where id_site = '$site->id' and --#__lbresa_rooms.from > 0 order by --#__lbresa_rooms.from asc limit 0, 1";
$db->setQuery( $query);
$from= $db->loadObject();
$nbfrom= count($from);
 
if($nbfrom>0 and $from->from >0)
{
echo JText::_( 'A partir de :' )."<bR><b>".$from->from." ".$this->config->monaie."</b><bR>";
if($from->cal == "J") { echo JText::_( 'La nuit' ); }
elseif($from->cal == "S") { echo JText::_( 'La semaine' ); }
elseif($from->cal== "M") { echo JText::_( 'Le mois' ); }
 
}
"</td>";
echo "</tr>";
echo "<tr>";
echo "<td colspan='2'><a href='index.php?option=com_joomloc&controller=loc&view=loc&layout=loc&task=edit&cid[]=".$site->id."&id=".$site->id."&liste=".$site->s_dep."'>".JText::_( 'voir en details >>' )."</a></td>";
echo "</tr>";
 
echo "</table>";
//-------------------------------
echo "</td>";
echo "</tr>";
 
 
$k++;
if($k==3) { $k=1; }
$l++;
 
 
}// END DISPLAYING LOCATION no dispo wanted
 
 
 
 
 
}// END IF ONLY DISPONIBILITY WANTED
 
 
 
 
 
 
 
echo "</table></div><bR>";
 
 
 
if(!$dispo)
{
$h="";
?>
<script>
 
afflocsdispo(<?php echo $u; ?>, 0, 0);
navresultsadv(<?php echo "$u, $limit, $nb"; ?>);
</script>
 
<?php
 
}//end script afflocdispos
if($dispo)
{
 
?>
<script>
afflocsdispo(<?php echo $u.", ".$h; ?>, 1);
navresultsadv(<?php echo "$h, $limit, $nb"; ?>);
</script>
 
<?php
 
}//end script afflocdispos
?>
<script>
document.getElementById('wait').style.display ="none";
document.getElementById('opadvanced').style.display ="block";
</script>
 
<?php
 
}// END ELSEIF ACTION
?>
Last Edit: 7 years, 10 months ago by kaza.

Re: Faire une recherche par nombre d'occupant 7 years, 10 months ago #1010

  • admin
  • OFFLINE
  • Administrateur
  • Posts: 397
  • Karma: 3
petite erreur

if($pax>0){ $and .=" and exists(select ro.id from --#__lbresa_rooms as ro  where ro.id_site=id and ro.published>0 and ro.pax>=$pax and ro.pax<=$pax ) "; }
Laubro

Re: Faire une recherche par nombre d'occupant 7 years, 10 months ago #1011

  • kaza
  • OFFLINE
  • Junior Boarder
  • Posts: 35
  • Karma: 0
tjours cette erreur ligne 926 avec le foreach


-> supprimé le foreach...plus d'erreur mais mauvais résultats
Last Edit: 7 years, 10 months ago by kaza.

Re: Faire une recherche par nombre d'occupant 7 years, 10 months ago #1012

  • admin
  • OFFLINE
  • Administrateur
  • Posts: 397
  • Karma: 3
Envoyez moi votre fichier comme il est avec cette erreur
Laubro

Re: Faire une recherche par nombre d'occupant 7 years, 10 months ago #1013

  • kaza
  • OFFLINE
  • Junior Boarder
  • Posts: 35
  • Karma: 0
This attachment is hidden for guests. Please log in or register to see it.
Time to create page: 0.61 seconds