compile_check = true; if (ISSET($_POST['lieu']) || isset($_SESSION['longitude']) || ISSET($_GET['lid'])) { $ortho=new orthodromie(); if (ISSET($_POST['lieu'])) { $coord=(explode(";",$_POST['lieu'])); $lieu=new lieu($coord[2]); $dataLieu=$lieu->get(); //session $_SESSION['rue']=$dataLieu['nom']; $_SESSION['codePostal']=$dataLieu['codePostal']; $_SESSION['ville']=$dataLieu['ville']; $_SESSION['numero']=""; $_SESSION['longitude']=$coord[0]; $_SESSION['latitude']=$coord[1]; } elseif (ISSET($_GET['lid'])) { $lieu=new lieu($_GET['lid']); $dataLieu=$lieu->get(); //session $_SESSION['rue']=$dataLieu['nom']; $_SESSION['codePostal']=$dataLieu['codePostal']; $_SESSION['ville']=$dataLieu['ville']; $_SESSION['numero']=""; $_SESSION['longitude']=$dataLieu['longitude']; $_SESSION['latitude']=$dataLieu['latitude']; $coord=array($_SESSION['longitude'],$_SESSION['latitude']); } else { $coord=array($_SESSION['longitude'],$_SESSION['latitude']); } $smarty->assign("listZone",array("800"=>"800m","1000"=>"1000m", "1200"=>"1200m","1400"=>"1400m","1600"=>"1600m","1800"=>"1800m","2000"=>"2000m")); $smarty->assign("listAnnonce",array("10"=>"10","20"=>"20","50"=>"50")); if (isset($_POST['zone'])) $_SESSION['zone']=$_POST['zone']; elseif (!isset($_SESSION['zone'])) $_SESSION['zone']=LIMITE_DISTANCE_PRIVE; if (isset($_POST['nbAnnonce'])) $_SESSION['nbAnnonce']=$_POST['nbAnnonce']; elseif (!isset($_SESSION['nbAnnonce'])) $_SESSION['nbAnnonce']=NB_ANNONCE_PRIVE; //parking prive //Pager $params = array( 'mode' => 'Sliding', 'append' => true, 'urlVar' => 'page', 'fileName' => 'index.php', 'itemData' => $ortho->searchPPrive($coord[0],$coord[1],$_SESSION['zone'],100), // 'itemData' => $ortho->searchPPrive($_SESSION['longitude'],$_SESSION['latitude'],LIMITE_DISTANCE_PRIVE,NB_ANNONCE_PRIVE), 'perPage' => $_SESSION['nbAnnonce'], 'delta' => 5 ); $pager = & Pager::factory($params); $data = $pager->getPageData(); if (is_array($data)) { $i=0; foreach ($data as $donnee) { $data2[$i]=$donnee; $i++; } } //geomarket $geo=new geomarket(); $geo->add(1,$_SESSION['rue'],$_SESSION['codePostal'],$_SESSION['ville'],$_SESSION['longitude'],$_SESSION['latitude']); $links = $pager->getLinks(); $smarty->assign("LINKS",$links['all']); $smarty->assign("liste",$data2); $smarty->assign("longitude",$_SESSION['longitude']); $smarty->assign("latitude",$_SESSION['latitude']); //rss $urlRSS="lon=".$_SESSION['longitude']."&lat=".$_SESSION['latitude']. "&dist=".$_SESSION['zone']."&type=-1&park=-1&haut=-1&bail=-1&vehicule=-1". "&jours=-1&hor=-1"; $smarty->assign("rss",ROOT_HTTP."rss/annonces_filtrees.php?".$urlRSS); //parking public $smarty->assign("listep",$ortho->searchPPublic($coord[0],$coord[1],$_SESSION['zone'],NB_ANNONCE_PUBLIC)); //pub $pub=new adsCampaign(); $smarty->assign("pub",$pub->findByGeolocalisation($_SESSION['longitude'],$_SESSION['latitude'])); $smarty->display('www/search/searchbyadress.tpl.htm'); } //$smarty->display('www/search/search2.tpl.htm'); ?>