compile_check = true; if (ISSET($_GET['cp'])) { $tmp=trim($_GET['cp']); $codpos=substr($tmp,strlen($tmp)-5,strlen($tmp)); $ville=substr($tmp,0,strlen($tmp)-6); $park=new parkingPrive(); $parkp=new parkingPublic(); //code $map=new mappoint(); $map=new mappoint('','',trim($codpos),trim($ville)); //print_r($map->checkVilleCP()); $map->getGoogleMap(); $coord=$map->get(); $_SESSION['longitude']=$coord['longitude']; $_SESSION['latitude']=$coord['latitude']; $_SESSION['codePostal']=$codpos; $_SESSION['ville']=$ville; $_SESSION['rue']=''; $_SESSION['numero']=''; $smarty->assign("longitude",$coord['longitude']); $smarty->assign("latitude",$coord['latitude']); //zone 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; $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")); //Pager $params = array( 'mode' => 'Sliding', 'append' => true, 'urlVar' => 'page', 'fileName' => 'searchbyzipcode.php', 'itemData' => $park->findByCodePostal($codpos), '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++; } } $links = $pager->getLinks(); $smarty->assign("LINKS",$links['all']); $smarty->assign("liste",$data2); //geomarket $geo=new geomarket(); $geo->add(1,$_SESSION['rue'],$_SESSION['codePostal'],$_SESSION['ville'],$_SESSION['longitude'],$_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 //print_r($parkp->findByCodePostal($codpos)); $smarty->assign("listep",$parkp->findByCodePostal($codpos)); //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'); ?>