191 lines
4.4 KiB
PHP
191 lines
4.4 KiB
PHP
<?php
|
|
|
|
?>
|
|
<style>
|
|
#center{width:760px; padding-right:10px; padding-left:10px;}
|
|
.blockh2{margin:5px; }
|
|
</style>
|
|
<script>
|
|
$(document).ready(function(){
|
|
$('#listeModulesD').click(function(){
|
|
var display = $('#listeModules').css('display');
|
|
if(display=='none') $('#listeModules').css('display', 'block');
|
|
else $('#listeModules').css('display', 'none');
|
|
});
|
|
|
|
$('.lienModule').click(function(){
|
|
var value = $('input[name=req]').val();
|
|
var href = $(this).attr('href');
|
|
if(value!='') { $(this).attr('href', href+'&req='+value ); return true; }
|
|
else{ alert('Aucun identifiant saisi!'); return false; }
|
|
});
|
|
});
|
|
</script>
|
|
<div id="center">
|
|
<?php
|
|
if( $module=='autres' || $module=='' )
|
|
{
|
|
?>
|
|
<h1>Modules</h1>
|
|
<h2>Liste des modules FIBEN / FCC</h2>
|
|
<div class="blockh2">
|
|
<form name="rFibenM" method="post" action="#">
|
|
<label>Identifiant</label> <input type="text" name="req" value="<?=$req?>"/>
|
|
<span>SIREN ou clé BDF</span><br/>
|
|
<a href='#' id="listeModulesD">Afficher/masquer la liste des modules</a>
|
|
<ul id="listeModules">
|
|
<?php
|
|
$listModules = bdf_modules_fiben();
|
|
foreach($listModules as $id => $module)
|
|
{
|
|
if($module['liste']!==false){
|
|
?>
|
|
<li>
|
|
<a href="./?page=bdf&siret=<?=$siret?>&module=<?=$id?>" class="lienModule">
|
|
<?=$id?>. <?=$module['titre']?>
|
|
</a>
|
|
</li>
|
|
<?php
|
|
}
|
|
}
|
|
?>
|
|
<?php
|
|
$listModules = bdf_modules_fcc();
|
|
foreach($listModules as $id => $module)
|
|
{
|
|
if($module['liste']!==false){
|
|
?>
|
|
<li><a href="./?page=bdf&siret=<?=$siret?>&module=<?=$id?>"><?=$id?>. <?=$module['titre']?></a></li>
|
|
<?php
|
|
}
|
|
}
|
|
?>
|
|
</ul>
|
|
</form>
|
|
</div>
|
|
<br/>
|
|
<h2>Recherche FICP</h2>
|
|
<div class="blockh2">
|
|
<form name="rFicp" method="post" action="./?page=bdf">
|
|
<input type="hidden" name="module" value="G"/>
|
|
<input type="hidden" name="service" value="ficp"/>
|
|
<label>Clé BDF</label>
|
|
<input type="text" name="req"/>
|
|
<input type="submit" name="rFicp" value="Ok"/>
|
|
</form>
|
|
</div>
|
|
|
|
<h2>Recherche FCC</h2>
|
|
<div class="blockh2">
|
|
<form name="rFcc" method="post" action="./?page=bdf">
|
|
<input type="hidden" name="service" value="fcc"/>
|
|
<label>Mode</label>
|
|
<select name="module">
|
|
<option value="G">Simplifié</option>
|
|
<option value="D">Détaillé</option>
|
|
</select>
|
|
<label>Clé BDF</label>
|
|
<input type="text" name="req"/>
|
|
<input type="submit" name="rFcc" value="Ok"/>
|
|
</form>
|
|
</div>
|
|
|
|
<?php
|
|
/*
|
|
<h2>Recherche FIBEN</h2>
|
|
<div class="blockh2">
|
|
<form name="rFiben" method="post" action="./?page=bdf">
|
|
<input type="hidden" name="module" value="07"/>
|
|
<input type="hidden" name="service" value="fiben"/>
|
|
<label>Nom recherché</label>
|
|
<input type="text" name="denom"/>
|
|
<br/>
|
|
<label>Type</label>
|
|
<select name="type">
|
|
<option value="">Choix</option>
|
|
<option value="J">Personne morale</option>
|
|
<option value="X">Personne physique</option>
|
|
<option value="S">Personne morale sur le sigle</option>
|
|
</select>
|
|
<br/>
|
|
<label>Code département</label>
|
|
<input type="text" size="3" name="code"/>
|
|
<br/>
|
|
<label>Recherche Etendue</label>
|
|
<input type="checkbox" value="O" name="rechet"/>
|
|
<br/>
|
|
<label>Code Activité APE</label>
|
|
<input type="text" name="ape"/>
|
|
<input type="submit" name="rFiben" value="Ok"/>
|
|
</form>
|
|
</div>
|
|
*/
|
|
?>
|
|
|
|
<?php
|
|
}
|
|
else
|
|
{
|
|
$firephp->log($service, 'service');
|
|
$firephp->log($module, 'module');
|
|
$func_module = 'bdf_modules_'.$service;
|
|
$listModules = $func_module();
|
|
|
|
//Vérifier que le module existe
|
|
if(array_key_exists($module, $listModules))
|
|
{
|
|
$rech = array();
|
|
$rech = array(
|
|
'denom' => $denom,
|
|
'type' => $type,
|
|
'code' => $code,
|
|
'rechet' => $rechet,
|
|
'ape' => $ape,
|
|
);
|
|
|
|
//http://protectel.scrypto.fr/iBDF/RequeteLanceur.php?Etablissement=12345&Guichet=00001&Utilisateur=Dupont&MDP=&Profil=Agence&Service=FIBEN&Denom=peugeot&Req=&TypeOp=07
|
|
$url = bdf_lien_module($module, $service, $req, $rech);
|
|
|
|
if($module=='07'){
|
|
$filename = false;
|
|
}
|
|
else
|
|
{
|
|
$filename = PATH_DATA.'/bdf/bdf_'.$service.'_'.$req.'_'.$module.'.html';
|
|
}
|
|
|
|
if($filename!==false && file_exists($filename))
|
|
{
|
|
$content = file_get_contents($filename);
|
|
}
|
|
else
|
|
{
|
|
$content = trim(bdf_loadpage($url));
|
|
if( !empty($content) && $filename!==false )
|
|
{
|
|
if(!file_exists(PATH_DATA.'/bdf')) mkdir(PATH_DATA.'/bdf');
|
|
file_put_contents($filename, $content);
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
$titreModule = $module.'. '.$listModules[$module]['titre'];
|
|
?>
|
|
<h1>Module <?=$titreModule?></h1>
|
|
<div class="blockh2">
|
|
<?php
|
|
|
|
if(!empty($content))
|
|
{
|
|
echo $content;
|
|
}else{
|
|
echo 'ERREUR';
|
|
}
|
|
?>
|
|
</div>
|
|
<?php
|
|
}
|
|
?>
|
|
</div>
|
|
<?php
|