124 lines
4.5 KiB
PHP
124 lines
4.5 KiB
PHP
|
<?php
|
|||
|
$firephp->log($_SESSION, 'SESSION');
|
|||
|
|
|||
|
if(isset($_REQUEST['paysCode'])){
|
|||
|
$paysCode = $_REQUEST['paysCode'];
|
|||
|
}else{
|
|||
|
$paysCode = $_SESSION['graydon']['paysCode'];
|
|||
|
}
|
|||
|
$firephp->log($paysCode, 'paysCode');
|
|||
|
|
|||
|
$tabInfo = $_SESSION['tabInfo'];
|
|||
|
$mode = $_SESSION['graydon']['mode'];
|
|||
|
|
|||
|
require_once 'dbbootstrap.php';
|
|||
|
require_once 'graydon/graydonws.php';
|
|||
|
require_once 'graydon/graydon_log.php';
|
|||
|
|
|||
|
setDbConn('graydon');
|
|||
|
$q = Doctrine_Query::Create()
|
|||
|
->select('graydon_country')
|
|||
|
->from('Country')
|
|||
|
->where('code = ?', $paysCode);
|
|||
|
|
|||
|
$result = $q->fetchOne();
|
|||
|
$pays = $result->graydon_country;
|
|||
|
|
|||
|
$firephp->log($pays, 'pays');
|
|||
|
|
|||
|
$_SESSION['graydon']['paysCode'] = $paysCode;
|
|||
|
$_SESSION['graydon']['pays'] = $pays;
|
|||
|
|
|||
|
//Disponibilit<69> des pays
|
|||
|
$availability = getCountryAvailability($pays);
|
|||
|
|
|||
|
//M<>thodes de recherche disponible pour les pays
|
|||
|
$methods = getCompanyMatchMethods($pays);
|
|||
|
$firephp->log($methods,'methods');
|
|||
|
if (is_array($methods)){
|
|||
|
$firephp->log($methods,'methods');
|
|||
|
//Affichage de la meilleur m<>thode de recherche OU la premi<6D>re
|
|||
|
$lien = 'La meilleure m<>thode de recherche vous est affich<63> par d<>faut.<br/> Effectuer un autre type recherche : ';
|
|||
|
$flagBestMethod = false;
|
|||
|
$countMethods = 0;
|
|||
|
foreach($methods as $item){
|
|||
|
$WithCity = $item->WithCity;
|
|||
|
$WithPostCode = $item->WithPostCode;
|
|||
|
if( ($item->BestMethod==TRUE && $item->MatchingMethod=='Keyword') && !isset($method) || $method=='keyword' ){
|
|||
|
$flagBestMethod = TRUE;
|
|||
|
require_once realpath(dirname(__FILE__)).'/method_keyword.php';
|
|||
|
}elseif( ($item->BestMethod==TRUE && $item->MatchingMethod=='Identifier') && !isset($method) || $method=='identifier' ){
|
|||
|
$flagBestMethod = TRUE;
|
|||
|
require_once realpath(dirname(__FILE__)).'/method_identifier.php';
|
|||
|
}elseif( ($item->BestMethod==TRUE && $item->MatchingMethod=='Name') && !isset($method) || $method=='name' ){
|
|||
|
$flagBestMethod = TRUE;
|
|||
|
require_once realpath(dirname(__FILE__)).'/method_name.php';
|
|||
|
}elseif( ($item->BestMethod==TRUE && $item->MatchingMethod=='PostCode') && !isset($method) || $method=='postcode' ){
|
|||
|
$flagBestMethod = TRUE;
|
|||
|
require_once realpath(dirname(__FILE__)).'/method_postcode.php';
|
|||
|
}
|
|||
|
$countMethods++;
|
|||
|
//Affichage des propostions des m<>thodes de recherche
|
|||
|
if($item->MatchingMethod=='Keyword'){ $lien .= '<a href="?page=international_recherche&mode=normal&method=keyword">Par mots cl<63>s</a>'; }
|
|||
|
if($item->MatchingMethod=='Identifier'){ $lien .= '<a href="?page=international_recherche&mode=normal&method=identifier">Par identifiant</a>'; }
|
|||
|
if($item->MatchingMethod=='Name'){ $lien .= '<a href="?page=international_recherche&mode=normal&method=name">Par nom</a>'; }
|
|||
|
if($item->MatchingMethod=='PostCode'){ $lien .= '<a href="?page=international_recherche&mode=normal&method=postcode">Par Post Code</a>'; }
|
|||
|
if($countMethods>=count($methods)){ $separator=''; break; }else{ $separator=' - '; }
|
|||
|
$lien = $lien.$separator;
|
|||
|
}
|
|||
|
print '<span class="left">'.$lien.'</span>';
|
|||
|
|
|||
|
}elseif($methods=='nomethods'){
|
|||
|
|
|||
|
print '<div>Il n\'est pas possible de faire une recherche dans la base de ce pays.';
|
|||
|
//V<>rification des droits
|
|||
|
if(preg_match('/international/i', $_SESSION['tabInfo']['droits'])){
|
|||
|
//print 'Pour commander une enqu<71>te sur ce pays rendez-vous sur cette <a href="/?page=international_enquete&pays='.$pays.'">page</a>.';
|
|||
|
print 'Pour commander une enqu<71>te sur ce pays rendez-vous sur cette <a href="#">page</a>.';
|
|||
|
}else{
|
|||
|
print 'Vous n\'avez pas les droits n<>cessaires pour commander une enqu<71>te sur ce pays.';
|
|||
|
}
|
|||
|
print '</div>';
|
|||
|
|
|||
|
}else{
|
|||
|
print $methods;
|
|||
|
}
|
|||
|
|
|||
|
//Intersud
|
|||
|
/*
|
|||
|
setDbConn('intersud');
|
|||
|
$q = Doctrine_Query::Create()
|
|||
|
->select('id, intersud_country')
|
|||
|
->from('Country')
|
|||
|
->where('code = ?', $paysCode);
|
|||
|
$result = $q->fetchOne();
|
|||
|
|
|||
|
$idPays = $result->id;
|
|||
|
|
|||
|
$q = Doctrine_Query::Create()
|
|||
|
->from('Price')
|
|||
|
->where('country_id = ?', $idPays);
|
|||
|
$price = $q->fetchOne();
|
|||
|
|
|||
|
$q = Doctrine_Query::Create()
|
|||
|
->from('Delais')
|
|||
|
->where('country_id = ?', $idPays);
|
|||
|
$delais = $q->fetchOne();
|
|||
|
|
|||
|
if($result && $price && $delais){
|
|||
|
$pays = $result->intersud_country;
|
|||
|
?>
|
|||
|
<br/>
|
|||
|
<div>
|
|||
|
<h3>Commander une enqu<EFBFBD>te terrain</h3>
|
|||
|
Tarifs :
|
|||
|
<table>
|
|||
|
<tr><td>Mode normal : </td><td><?php print $price->normal; ?></td><td>, D<>lais : </td><td><?php if($delais->normalDe==0){ print $delais->normalA.' jours'; }else{ print $delais->normalDe.' <20> '.$delais->normalA.' jours'; } ?></td></tr>
|
|||
|
<tr><td>Mode rapide : </td><td><?php print $price->rapide; ?></td><td>, D<>lais : </td><td><?php if($delais->rapideDe==0){ print $delais->rapideA.' jours'; }else{ print $delais->rapideDe.' <20> '.$delais->rapideA.' jours'; } ?></td></tr>
|
|||
|
</table>
|
|||
|
Cliquer ici pour acc<EFBFBD>der au formulaire.
|
|||
|
</div>
|
|||
|
<?php
|
|||
|
}
|
|||
|
*/
|
|||
|
?>
|