Ajout filtre actif/inactif sur les établissements
This commit is contained in:
parent
14d8a253d7
commit
b9ce1b6bd3
@ -128,76 +128,33 @@ function iconeDuMarqueur($naf, $siege, $actif)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!page_checkParams()) die('Paramètres incorrects !');
|
||||||
|
|
||||||
$tabInfo = $_SESSION['tabInfo'];
|
$tabInfo = $_SESSION['tabInfo'];
|
||||||
|
|
||||||
$siret = trim(preg_replace('/[^0-9]/', '', $_REQUEST['siret']));
|
isset($_REQUEST['actif']) ? $actif = $_REQUEST['actif'] : $actif = -1;
|
||||||
if (strlen($siret) <> 0 &&
|
isset($_REQUEST['dep']) ? $dep = $_REQUEST['dep'] : $dep = 0;
|
||||||
strlen($siret) <> 9 &&
|
|
||||||
strlen($siret) <> 14) {
|
|
||||||
die('Paramètres incorrects !');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isset($_REQUEST['idEntreprise']) == true) {
|
|
||||||
// Si id = 0 alors non communiqué
|
|
||||||
$idEntreprise = trim(preg_replace('/[^0-9]/', '',
|
|
||||||
$_REQUEST['idEntreprise'])) * 1;
|
|
||||||
}
|
|
||||||
if (($siret * 1) == 0 && $idEntreprise == 0) {
|
|
||||||
die('Paramètres incorrects !');
|
|
||||||
}
|
|
||||||
$siren = substr($siret, 0, 9);
|
$siren = substr($siret, 0, 9);
|
||||||
$mil = false;
|
|
||||||
|
|
||||||
require_once 'partenaires/classMTva.php';
|
require_once 'partenaires/classMTva.php';
|
||||||
require_once 'partenaires/classMMap.php';
|
require_once 'partenaires/classMMap.php';
|
||||||
require_once 'common/dates.php';
|
require_once 'common/dates.php';
|
||||||
require_once 'cache/cache.php';
|
require_once 'scoresws/scoresws.php';
|
||||||
|
|
||||||
$firephp->log($_SERVER['SERVER_NAME'], 'SERVER_NAME');
|
|
||||||
switch ($_SERVER['SERVER_NAME']) {
|
switch ($_SERVER['SERVER_NAME']) {
|
||||||
case 'extranet.sd.com':
|
case 'extranetrec.scores-decisions.com':
|
||||||
$urlimg = 'http://extranetrec.scores-decisions.com/';
|
|
||||||
break;
|
|
||||||
case 'extranetrec.scores-decisions.com':
|
|
||||||
$urlimg = EXTRANET_URL;
|
$urlimg = EXTRANET_URL;
|
||||||
break;
|
break;
|
||||||
case 'extranet.scores-decisions.com':
|
case 'extranet.scores-decisions.com':
|
||||||
$urlimg = EXTRANET_URL;
|
$urlimg = EXTRANET_URL;
|
||||||
break;
|
break;
|
||||||
case 'extranet.devlocal.com':
|
default: // Impossible d'afficher la carte google maps
|
||||||
$urlimg = EXTRANET_URL;
|
$urlimg = 'http://extranet.scores-decisions.com/';
|
||||||
break;
|
|
||||||
default: // Impossible d'afficher la carte google maps
|
|
||||||
$urlimg = EXTRANET_URL;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($page2) == true) {
|
$etabs = scoresws_etablissements($siret, $siren, $idEntreprise, $dep, $actif);
|
||||||
if (($siret * 1) == 0 && ($siren * 1) < 100) {
|
|
||||||
$fileName = $page2.'-'.$idEntreprise;
|
|
||||||
} else {
|
|
||||||
$fileName = $page2.'-'.$siret;
|
|
||||||
}
|
|
||||||
cache_filename($fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (cache_exist() && !hasModeEdition()) {
|
|
||||||
$etabs = cache_get('etabs');
|
|
||||||
// Affichage d'un message d'erreur
|
|
||||||
if ($etabs === FALSE) {
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
try {
|
|
||||||
$O = $client->getListeEtablissements($siren);
|
|
||||||
$etabs = $O['result'];
|
|
||||||
} catch (SoapFault $fault) {
|
|
||||||
require_once 'soaperror.php';
|
|
||||||
processSoapFault($client, $fault, $tabInfo);
|
|
||||||
die();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$raisonSociale = $tabInfo['entrep']['raisonSociale'];
|
$raisonSociale = $tabInfo['entrep']['raisonSociale'];
|
||||||
|
|
||||||
$marqueurs = array();
|
$marqueurs = array();
|
||||||
|
@ -6,12 +6,11 @@ require_once 'partenaires/classMMap.php';
|
|||||||
require_once 'common/dates.php';
|
require_once 'common/dates.php';
|
||||||
require_once 'scoresws/scoresws.php';
|
require_once 'scoresws/scoresws.php';
|
||||||
|
|
||||||
$etabs = scoresws_etablissements($siret, $siren, $idEntreprise);
|
isset($_REQUEST['actif']) ? $actif = $_REQUEST['actif'] : $actif = -1;
|
||||||
if ($etabs === false) {
|
isset($_REQUEST['dep']) ? $dep = $_REQUEST['dep'] : $dep = 0;
|
||||||
exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
$raisonSociale = $_SESSION['tabInfo']['entrep']['raisonSociale'];
|
$raisonSociale = $_SESSION['tabInfo']['entrep']['raisonSociale'];
|
||||||
|
$etabs = scoresws_etablissements($siret, $siren, $idEntreprise, $dep, $actif);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<div id="center">
|
<div id="center">
|
||||||
@ -28,6 +27,20 @@ $raisonSociale = $_SESSION['tabInfo']['entrep']['raisonSociale'];
|
|||||||
<td width="200" class="StyleInfoLib">Raison Sociale</td>
|
<td width="200" class="StyleInfoLib">Raison Sociale</td>
|
||||||
<td width="350" class="StyleInfoData"><?=$raisonSociale?></td>
|
<td width="350" class="StyleInfoData"><?=$raisonSociale?></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td width="30"> </td>
|
||||||
|
<td width="200" class="StyleInfoLib">Actif/Inactif</td>
|
||||||
|
<td width="350" class="StyleInfoData">
|
||||||
|
<form name="options" method="post" action="<?=$_SERVER['REQUEST_URI']?>">
|
||||||
|
<select name="actif">
|
||||||
|
<option value="-1">Tous</option>
|
||||||
|
<option value="1">Actif</option>
|
||||||
|
<option value="0">Inactif</option>
|
||||||
|
</select>
|
||||||
|
<input type="submit" name="selection" value="Ok">
|
||||||
|
</form>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<h2>Établissements</h2>
|
<h2>Établissements</h2>
|
||||||
<table>
|
<table>
|
||||||
@ -36,12 +49,14 @@ $raisonSociale = $_SESSION['tabInfo']['entrep']['raisonSociale'];
|
|||||||
<td colspan="2" width="550" class="StyleInfoData">
|
<td colspan="2" width="550" class="StyleInfoData">
|
||||||
<table>
|
<table>
|
||||||
<?php
|
<?php
|
||||||
|
if (is_array($etabs) && count($etabs)>0)
|
||||||
|
{
|
||||||
foreach ($etabs as $i => $etab)
|
foreach ($etabs as $i => $etab)
|
||||||
{
|
{
|
||||||
if ($etab['Siege']==1) $type='siège ';
|
if ($etab['Siege']==1) $type = 'siège ';
|
||||||
else $type='établ. ';
|
else $type = 'établ. ';
|
||||||
if ($etab['Actif']==1) $type.='actif';
|
if ($etab['Actif']==1) $type.= 'actif';
|
||||||
else $type.='inactif';
|
else $type.= 'inactif';
|
||||||
|
|
||||||
if($etab['Nic']*1==0 || $etab['Nic']*1>=99990) $type.=' provisoire';
|
if($etab['Nic']*1==0 || $etab['Nic']*1>=99990) $type.=' provisoire';
|
||||||
|
|
||||||
@ -89,6 +104,7 @@ $raisonSociale = $_SESSION['tabInfo']['entrep']['raisonSociale'];
|
|||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
</table>
|
</table>
|
||||||
</td>
|
</td>
|
||||||
@ -96,17 +112,18 @@ $raisonSociale = $_SESSION['tabInfo']['entrep']['raisonSociale'];
|
|||||||
<tr>
|
<tr>
|
||||||
<td width="30"> </td>
|
<td width="30"> </td>
|
||||||
<td colspan="2" width="506" class="StyleInfoData">
|
<td colspan="2" width="506" class="StyleInfoData">
|
||||||
|
<?php
|
||||||
<?php
|
|
||||||
if (count($etabs) == 0) {
|
if (count($etabs) == 0) {
|
||||||
print 'Aucun établissement n\'est présent dans notre base';
|
?>
|
||||||
} else if (preg_match('/\bCARTES\b/i', $_SESSION['tabInfo']['pref'])) {
|
Aucun établissement n'est présent dans notre base
|
||||||
print '<iframe src="/?page=carte&siret='.$siren.
|
<?php
|
||||||
'" width=506 height=505 marginheight="1" marginwidth="1"'.
|
} elseif (hasPref('cartes')) {
|
||||||
' scrolling="No" frameborder=0></iframe>';
|
$iframe_href = '/?page=carte&siret='.$siren.'&actif='.$actif;
|
||||||
|
?>
|
||||||
|
<iframe src="<?=$iframe_href?>" width=506 height=505 marginheight="1" marginwidth="1" scrolling="No" frameborder=0></iframe>
|
||||||
|
<?php
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user