Delete
This commit is contained in:
parent
562097a5a1
commit
0a68210584
@ -1,185 +0,0 @@
|
||||
<?php
|
||||
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
|
||||
{
|
||||
protected function _initConfig()
|
||||
{
|
||||
$config = new Zend_Config($this->getOptions());
|
||||
Zend_Registry::set('config', $config);
|
||||
|
||||
//Load old config
|
||||
require_once 'WsScore/Configure.php';
|
||||
$oldconfig = new Configure();
|
||||
|
||||
return $config;
|
||||
}
|
||||
|
||||
//Initialisation global des paramètres de vue
|
||||
protected function _initViewSettings()
|
||||
{
|
||||
$this->bootstrap('view');
|
||||
$view = $this->getResource('view');
|
||||
$view->setEncoding('UTF-8');
|
||||
$view->doctype('HTML5');
|
||||
$view->headMeta()
|
||||
->appendHttpEquiv('Content-Type', 'text/html; charset=UTF-8')
|
||||
->appendHttpEquiv('Content-Language', 'fr-FR');
|
||||
$view->headLink()
|
||||
->appendStylesheet('/styles/reset.css', 'all')
|
||||
->appendStylesheet('/styles/main.css', 'all');
|
||||
$view->headScript()->appendFile('/scripts/jquery.js', 'text/javascript');
|
||||
$view->headScript()->appendFile('/scripts/scripts.js', 'text/javascript');
|
||||
$view->headTitle()->setSeparator(' - ');
|
||||
$view->headTitle('WebService Scores & Decisions');
|
||||
}
|
||||
|
||||
//Initialisation global des paramètres de log
|
||||
protected function _initLogging()
|
||||
{
|
||||
$c = Zend_Registry::get('config');
|
||||
$WsLogger = new Zend_Log();
|
||||
$WsFileWriter = new Zend_Log_Writer_Stream($c->profil->path->log.'/wsentreprise.log');
|
||||
$WsFileWriter->addFilter(Zend_Log::INFO);
|
||||
$WsLogger->addWriter($WsFileWriter);
|
||||
Zend_Registry::set('WsLogger', $WsLogger);
|
||||
}
|
||||
|
||||
protected function _initNavigation()
|
||||
{
|
||||
$view = $this->bootstrap('layout')->getResource('layout')->getView();
|
||||
|
||||
//@todo : gérer les versions et les clients
|
||||
|
||||
$menu = array(
|
||||
array(
|
||||
'label' => 'Accueil',
|
||||
'controller' => 'index',
|
||||
'action' => 'index',
|
||||
),
|
||||
array(
|
||||
'label' => 'Documentation',
|
||||
'controller' => 'documentation',
|
||||
'action' => 'index',
|
||||
'pages' => array(
|
||||
array(
|
||||
'label' => 'Entreprise',
|
||||
'controller' => 'documentation',
|
||||
'action' => 'index',
|
||||
),
|
||||
array(
|
||||
'label' => 'Code erreurs/messages',
|
||||
'controller' => 'documentation',
|
||||
'action' => 'erreur',
|
||||
),
|
||||
array(
|
||||
'label' => 'Exemples',
|
||||
'controller' => 'documentation',
|
||||
'action' => 'exemples',
|
||||
),
|
||||
),
|
||||
),
|
||||
array(
|
||||
'label' => 'Démonstration',
|
||||
'controller' => 'demo',
|
||||
'action' => 'index',
|
||||
),
|
||||
);
|
||||
$view->navigation(new Zend_Navigation($menu));
|
||||
}
|
||||
|
||||
protected function _initRouter()
|
||||
{
|
||||
$this->bootstrap('frontController');
|
||||
$front = $this->getResource('frontController');
|
||||
$router = $front->getRouter();
|
||||
|
||||
//Lire les services disponibles et créer les routes
|
||||
$services = require_once APPLICATION_PATH . '/../library/WsScore/ServicesConfig.php';
|
||||
foreach( $services as $section => $params )
|
||||
{
|
||||
if ($params['actif']) {
|
||||
$route = new Zend_Controller_Router_Route($section.'/:version', array(
|
||||
'controller' => 'service',
|
||||
'action' => 'index',
|
||||
'service' => $section,
|
||||
'version' => '',
|
||||
));
|
||||
$router->addRoute($section, $route);
|
||||
|
||||
$route = new Zend_Controller_Router_Route('jsonrpc/'.$section.'/:version', array(
|
||||
'controller' => 'jsonrpc',
|
||||
'action' => 'index',
|
||||
'service' => $section,
|
||||
'version' => '',
|
||||
));
|
||||
$router->addRoute('jsonrpc-'.$section, $route);
|
||||
}
|
||||
}
|
||||
|
||||
//Route pour WS Clients
|
||||
$route = new Zend_Controller_Router_Route('clients/:client/:version', array(
|
||||
'controller' => 'service',
|
||||
'action' => 'index',
|
||||
'service' => 'clients',
|
||||
'client' => '',
|
||||
'version' => ''
|
||||
));
|
||||
$router->addRoute('client', $route);
|
||||
|
||||
$fichierRoute = new Zend_Controller_Router_Route('fichier/:action/:fichier', array(
|
||||
'controller' => 'fichier',
|
||||
'fichier' => '',
|
||||
));
|
||||
$router->addRoute('fichier', $fichierRoute);
|
||||
return $router;
|
||||
}
|
||||
|
||||
protected function _initDb()
|
||||
{
|
||||
$c = Zend_Registry::get('config');
|
||||
try {
|
||||
$db = Zend_Db::factory($c->profil->db->metier);
|
||||
} catch ( Exception $e ) {
|
||||
if (APPLICATION_ENV == 'development') {
|
||||
echo '<pre>'; print_r($e); echo '</pre>';
|
||||
} else {
|
||||
echo "Le service rencontre actuellement un problème technique.";
|
||||
}
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the default adapter to use with all model
|
||||
*/
|
||||
Zend_Db_Table::setDefaultAdapter($db);
|
||||
}
|
||||
|
||||
protected function _initWsDebug()
|
||||
{
|
||||
$autoloader = Zend_Loader_Autoloader::getInstance();
|
||||
$autoloader->registerNamespace('WsDebug');
|
||||
|
||||
$options = array(
|
||||
'plugins' => array(
|
||||
'Exception',
|
||||
),
|
||||
);
|
||||
|
||||
$debug = new WsDebug_Controller_Plugin_Debug($options);
|
||||
|
||||
$this->bootstrap('frontController');
|
||||
$frontController = $this->getResource('frontController');
|
||||
$frontController->registerPlugin($debug);
|
||||
}
|
||||
|
||||
protected function _initCache()
|
||||
{
|
||||
//MetadataCache pour la base de données
|
||||
$frontendOptions = array(
|
||||
'lifetime' => 14400,
|
||||
'automatic_serialization' => true
|
||||
);
|
||||
$backendOptions = array();
|
||||
$cache = Zend_Cache::factory('Core','Apc', $frontendOptions, $backendOptions);
|
||||
Zend_Db_Table_Abstract::setDefaultMetadataCache($cache);
|
||||
}
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
[production]
|
||||
webservice.scores.wsdl = ""
|
||||
webservice.scores.options.location = "http://192.168.3.2/ws2/"
|
||||
webservice.scores.options.uri = "http://192.168.3.2/"
|
||||
webservice.scores.options.trace = 1
|
||||
webservice.scores.options.soap_version = SOAP_1_1
|
||||
|
||||
[staging]
|
||||
webservice.scores.wsdl = ""
|
||||
webservice.scores.options.location = "http://78.31.45.206/ws2/"
|
||||
webservice.scores.options.uri = "http://78.31.45.206/"
|
||||
webservice.scores.options.trace = 1
|
||||
webservice.scores.options.soap_version = SOAP_1_1
|
||||
|
||||
[development]
|
||||
webservice.scores.wsdl = ""
|
||||
webservice.scores.options.location = "http://78.31.45.206/ws2/"
|
||||
webservice.scores.options.uri = "http://78.31.45.206/"
|
||||
webservice.scores.options.trace = 1
|
||||
webservice.scores.options.soap_version = SOAP_1_1
|
@ -1,105 +0,0 @@
|
||||
<?php
|
||||
class DemoController extends Zend_Controller_Action
|
||||
{
|
||||
protected $_username;
|
||||
protected $_hash;
|
||||
|
||||
protected $methods = array(
|
||||
'getIdentite' => array(
|
||||
'ws' => 'entreprise/v0.7?wsdl',
|
||||
'form' => 'getIdentite',
|
||||
),
|
||||
);
|
||||
|
||||
public function init()
|
||||
{
|
||||
require_once 'Web/demo/getIdentite.php';
|
||||
$auth = Zend_Auth::getInstance();
|
||||
$this->_username = $auth->getIdentity()->username;
|
||||
$this->_hash = $auth->getIdentity()->hash;
|
||||
}
|
||||
|
||||
public function indexAction()
|
||||
{
|
||||
//Liste
|
||||
|
||||
|
||||
$tabMethods = array();
|
||||
foreach($this->methods as $method => $element){
|
||||
$url = $this->view->url(array(
|
||||
'controller' => 'demo',
|
||||
'action' => 'method',
|
||||
'name' => $method,
|
||||
));
|
||||
$tabMethods[] = array(
|
||||
'nom' => $method,
|
||||
'url' => $url,
|
||||
);
|
||||
}
|
||||
|
||||
$this->view->assign('methods', $tabMethods);
|
||||
}
|
||||
|
||||
public function methodAction()
|
||||
{
|
||||
$method = $this->_getParam('name','');
|
||||
$this->view->assign('method', $method);
|
||||
//Affichage du formulaire
|
||||
if (array_key_exists($method, $this->methods)){
|
||||
$class = 'Form_'.$method;
|
||||
if (class_exists($class)){
|
||||
$form = new $class;
|
||||
$form->addElement('hidden', 'method', array(
|
||||
'value' => $method,
|
||||
));
|
||||
if ($this->_request->isPost()) {
|
||||
$formData = $this->_request->getPost();
|
||||
$form->populate($formData);
|
||||
}
|
||||
$this->view->assign('form', $form);
|
||||
} else {
|
||||
$this->view->assign('message',"Impossible d'afficher le formulaire !");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function requeteAction()
|
||||
{
|
||||
if ($this->_request->isPost()) {
|
||||
$formData = $this->_request->getPost();
|
||||
$method = $formData['method'];
|
||||
$class = 'Form_'.$method;
|
||||
if (class_exists($class)) {
|
||||
$form = new $class;
|
||||
if ($form->isValid($formData)) {
|
||||
$method = $formData['method'];
|
||||
$siret = $formData['siret'];
|
||||
$accesWs = $this->methods[$method]['ws'];
|
||||
$hostName = $this->getRequest()->getHttpHost();
|
||||
$options = array(
|
||||
'login' => $this->_username,
|
||||
'password' => $this->_hash,
|
||||
'features' => SOAP_USE_XSI_ARRAY_TYPE + SOAP_SINGLE_ELEMENT_ARRAYS
|
||||
);
|
||||
$client = new Zend_Soap_Client('http://'.$hostName.'/'.$accesWs, $options);
|
||||
$params = new StdClass();
|
||||
$params->siret = $siret;
|
||||
$soap = array(
|
||||
'requete' => $params,
|
||||
'reponse' => $client->getIdentite($params)
|
||||
);
|
||||
$this->view->assign('soap',$soap);
|
||||
$xml = array(
|
||||
'requete' => $client->getLastRequest(),
|
||||
'reponse' => $client->getLastResponse()
|
||||
);
|
||||
$this->view->assign('xml',$xml);
|
||||
} else {
|
||||
$this->_forward('method', 'demo', null, array('name'=> 'getIdentite'));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,209 +0,0 @@
|
||||
<?php
|
||||
class DocumentationController extends Zend_Controller_Action
|
||||
{
|
||||
|
||||
/**
|
||||
* Affichage de la documentation des webservices
|
||||
*/
|
||||
public function indexAction()
|
||||
{
|
||||
$request = $this->getRequest();
|
||||
$ws = strtolower($request->getParam('ws','Entreprise'));
|
||||
$auth = Zend_Auth::getInstance();
|
||||
|
||||
//Si client possède un webservice particulier alors on redirige vers la doc clients
|
||||
$clients = include APPLICATION_PATH . '/../library/WsScore/Clients/ClientsConfig.php';
|
||||
foreach( $clients as $section => $params ){
|
||||
if ($params['actif']) {
|
||||
$wsClients[$params['idClient']] = $section;
|
||||
}
|
||||
}
|
||||
|
||||
if (array_key_exists($auth->getIdentity()->idClient, $wsClients)){
|
||||
|
||||
$this->_forward('clients', 'documentation', null, array(
|
||||
'nom' => $wsClients[$auth->getIdentity()->idClient]
|
||||
));
|
||||
|
||||
} else {
|
||||
|
||||
// Liste des webservices
|
||||
$services = include APPLICATION_PATH . '/../library/WsScore/ServicesConfig.php';
|
||||
foreach( $services as $section => $params )
|
||||
{
|
||||
if ($params['actif']) {
|
||||
$wsServices[$section] = $params;
|
||||
}
|
||||
}
|
||||
|
||||
// On vérifie que l'utilisateur peut accèder à la documentation
|
||||
$username = $auth->getIdentity()->username;
|
||||
$idClient = $auth->getIdentity()->idClient;
|
||||
if ( array_key_exists($ws, $wsServices) )
|
||||
{
|
||||
if ( isset($wsServices['idClient']) && $idClient!=$wsServices['idClient'] )
|
||||
{
|
||||
$this->renderScript('documentation/nodoc.phtml');
|
||||
exit;
|
||||
}
|
||||
if ( isset($wsServices['user']) && !in_array($username, $wsServices['user']) )
|
||||
{
|
||||
$this->renderScript('documentation/nodoc.phtml');
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
// Gestion des versions
|
||||
$serviceVersions = array();
|
||||
$configServiceVersions = $wsServices[$ws]['versions'];
|
||||
foreach( $configServiceVersions as $section => $params ){
|
||||
$serviceVersions[$section] = $params;
|
||||
if ($params['defaut']) {
|
||||
$defautVersion = $section;
|
||||
}
|
||||
}
|
||||
$version = $request->getParam('version', $defautVersion);
|
||||
|
||||
// Charger les classes et les types pour le service suivant la version
|
||||
$pathClassService = 'WsScore/'.ucfirst($ws).'/v'.$version.'/';
|
||||
|
||||
//Génération du tableau de mapping
|
||||
$classmap = array();
|
||||
$wsConfig = new Zend_Config_Ini($pathClassService.ucfirst($ws).'.ini');
|
||||
if ( $wsConfig->count()>0 ) {
|
||||
foreach($wsConfig->Type->toArray() as $Type){
|
||||
$classmap[$Type] = $Type;
|
||||
}
|
||||
}
|
||||
|
||||
//Définir l'url d'accès au WSDL
|
||||
$wsdl_url = $this->view->baseUrl();
|
||||
if (APPLICATION_ENV == 'production'){
|
||||
$wsdl_url.= '/'.$ws.'/v'.$version.'?wsdl';
|
||||
} else {
|
||||
$wsdl_url.= '/'.$ws.'/v'.$version.'?wsdl-auto';
|
||||
}
|
||||
// Affichage de la documentation
|
||||
require_once 'Web/WebClassDoc.php';
|
||||
$doc = new WebClassDoc(ucfirst($ws), $classmap, $pathClassService);
|
||||
$tabServiceMethods = $doc->getServiceMethods();
|
||||
// Tri des méthodes par ordre alphabétique
|
||||
$tabServiceMethodsK = array();
|
||||
foreach($tabServiceMethods as $method) {
|
||||
$tabServiceMethodsK[$method['name']] = $method;
|
||||
}
|
||||
ksort($tabServiceMethodsK);
|
||||
$tabServiceTypes = $doc->getServiceTypes();
|
||||
$this->view->assign('wsdl', $wsdl_url);
|
||||
$this->view->assign('serviceMethods', $tabServiceMethodsK);
|
||||
$this->view->assign('serviceTypes', $tabServiceTypes);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public function clientsAction()
|
||||
{
|
||||
$request = $this->getRequest();
|
||||
$client = strtolower($request->getParam('nom'));
|
||||
$ws = 'entreprise';
|
||||
|
||||
// Gestion des versions
|
||||
$clients = include APPLICATION_PATH . '/../library/WsScore/Clients/ClientsConfig.php';
|
||||
$configServiceVersions = $clients[$client]['versions'];
|
||||
foreach( $configServiceVersions as $section => $params ){
|
||||
$serviceVersions[$section] = $params;
|
||||
if ($params['defaut']) {
|
||||
$defautVersion = $section;
|
||||
}
|
||||
}
|
||||
$version = $request->getParam('version', $defautVersion);
|
||||
|
||||
// Charger les classes et les types pour le service suivant la version
|
||||
$pathClassService = 'WsScore/Clients/'.ucfirst($client).'/v'.$version.'/';
|
||||
|
||||
//Génération du tableau de mapping
|
||||
$classmap = array();
|
||||
$wsConfig = new Zend_Config_Ini($pathClassService.ucfirst($ws).'.ini');
|
||||
if ( $wsConfig->count()>0 ) {
|
||||
foreach($wsConfig->Type->toArray() as $Type){
|
||||
$classmap[$Type] = $Type;
|
||||
}
|
||||
}
|
||||
|
||||
//Définir l'url d'accès au WSDL
|
||||
$wsdl_url = $this->view->baseUrl();
|
||||
|
||||
if (APPLICATION_ENV == 'production'){
|
||||
$wsdl_url.= '/clients/'.$client.'/v'.$version.'?wsdl';
|
||||
} else {
|
||||
$wsdl_url.= '/clients/'.$client.'/v'.$version.'?wsdl-auto';
|
||||
}
|
||||
|
||||
// Affichage de la documentation
|
||||
require_once 'Web/WebClassDoc.php';
|
||||
$doc = new WebClassDoc(ucfirst($ws), $classmap, $pathClassService);
|
||||
$tabServiceMethods = $doc->getServiceMethods();
|
||||
// Tri des méthodes par ordre alphabétique
|
||||
$tabServiceMethodsK = array();
|
||||
foreach($tabServiceMethods as $method) {
|
||||
$tabServiceMethodsK[$method['name']] = $method;
|
||||
}
|
||||
ksort($tabServiceMethodsK);
|
||||
$tabServiceTypes = $doc->getServiceTypes();
|
||||
$this->view->assign('wsdl', $wsdl_url);
|
||||
$this->view->assign('serviceMethods', $tabServiceMethodsK);
|
||||
$this->view->assign('serviceTypes', $tabServiceTypes);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Liste les exemples de code disponible pour chaque méthode
|
||||
*/
|
||||
public function exemplesAction()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Affichage exemple de code avec coloration syntaxique
|
||||
* Le code doit être placé dans public/code et doit être nommé
|
||||
* [nom de la méthode]-langage.txt
|
||||
*/
|
||||
public function codeAction()
|
||||
{
|
||||
$langage = strtolower($this->_getParam('langage',''));
|
||||
$element = $this->_getParam('element','');
|
||||
|
||||
$fichier = APPLICATION_PATH .
|
||||
'/../public/code/' . $element . '-' . $langage . '.txt';
|
||||
if (file_exists($fichier)){
|
||||
$sourceCode = file_get_contents($fichier);
|
||||
|
||||
require_once 'geshi/geshi.php';
|
||||
$geshi = new GeSHi($sourceCode, $langage);
|
||||
$geshi->enable_line_numbers(GESHI_NORMAL_LINE_NUMBERS);
|
||||
$sourceHighlight = $geshi->parse_code();
|
||||
|
||||
$this->view->assign('langage', strtoupper($langage));
|
||||
$this->view->assign('code', $sourceHighlight);
|
||||
} else {
|
||||
$this->view->assign('langage',
|
||||
'Element non traités, Vous pouvez aussi nous fournir des exemples.');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Affichage de la liste des erreurs avec leur code
|
||||
*/
|
||||
public function erreurAction()
|
||||
{
|
||||
require_once 'WsScore/WsScore.php';
|
||||
$ws = new WsScore();
|
||||
$erreurs = $ws->listError;
|
||||
$this->view->assign('erreurs', $erreurs);
|
||||
}
|
||||
}
|
||||
|
@ -1,47 +0,0 @@
|
||||
<?php
|
||||
class ErrorController extends Zend_Controller_Action
|
||||
{
|
||||
public function errorAction()
|
||||
{
|
||||
$errors = $this->_getParam('error_handler');
|
||||
|
||||
switch ($errors->type) {
|
||||
case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ROUTE:
|
||||
case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_CONTROLLER:
|
||||
case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ACTION:
|
||||
|
||||
// 404 error -- controller or action not found
|
||||
$this->getResponse()->setHttpResponseCode(404);
|
||||
$this->view->message = 'Page not found';
|
||||
break;
|
||||
default:
|
||||
// application error
|
||||
$this->getResponse()->setHttpResponseCode(500);
|
||||
$this->view->message = 'Application error';
|
||||
break;
|
||||
}
|
||||
|
||||
// Log exception, if logger available
|
||||
if ($log = $this->getLog()) {
|
||||
$log->crit($this->view->message, $errors->exception);
|
||||
}
|
||||
|
||||
// conditionally display exceptions
|
||||
if ($this->getInvokeArg('displayExceptions') == true) {
|
||||
$this->view->exception = $errors->exception;
|
||||
}
|
||||
|
||||
$this->view->request = $errors->request;
|
||||
}
|
||||
|
||||
public function getLog()
|
||||
{
|
||||
$bootstrap = $this->getInvokeArg('bootstrap');
|
||||
if (!$bootstrap->hasPluginResource('Log')) {
|
||||
return false;
|
||||
}
|
||||
$log = $bootstrap->getResource('Log');
|
||||
return $log;
|
||||
}
|
||||
}
|
||||
|
@ -1,20 +0,0 @@
|
||||
<?php
|
||||
class ExportController extends Zend_Controller_Action
|
||||
{
|
||||
public function init()
|
||||
{
|
||||
$this->_helper->layout->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender();
|
||||
}
|
||||
|
||||
public function indexAction()
|
||||
{
|
||||
echo "Export";
|
||||
}
|
||||
|
||||
protected function checkFile($path)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -1,139 +0,0 @@
|
||||
<?php
|
||||
class FichierController extends Zend_Controller_Action
|
||||
{
|
||||
public function init()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender(true);
|
||||
}
|
||||
|
||||
public function bodaccAction()
|
||||
{
|
||||
$auth = Zend_Auth::getInstance();
|
||||
if ( $auth->hasIdentity() ) {
|
||||
|
||||
$directory = '/mnt/bodacc';
|
||||
|
||||
$q = $this->getRequest()->getParam('q');
|
||||
$file = base64_decode($q);
|
||||
|
||||
$output_file = $directory.'/'.$file;
|
||||
|
||||
if (file_exists($output_file) && filesize($output_file)>0) {
|
||||
$content_type = 'application/pdf';
|
||||
header('Content-type: '.$content_type.'');
|
||||
header('Content-Length: '.filesize($output_file));
|
||||
header('Content-MD5: '.base64_encode(md5_file($output_file)));
|
||||
header('Content-Disposition: inline; filename="'.basename($output_file).'"');
|
||||
header('Cache-Control: private, max-age=0, must-revalidate');
|
||||
header('Pragma: public');
|
||||
ini_set('zlib.output_compression','0');
|
||||
echo file_get_contents($output_file);
|
||||
|
||||
//Log de la requete
|
||||
$tabInsert = array(
|
||||
'login' => $auth->getIdentity()->username,
|
||||
'idClient' => $auth->getIdentity()->idClient,
|
||||
'page' => 'histobodacc',
|
||||
'siren' => '',
|
||||
'nic' => '',
|
||||
'params' => $file,
|
||||
'test' => 0,
|
||||
'raisonSociale' => '',
|
||||
'cp' => '',
|
||||
'ville' => '',
|
||||
'ipClient' => $_SERVER['REMOTE_ADDR'],
|
||||
);
|
||||
require_once 'framework/common/mysql.php';
|
||||
$iDbCrm = new WDB('sdv1');
|
||||
$rep = $iDbCrm->insert('logs', array_merge($tabInsert,$tabRdvInsee), false, true);
|
||||
|
||||
} else {
|
||||
echo "Erreur lors de l'affichage du fichier.";
|
||||
}
|
||||
} else {
|
||||
echo "Authentification échoué.";
|
||||
}
|
||||
}
|
||||
|
||||
public function logsAction()
|
||||
{
|
||||
$file = $this->getRequest()->getParam('fichier');
|
||||
$content_type = 'application/csv-tab-delimited-table';
|
||||
$c = Zend_Registry::get('config');
|
||||
$path = realpath($c->profil->path->files).'/';
|
||||
//Envoi du fichier sur la sortie standard
|
||||
if ( file_exists($path.$file) ) {
|
||||
header('Content-Transfer-Encoding: none');
|
||||
header('Content-type: ' . $content_type.'');
|
||||
header('Content-Length: ' . filesize($path.$file));
|
||||
header('Content-MD5: ' . base64_encode(md5_file($path.$file)));
|
||||
header('Content-Disposition: filename="' . basename($path.$file) . '"');
|
||||
header('Cache-Control: private, max-age=0, must-revalidate');
|
||||
header('Pragma: public');
|
||||
ini_set('zlib.output_compression', '0');
|
||||
echo file_get_contents($path.$file);
|
||||
}
|
||||
}
|
||||
|
||||
public function csvAction()
|
||||
{
|
||||
$file = $this->getRequest()->getParam('fichier');
|
||||
$content_type = 'application/csv-tab-delimited-table';
|
||||
$c = Zend_Registry::get('config');
|
||||
$path = realpath($c->profil->path->files).'/';
|
||||
//Envoi du fichier sur la sortie standard
|
||||
if ( file_exists($path.$file) ) {
|
||||
header('Content-Transfer-Encoding: none');
|
||||
header('Content-type: ' . $content_type.'');
|
||||
header('Content-Length: ' . filesize($path.$file));
|
||||
header('Content-MD5: ' . base64_encode(md5_file($path.$file)));
|
||||
header('Content-Disposition: filename="' . basename($path.$file) . '"');
|
||||
header('Cache-Control: private, max-age=0, must-revalidate');
|
||||
header('Pragma: public');
|
||||
ini_set('zlib.output_compression', '0');
|
||||
echo file_get_contents($path.$file);
|
||||
}
|
||||
}
|
||||
|
||||
public function kbisAction()
|
||||
{
|
||||
$file = $this->getRequest()->getParam('fichier');
|
||||
$content_type = 'application/pdf';
|
||||
$c = Zend_Registry::get('config');
|
||||
$path = realpath($c->profil->path->secure).'/kbis/';
|
||||
//Envoi du fichier sur la sortie standard
|
||||
if ( file_exists($path.$file) ) {
|
||||
header('Content-Transfer-Encoding: none');
|
||||
header('Content-type: ' . $content_type.'');
|
||||
header('Content-Length: ' . filesize($path.$file));
|
||||
header('Content-MD5: ' . base64_encode(md5_file($path.$file)));
|
||||
header('Content-Disposition: filename="' . basename($path.$file) . '"');
|
||||
header('Cache-Control: private, max-age=0, must-revalidate');
|
||||
header('Pragma: public');
|
||||
ini_set('zlib.output_compression', '0');
|
||||
echo file_get_contents($path.$file);
|
||||
}
|
||||
}
|
||||
|
||||
public function associationsAction()
|
||||
{
|
||||
$file = $this->getRequest()->getParam('fichier');
|
||||
$content_type = 'application/pdf';
|
||||
$c = Zend_Registry::get('config');
|
||||
$path = realpath($c->profil->path->files).'/associations/';
|
||||
//Envoi du fichier sur la sortie standard
|
||||
if ( file_exists($path.$file) ) {
|
||||
header('Content-Transfer-Encoding: none');
|
||||
header('Content-type: ' . $content_type.'');
|
||||
header('Content-Length: ' . filesize($path.$file));
|
||||
header('Content-MD5: ' . base64_encode(md5_file($path.$file)));
|
||||
header('Content-Disposition: filename="' . basename($path.$file) . '"');
|
||||
header('Cache-Control: private, max-age=0, must-revalidate');
|
||||
header('Pragma: public');
|
||||
ini_set('zlib.output_compression', '0');
|
||||
echo file_get_contents($path.$file);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -1,78 +0,0 @@
|
||||
<?php
|
||||
class ImportController extends Zend_Controller_Action
|
||||
{
|
||||
|
||||
public function fileformAction()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
|
||||
$this->view->inlineScript()->appendFile('/scripts/jquery.form.js');
|
||||
$this->view->inlineScript()->appendFile('/scripts/jqueryprogressbar.js');
|
||||
|
||||
$this->view->assign('filesize', ini_get('upload_max_filesize'));
|
||||
|
||||
$request = $this->getRequest();
|
||||
$idClient = $request->getParam('idClient', null);
|
||||
$login = $request->getParam('login', null);
|
||||
|
||||
$this->view->assign('idClient', $idClient);
|
||||
$this->view->assign('login', $login);
|
||||
}
|
||||
|
||||
public function fileuploadAction()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender(true);
|
||||
|
||||
$request = $this->getRequest();
|
||||
$idClient = $request->getParam('idClient');
|
||||
$login = $request->getParam('login');
|
||||
|
||||
$config = new Zend_Config_Ini(APPLICATION_PATH . '/configs/configuration.ini', 'path');
|
||||
$path = realpath($config->data).'/validation';
|
||||
if(!file_exists($path)) mkdir($path);
|
||||
|
||||
if ( isset($_FILES) && count($_FILES)==1 ){
|
||||
$n = $_FILES['fichier']['name'];
|
||||
$s = $_FILES['fichier']['size'];
|
||||
$tmp_name = $_FILES['fichier']['tmp_name'];
|
||||
|
||||
$extValide = array('csv');
|
||||
$extension = strrchr($n,'.');
|
||||
$extension = substr($extension,1);
|
||||
//Vérifier l'extension du fichier
|
||||
if(!in_array($extension, $extValide)){
|
||||
echo "Extension de fichier incorrect !";
|
||||
} elseif (move_uploaded_file($tmp_name, $path.'/'.$idClient.'-'.$name.'.'.$extension)){
|
||||
echo "Fichier envoyé, <a href=\"".
|
||||
$this->view->url(array(
|
||||
'controller' => 'import',
|
||||
'action' => 'checkfile',
|
||||
'file' => $idClient.'-'.$name.'.'.$extension,
|
||||
))."\">Vérifier le format</a>";
|
||||
} else {
|
||||
echo "Erreur : ".$_FILES['fichier']['error'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Etat de progression de l'upload du fichier
|
||||
*/
|
||||
public function fileprogressAction()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender(true);
|
||||
|
||||
$request = $this->getRequest();
|
||||
$key = $request->getParam('key', '');
|
||||
if (!empty($key)) {
|
||||
//$rep sera égal à false si la clef n'existe pas dans le cache apc
|
||||
$rep = apc_fetch('upload_'.$key);
|
||||
echo json_encode($rep);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
@ -1,86 +0,0 @@
|
||||
<?php
|
||||
class IndexController extends Zend_Controller_Action
|
||||
{
|
||||
protected $serviceList = array();
|
||||
protected $serviceClientList = array();
|
||||
|
||||
public function init()
|
||||
{
|
||||
$auth = Zend_Auth::getInstance();
|
||||
|
||||
//Lecture des webservices normaux
|
||||
$services = include APPLICATION_PATH . '/../library/WsScore/ServicesConfig.php';
|
||||
foreach( $services as $section => $params )
|
||||
{
|
||||
if ($params['actif']) {
|
||||
$wsServices[$section] = $params;
|
||||
}
|
||||
}
|
||||
|
||||
//Parcourir les webservices
|
||||
foreach($wsServices as $serviceName => $serviceInfo)
|
||||
{
|
||||
if ( !isset($wsServices[$serviceName]['idClient']) || $wsServices[$serviceName]['idClient'] == $auth->getIdentity()->idClient)
|
||||
{
|
||||
$serviceVersions = array();
|
||||
$configServiceVersions = $wsServices[$serviceName]['versions'];
|
||||
foreach( $configServiceVersions as $section => $params )
|
||||
{
|
||||
$serviceVersions[$section] = $params;
|
||||
$this->serviceList[$serviceName]['version'] = $serviceVersions;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Lecture des webservices Clients
|
||||
$clients = include APPLICATION_PATH . '/../library/WsScore/Clients/ClientsConfig.php';
|
||||
foreach( $clients as $section => $params ){
|
||||
if ($params['actif']) {
|
||||
$wsClients[$section] = $params;
|
||||
}
|
||||
}
|
||||
|
||||
//Parcourir les webservices clients
|
||||
foreach($wsClients as $serviceName => $serviceInfo)
|
||||
{
|
||||
if ($wsClients[$serviceName]['idClient'] == $auth->getIdentity()->idClient) {
|
||||
$this->serviceList = array();
|
||||
}
|
||||
if ($wsClients[$serviceName]['idClient'] == $auth->getIdentity()->idClient || in_array($auth->getIdentity()->username, $wsClients[$serviceName]['user']) )
|
||||
{
|
||||
$serviceVersions = array();
|
||||
$configServiceVersions = $wsClients[$serviceName]['versions'];
|
||||
foreach( $configServiceVersions as $section => $params )
|
||||
{
|
||||
$serviceVersions[$section] = $params;
|
||||
$this->serviceList[$serviceName]['version'] = $serviceVersions;
|
||||
$this->serviceList[$serviceName]['type'] = 'client';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function indexAction()
|
||||
{
|
||||
$displayWs = array();
|
||||
if (count($this->serviceList)>0)
|
||||
{
|
||||
foreach($this->serviceList as $key => $ws)
|
||||
{
|
||||
$displayWs[$key] = $ws;
|
||||
}
|
||||
}
|
||||
|
||||
$this->view->assign('ws', $displayWs);
|
||||
}
|
||||
|
||||
public function testAction()
|
||||
{
|
||||
//Connexion au service - Faire comme ci on charger le WSDL de l'extérieur
|
||||
//getFunctions / getTypes
|
||||
//Pour chaque Function, identifier les Types puis proposer les champs associés
|
||||
//Valider les formulaires pour executer la requête du service
|
||||
//Utiliser le jeux de tests disponible
|
||||
}
|
||||
}
|
||||
|
@ -1,108 +0,0 @@
|
||||
<?php
|
||||
class JsonrpcController extends Zend_Controller_Action
|
||||
{
|
||||
public function indexAction()
|
||||
{
|
||||
$this->_helper->layout->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender();
|
||||
|
||||
$request = $this->getRequest();
|
||||
|
||||
//Nom du service
|
||||
$serviceName = strtolower($request->getParam('service', 'Entreprise'));
|
||||
|
||||
//Service spécifique client
|
||||
if ($serviceName == 'clients') {
|
||||
$client = $request->getParam('client', '');
|
||||
//Liste des clients
|
||||
$clients = array();
|
||||
$listeClients = include APPLICATION_PATH . '/../library/WsScore/Clients/ClientsConfig.php';
|
||||
foreach ( $listeClients as $section => $params ) {
|
||||
if ($params['actif']){
|
||||
$clients[] = $section;
|
||||
}
|
||||
}
|
||||
if (!in_array($client, $clients)){
|
||||
echo 'Service clients introuvable !';
|
||||
exit;
|
||||
}
|
||||
$configServiceVersions = $clients[$client]['versions'];
|
||||
}
|
||||
else
|
||||
{
|
||||
//Service versions
|
||||
$services = include APPLICATION_PATH . '/../library/WsScore/ServicesConfig.php';
|
||||
$configServiceVersions = $services[$serviceName]['versions'];
|
||||
}
|
||||
|
||||
//Liste des versions
|
||||
foreach( $configServiceVersions as $section => $params ) {
|
||||
$serviceVersions[$section] = $params;
|
||||
if ($params['defaut']) {
|
||||
$defautVersion = $section;
|
||||
}
|
||||
}
|
||||
$version = $request->getParam('version', 'v'.$defautVersion);
|
||||
$version = substr($version, 1);
|
||||
|
||||
// Version inexistante
|
||||
if ( !array_key_exists($version, $serviceVersions) ) {
|
||||
echo "Version inexistante.";
|
||||
exit;
|
||||
}
|
||||
// Version désactivé
|
||||
if ( !$serviceVersions[$version]['actif'] ) {
|
||||
echo "Version désactivée.";
|
||||
exit;
|
||||
}
|
||||
|
||||
// Charger les classes et les types pour le service suivant la version
|
||||
if ($serviceName == 'clients') {
|
||||
$pathServiceClassIni = 'WsScore/Clients/'.ucfirst($client).'/v'.$version.'/Entreprise.ini';
|
||||
$pathServiceClassPhp = 'WsScore/Clients/'.ucfirst($client).'/v'.$version.'/Entreprise.php';
|
||||
$pathServiceUrl = 'clients/'.$client.'/v'.$version.'?wsdl-auto';
|
||||
//On redéfini le nom du service
|
||||
$serviceName = 'Entreprise';
|
||||
$fichierWsdl = ucfirst($client).'-'.$serviceName.'-'.$version.'.wsdl';
|
||||
} else {
|
||||
$pathServiceClassIni = 'WsScore/'.ucfirst($serviceName).'/v'.$version.'/'.ucfirst($serviceName).'.ini';
|
||||
$pathServiceClassPhp = 'WsScore/'.ucfirst($serviceName).'/v'.$version.'/'.ucfirst($serviceName).'.php';
|
||||
$pathServiceUrl = $serviceName.'/v'.$version.'?wsdl-auto';
|
||||
$fichierWsdl = ucfirst($serviceName).'-'.$version.'.wsdl';
|
||||
}
|
||||
|
||||
//Génération du tableau de mapping
|
||||
$wsConfig = new Zend_Config_Ini($pathServiceClassIni);
|
||||
foreach($wsConfig->Type->toArray() as $Type){
|
||||
$classmap[$Type] = $Type;
|
||||
}
|
||||
|
||||
//Inclusion des classes de données
|
||||
require_once $pathServiceClassPhp;
|
||||
|
||||
// Instance du server
|
||||
$server = new Zend_Json_Server();
|
||||
// Define class name
|
||||
$server->setClass(ucfirst($serviceName));
|
||||
|
||||
// Gestion du SMD
|
||||
if($this->getRequest()->isGet()){
|
||||
// Indiquer URL endpoint
|
||||
//$this->getHelper('url')->url(array('controller'=>'', 'action'=>'' ));
|
||||
$server->setTarget('/jsonrpc/'.$serviceName.'/'.$version.'/')
|
||||
->setEnvelope(Zend_Json_Server_Smd::ENV_JSONRPC_2);
|
||||
// Grab the SMD
|
||||
$smd = $server->getServiceMap();
|
||||
|
||||
//Return the SMD to the client
|
||||
if (!headers_sent()) {
|
||||
header('Content-Type: application/json');
|
||||
}
|
||||
echo $smd;
|
||||
return;
|
||||
} else {
|
||||
$server->setAutoEmitResponse(true);
|
||||
$server->handle();
|
||||
}
|
||||
}
|
||||
}
|
@ -1,119 +0,0 @@
|
||||
<?php
|
||||
class RefController extends Zend_Controller_Action
|
||||
{
|
||||
public function indexAction ()
|
||||
{
|
||||
//Ne fait rien...
|
||||
}
|
||||
|
||||
/**
|
||||
* Donne accès au fichier
|
||||
*/
|
||||
public function fichierAction ()
|
||||
{
|
||||
//Lecture du nom du fichier
|
||||
$fichier = $this->_getParam('q','');
|
||||
$fichier = $fichier . '.csv';
|
||||
if (!empty($fichier) && file_exists('fichiers/'.$fichier))
|
||||
{
|
||||
$this->_helper->layout->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender();
|
||||
|
||||
list($nomFichier, $extFichier) = explode('.',$fichier);
|
||||
//Distribution du fichier sur la sortie standard
|
||||
switch ($extFichier) {
|
||||
case 'png' : $content_type = 'image/png'; break;
|
||||
case 'gif' : $content_type = 'image/gif'; break;
|
||||
case 'jpeg':
|
||||
case 'jpg' : $content_type = 'image/jpeg'; break;
|
||||
case 'pdf' : $content_type = 'application/pdf'; break;
|
||||
case 'csv' : $content_type = 'application/csv-tab-delimited-table'; break;
|
||||
}
|
||||
$this->getResponse()->setHeader('Content-Type', $content_type);
|
||||
$contentDisposition = 'attachment';
|
||||
switch ($contentDisposition) {
|
||||
case 'inline':
|
||||
$this->getResponse()->setHeader('Content-Disposition', 'inline');
|
||||
break;
|
||||
case 'attachment':
|
||||
$this->getResponse()->setHeader('Content-Disposition', "attachment; filename=\"$fichier\"");
|
||||
break;
|
||||
}
|
||||
|
||||
$data = file_get_contents('fichiers/'.$fichier);
|
||||
|
||||
$this->getResponse()->setHeader('Content-Length', strlen($data))
|
||||
->setHeader('Cache-Control', 'private, max-age=0, must-revalidate')
|
||||
->setHeader('Pragma', 'public')
|
||||
->setBody($data);
|
||||
} else {
|
||||
$this->view->assign('message', 'Fichier introuvable !');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Donne accès aux données contenues dans une table de base de données
|
||||
*/
|
||||
public function tableAction ()
|
||||
{
|
||||
$requetesql = $this->_getParam('q','');
|
||||
$fichierCsv = $requetesql.'.csv';
|
||||
$fichierSql = $requetesql.'.sql';
|
||||
|
||||
//Emplacement des fichiers générés - lien symbolique en PRODUCTION
|
||||
$path = DOC_WEB_LOCAL . 'fichiers/';
|
||||
if (!is_dir($path)) { mkdir($path); }
|
||||
if (!empty($requetesql))
|
||||
{
|
||||
if (!file_exists($path . $fichierCsv))
|
||||
{
|
||||
if (file_exists('sql/'.$fichierSql))
|
||||
{
|
||||
//Connexion mysql
|
||||
$sql = file_get_contents('sql/'.$fichierSql);
|
||||
require_once 'framework/common/mysql.php';
|
||||
$db = new WDB();
|
||||
$db->exportCSV($sql, $path . $fichierCsv, ',', "\n");
|
||||
}
|
||||
}
|
||||
|
||||
if (file_exists($path . $fichierCsv))
|
||||
{
|
||||
$this->_helper->layout->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender();
|
||||
//Distribution du fichier sur la sortie standard
|
||||
list($nomFichier, $extFichier) = explode('.',$fichierCsv);
|
||||
switch ($extFichier)
|
||||
{
|
||||
case 'png' : $content_type = 'image/png'; break;
|
||||
case 'gif' : $content_type = 'image/gif'; break;
|
||||
case 'jpeg':
|
||||
case 'jpg' : $content_type = 'image/jpeg'; break;
|
||||
case 'pdf' : $content_type = 'application/pdf'; break;
|
||||
case 'csv' : $content_type = 'application/csv-tab-delimited-table'; break;
|
||||
}
|
||||
$this->getResponse()->setHeader('Content-Type', $content_type);
|
||||
$contentDisposition = 'attachment';
|
||||
switch ($contentDisposition)
|
||||
{
|
||||
case 'inline':
|
||||
$this->getResponse()->setHeader('Content-Disposition', 'inline');
|
||||
break;
|
||||
case 'attachment':
|
||||
$this->getResponse()->setHeader('Content-Disposition', "attachment; filename=\"$fichierCsv\"");
|
||||
break;
|
||||
}
|
||||
|
||||
$data = file_get_contents($path . $fichierCsv);
|
||||
|
||||
$this->getResponse()->setHeader('Content-Length', strlen($data))
|
||||
->setHeader('Cache-Control', 'private, max-age=0, must-revalidate')
|
||||
->setHeader('Pragma', 'public')
|
||||
->setBody($data);
|
||||
}
|
||||
} else {
|
||||
$this->view->assign('message', 'Paramètres incorrects !');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -1,174 +0,0 @@
|
||||
<?php
|
||||
require_once 'framework/fwk.php';
|
||||
|
||||
class ServiceController extends Zend_Controller_Action
|
||||
{
|
||||
public function indexAction()
|
||||
{
|
||||
$this->_helper->layout->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender();
|
||||
|
||||
$request = $this->getRequest();
|
||||
|
||||
//Get the service name, make sure the string is in lower case
|
||||
$serviceName = strtolower($request->getParam('service', 'Entreprise'));
|
||||
|
||||
//ClassName and Directory with first letter capitalized
|
||||
$serviceClassName = ucfirst($serviceName);
|
||||
|
||||
//Customize service for customers
|
||||
if ('clients' == $serviceName ) {
|
||||
$client = strtolower($request->getParam('client', ''));
|
||||
$clientClassName = ucfirst($client);
|
||||
//Get list of customers
|
||||
$clients = array();
|
||||
$listeClients = include APPLICATION_PATH . '/../library/WsScore/Clients/ClientsConfig.php';
|
||||
foreach ( $listeClients as $section => $params ){
|
||||
if ($params['actif']) {
|
||||
$clients[$section] = $params;
|
||||
}
|
||||
}
|
||||
if (!array_key_exists($client, $clients)){
|
||||
echo 'Service clients introuvable !';
|
||||
exit;
|
||||
}
|
||||
$configServiceVersions = $clients[$client]['versions'];
|
||||
}
|
||||
else
|
||||
{
|
||||
//Service versions
|
||||
$services = include APPLICATION_PATH . '/../library/WsScore/ServicesConfig.php';
|
||||
$configServiceVersions = $services[$serviceName]['versions'];
|
||||
}
|
||||
|
||||
// Check versions
|
||||
foreach( $configServiceVersions as $section => $params ) {
|
||||
$serviceVersions[$section] = $params;
|
||||
if ($params['defaut']) {
|
||||
$defautVersion = $section;
|
||||
}
|
||||
}
|
||||
$version = $request->getParam('version', 'v'.$defautVersion);
|
||||
$version = substr($version, 1);
|
||||
|
||||
// Version inexistante
|
||||
if ( !array_key_exists($version, $serviceVersions) ) {
|
||||
echo "Version inexistante.";
|
||||
exit;
|
||||
}
|
||||
// Version désactivé
|
||||
if ( !$serviceVersions[$version]['actif'] ) {
|
||||
echo "Version désactivée.";
|
||||
exit;
|
||||
}
|
||||
|
||||
// Charger les classes et les types pour le service suivant la version
|
||||
if ('clients' == $serviceName) {
|
||||
$pathServiceClassIni = 'WsScore/Clients/'.$clientClassName.'/v'.$version.'/Entreprise.ini';
|
||||
$pathServiceClassPhp = 'WsScore/Clients/'.$clientClassName.'/v'.$version.'/Entreprise.php';
|
||||
//Gestion du mode de génération du wsdl
|
||||
if ( APPLICATION_ENV == 'development'
|
||||
|| array_key_exists('mode', $serviceVersions[$version])
|
||||
&& $serviceVersions[$version]['mode']=='auto') {
|
||||
$pathServiceUrl = 'clients/'.$client.'/v'.$version.'?wsdl-auto';
|
||||
} else {
|
||||
$pathServiceUrl = 'clients/'.$client.'/v'.$version.'?wsdl';
|
||||
}
|
||||
//On redéfini le nom du service
|
||||
$serviceClassName = 'Entreprise';
|
||||
$fichierWsdl = $clientClassName.'-'.$serviceClassName.'-'.$version.'.wsdl';
|
||||
} else {
|
||||
$pathServiceClassIni = 'WsScore/'.$serviceClassName.'/v'.$version.'/'.$serviceClassName.'.ini';
|
||||
$pathServiceClassPhp = 'WsScore/'.$serviceClassName.'/v'.$version.'/'.$serviceClassName.'.php';
|
||||
//Gestion du mode de génération du wsdl
|
||||
if ( APPLICATION_ENV == 'development'
|
||||
|| array_key_exists('mode', $serviceVersions[$version])
|
||||
&& $serviceVersions[$version]['mode']=='auto') {
|
||||
$pathServiceUrl = $serviceName.'/v'.$version.'?wsdl-auto';
|
||||
} else {
|
||||
$pathServiceUrl = $serviceName.'/v'.$version.'?wsdl';
|
||||
}
|
||||
$fichierWsdl = $serviceClassName.'-'.$version.'.wsdl';
|
||||
}
|
||||
|
||||
//Génération du tableau de mapping
|
||||
$classmap = array();
|
||||
$wsConfig = new Zend_Config_Ini($pathServiceClassIni);
|
||||
if ( $wsConfig->count()>0 ) {
|
||||
foreach($wsConfig->Type->toArray() as $Type){
|
||||
$classmap[$Type] = $Type;
|
||||
}
|
||||
}
|
||||
//Inclusion des classes de données
|
||||
require_once $pathServiceClassPhp;
|
||||
|
||||
// Fourniture du wsdl
|
||||
if ( isset($_GET['wsdl']) && file_exists($fichierWsdl) ) {
|
||||
|
||||
if (!headers_sent()) {
|
||||
header('Content-Type: text/xml');
|
||||
}
|
||||
echo file_get_contents($fichierWsdl);
|
||||
|
||||
} elseif ( isset($_GET['wsdl']) && !file_exists($fichierWsdl)
|
||||
|| isset($_GET['wsdl-generate'])
|
||||
|| isset($_GET['wsdl-auto']) ) {
|
||||
|
||||
// Définition du webservice
|
||||
$wsdl = new Zend_Soap_AutoDiscover();
|
||||
$wsdl->setComplexTypeStrategy('Zend_Soap_Wsdl_Strategy_ArrayOfTypeSequence');
|
||||
$wsdl->setOperationBodyStyle( array('use' => 'literal') );
|
||||
$wsdl->setBindingStyle( array('style' => 'document') );
|
||||
$wsdl->setClass($serviceClassName);
|
||||
|
||||
// Enregistrement du WSDL dans un fichier
|
||||
if ( isset($_GET['wsdl-generate']) ) {
|
||||
if (file_exists($fichierWsdl)) {
|
||||
unlink($fichierWsdl);
|
||||
}
|
||||
$wsdl->dump($fichierWsdl);
|
||||
echo "Le fichier $fichierWsdl a été généré";
|
||||
|
||||
//Génération/Fourniture du wsdl
|
||||
} elseif (isset($_GET['wsdl']) && !file_exists($fichierWsdl)) {
|
||||
$wsdl->dump($fichierWsdl);
|
||||
if (!headers_sent()) {
|
||||
header('Content-Type: text/xml');
|
||||
}
|
||||
echo file_get_contents($fichierWsdl);
|
||||
|
||||
// Envoi sur la sortie standard le wsdl sans enregistrement dans un fichier
|
||||
} elseif ( isset($_GET['wsdl-auto']) ){
|
||||
$wsdl->handle();
|
||||
}
|
||||
|
||||
// Fourniture du service
|
||||
} else {
|
||||
|
||||
// Traitement
|
||||
if (APPLICATION_ENV == 'production' && file_exists($fichierWsdl)) {
|
||||
$server = new Zend_Soap_Server($fichierWsdl);
|
||||
} else {
|
||||
$hostName = $this->getRequest()->getHttpHost();
|
||||
$server = new Zend_Soap_Server('http://'.$hostName.'/'.$pathServiceUrl);
|
||||
}
|
||||
|
||||
$server->setSoapFeatures(SOAP_USE_XSI_ARRAY_TYPE + SOAP_SINGLE_ELEMENT_ARRAYS);
|
||||
$server->setClassmap($classmap);
|
||||
$server->setEncoding('UTF-8');
|
||||
$server->registerFaultException(array('WsScores_Exception'));
|
||||
$server->setWsiCompliant(true);
|
||||
$server->setObject(new $serviceClassName());
|
||||
$server->handle();
|
||||
|
||||
//Pour débuggage ultime
|
||||
$debug = false;
|
||||
if ($debug){
|
||||
$request = $server->getLastRequest();
|
||||
file_put_contents(APPLICATION_PATH . '/../request.log', $request);
|
||||
$response = $server->getLastResponse();
|
||||
file_put_contents(APPLICATION_PATH . '/../response.log', $response);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,67 +0,0 @@
|
||||
<?php
|
||||
class UserController extends Zend_Controller_Action {
|
||||
|
||||
public function init()
|
||||
{
|
||||
$activeNav = $this->view->navigation();
|
||||
$activeNav->removePages();
|
||||
}
|
||||
|
||||
public function indexAction()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function loginAction()
|
||||
{
|
||||
$this->view->headTitle()->append('Connexion');
|
||||
$form = new Form_Login();
|
||||
$this->view->form = $form;
|
||||
$request = $this->getRequest();
|
||||
if ($request->isPost()) {
|
||||
$formData = $request->getPost ();
|
||||
if ($form->isValid($formData)) {
|
||||
$login = $form->getValue('login');
|
||||
$pass = $form->getValue('pass');
|
||||
$auth = Zend_Auth::getInstance();
|
||||
$authAdapter = new Scores_AuthAdapter($login, $pass);
|
||||
$result = $auth->authenticate($authAdapter);
|
||||
if (!$result->isValid()){
|
||||
$this->view->message = '';
|
||||
foreach ($result->getMessages() as $message) {
|
||||
$this->view->message.= $message."<br/>";
|
||||
}
|
||||
} else {
|
||||
$timeout = $auth->getIdentity()->timeout;
|
||||
|
||||
//Ecrit un cookie persistant valide pendant le temps definit
|
||||
Zend_Session::rememberMe($timeout);
|
||||
|
||||
$storage = new Zend_Auth_Storage_Session();
|
||||
$sessionNamespace = new Zend_Session_Namespace($storage->getNamespace());
|
||||
$sessionNamespace->setExpirationSeconds($timeout);
|
||||
$auth->setStorage($storage);
|
||||
$url = '';
|
||||
if (Zend_Session::namespaceIsset('login')){
|
||||
$session = new Zend_Session_Namespace('login');
|
||||
if (isset($session->url)) {
|
||||
$url = $session->url;
|
||||
}
|
||||
}
|
||||
if (!empty($url)){
|
||||
$this->_redirect($url);
|
||||
}
|
||||
|
||||
$this->_redirect('/');
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function logoutAction()
|
||||
{
|
||||
Zend_Auth::getInstance()->clearIdentity();
|
||||
}
|
||||
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_AssoActes extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'asso_actes';
|
||||
protected $_schema = 'jo';
|
||||
|
||||
public function insert(array $data)
|
||||
{
|
||||
// Ajout d'un timestamp
|
||||
if (empty($data['dateInsert'])) {
|
||||
$data['dateInsert'] = date('Y-m-d H:i:s');
|
||||
}
|
||||
return parent::insert($data);
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_BopiMarques extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'marques';
|
||||
protected $_schema = 'bopi';
|
||||
}
|
@ -1,21 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_Commandes extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'commandes';
|
||||
|
||||
protected $_dependentTables = array(
|
||||
'Application_Model_CommandesEven',
|
||||
'Application_Model_CommandesPieces',
|
||||
);
|
||||
|
||||
public function insert(array $data)
|
||||
{
|
||||
// Ajout d'un timestamp
|
||||
if (empty($data['date_added'])) {
|
||||
$data['date_added'] = date('Y-m-d H:i:s');
|
||||
}
|
||||
return parent::insert($data);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,5 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_CommandesActe extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'commandes_acte';
|
||||
}
|
@ -1,5 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_CommandesAsso extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'commandes_asso';
|
||||
}
|
@ -1,5 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_CommandesBilan extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'commandes_bilan';
|
||||
}
|
@ -1,21 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_CommandesEven extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'commandes_even';
|
||||
|
||||
protected $_referenceMap = array(
|
||||
'CommandesEven' => array(
|
||||
'columns' => array('commande_id'),
|
||||
'refTableClass' => 'Application_Model_Commandes',
|
||||
'refColumns' => array('id'),
|
||||
),
|
||||
);
|
||||
|
||||
public function insert(array $data)
|
||||
{
|
||||
if (empty($data['date_added'])) {
|
||||
$data['date_added'] = date('Y-m-d H:i:s');
|
||||
}
|
||||
return parent::insert($data);
|
||||
}
|
||||
}
|
@ -1,5 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_CommandesKbis extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'commandes_kbis';
|
||||
}
|
@ -1,13 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_CommandesPieces extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'commandes_pieces';
|
||||
|
||||
protected $_referenceMap = array(
|
||||
'CommandesPieces' => array(
|
||||
'columns' => array('commande_id'),
|
||||
'refTableClass' => 'Application_Model_Commandes',
|
||||
'refColumns' => array('id'),
|
||||
),
|
||||
);
|
||||
}
|
@ -1,5 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_CommandesStatut extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'commandes_statut';
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_ExtractionCommandes extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'commandes';
|
||||
|
||||
public function insert(array $data)
|
||||
{
|
||||
// Ajout d'un timestamp
|
||||
if (empty($data['dateAdded'])) {
|
||||
$data['dateAdded'] = date('Y-m-d H:i:s');
|
||||
}
|
||||
return parent::insert($data);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,6 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_FedasoBilans extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'fedaso_bilans';
|
||||
protected $_schema = 'sdv1';
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_HistoriquesBilans extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'bilans';
|
||||
protected $_schema = 'historiques';
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_JoAssoBilans extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'asso_bilans';
|
||||
protected $_schema = 'jo';
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_JoBilans extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'bilans';
|
||||
protected $_schema = 'jo';
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_JoBilansUser extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'bilans_user';
|
||||
protected $_schema = 'jo';
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_JoBoampLots extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'boamp_lots';
|
||||
protected $_schema = 'jo';
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_JoBodaccDetail extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'bodacc_detail';
|
||||
protected $_schema = 'jo';
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_JoBodaccFonctions extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'bodacc_fonctions';
|
||||
protected $_schema = 'jo';
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_JoGreffesActes extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'greffes_actes';
|
||||
protected $_schema = 'jo';
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_JoGreffesBilans extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'greffes_bilans';
|
||||
protected $_schema = 'jo';
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_JoLiens extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'liens2';
|
||||
protected $_schema = 'jo';
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_JoLiensDoc extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'liensDoc';
|
||||
protected $_schema = 'jo';
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_JoLiensRef extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'liensRef';
|
||||
protected $_schema = 'jo';
|
||||
|
||||
public function insert(array $data)
|
||||
{
|
||||
// Ajout d'un timestamp
|
||||
if (empty($data['dateInsert'])) {
|
||||
$data['dateInsert'] = date('YmdHis');
|
||||
}
|
||||
return parent::insert($data);
|
||||
}
|
||||
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_JoRncsDirigeants extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'rncs_dirigeants';
|
||||
protected $_schema = 'jo';
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_JoScoresCutoff extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'scores_cutoff';
|
||||
protected $_schema = 'jo';
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_JoTabDevises extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'tabDevises';
|
||||
protected $_schema = 'jo';
|
||||
protected $_primary = 'devIso';
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_JoTabEvenements extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'tabEvenements';
|
||||
protected $_schema = 'jo';
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_JoTabFJur extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'tabFJur';
|
||||
protected $_schema = 'jo';
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_JoTabNaf5 extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'tabNaf5';
|
||||
protected $_schema = 'jo';
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_JoTabPays extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'tabPays';
|
||||
protected $_schema = 'jo';
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_JoTelephonie extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'telephonie';
|
||||
protected $_schema = 'jo';
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_Sdv1BourseIsin extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'bourse_isin';
|
||||
protected $_schema = 'sdv1';
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_Sdv1Clients extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'clients';
|
||||
protected $_schema = 'sdv1';
|
||||
}
|
@ -1,14 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_Sdv1ClientsServices extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'clients_services';
|
||||
protected $_schema = 'sdv1';
|
||||
|
||||
protected $_referenceMap = array(
|
||||
'Login' => array(
|
||||
'columns' => array('code'),
|
||||
'refTableClass' => 'Application_Model_Sdv1UtilistateursService',
|
||||
'refColumns' => array('serviceCode')
|
||||
)
|
||||
);
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_Sdv1ClientsTarifs extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'clients_tarifs';
|
||||
protected $_schema = 'sdv1';
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_Sdv1Prestations extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'prestations';
|
||||
protected $_schema = 'sdv1';
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_Sdv1TabIdLocal extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'tabIdLocal';
|
||||
protected $_schema = 'sdv1';
|
||||
}
|
@ -1,13 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_Sdv1Utilisateurs extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'utilisateurs';
|
||||
protected $_schema = 'sdv1';
|
||||
protected $_referenceMap = array(
|
||||
'Reporter' => array(
|
||||
'columns' => 'idClient',
|
||||
'refTableClass' => 'Sdv1Clients',
|
||||
'refColumns' => 'id'
|
||||
),
|
||||
);
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_Sdv1UtilisateursService extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'utilisateurs_service';
|
||||
protected $_schema = 'sdv1';
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
<?php
|
||||
class Zend_View_Helper_DocComplement extends Zend_View_Helper_Abstract
|
||||
{
|
||||
public function docComplement($method)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
<?php
|
||||
class Zend_View_Helper_DocDescription extends Zend_View_Helper_Abstract
|
||||
{
|
||||
public function docDescription($method)
|
||||
{
|
||||
return $method['desc'];
|
||||
}
|
||||
}
|
@ -1,32 +0,0 @@
|
||||
<?php
|
||||
class Zend_View_Helper_DocExemple extends Zend_View_Helper_Abstract
|
||||
{
|
||||
public function docExemple($method)
|
||||
{
|
||||
$exemple = '';
|
||||
$langages = array(
|
||||
'php' => 'PHP',
|
||||
'java' => 'Java',
|
||||
'perl' => 'Perl',
|
||||
'python' => 'Python',
|
||||
'csharp' => 'C#'
|
||||
);
|
||||
|
||||
foreach ($langages as $langage => $lib){
|
||||
$fichier = 'code/'.$method.'-'.$langage.'.txt';
|
||||
if (file_exists($fichier)){
|
||||
$url = $this->view->url(
|
||||
array(
|
||||
'controller' => 'documentation',
|
||||
'action' => 'code',
|
||||
'langage' => $langage,
|
||||
'element' => $method,
|
||||
)
|
||||
);
|
||||
$exemple.= '<a href="'.$url.'">' . $lib . '</a>';
|
||||
$exemple.= ' ';
|
||||
}
|
||||
}
|
||||
return $exemple;
|
||||
}
|
||||
}
|
@ -1,61 +0,0 @@
|
||||
<?php
|
||||
class Zend_View_Helper_DocMethod extends Zend_View_Helper_Abstract
|
||||
{
|
||||
|
||||
protected $_transcodeType = array(
|
||||
'str' => 'string',
|
||||
'bool' => 'boolean',
|
||||
'integer' => 'int',
|
||||
);
|
||||
|
||||
public function docMethod($method)
|
||||
{
|
||||
$output = '';
|
||||
|
||||
$returnType = $method['return'];
|
||||
$methodName = $method['name'];
|
||||
|
||||
$cptParameters = 0;
|
||||
$parameters = '';
|
||||
foreach ($method['params'] as $param) {
|
||||
if (isset($param['optional'])) {
|
||||
$parameters.= '[';
|
||||
}
|
||||
$parameters.= '<i>' . $this->transcodeType($param['type']) . '</i>';
|
||||
$parameters.= ' ';
|
||||
$parameters.= '<b>' . $param['name'] . '</b>';
|
||||
|
||||
if (isset($param['optional'])) {
|
||||
if (isset($param['defaultValue'])) {
|
||||
$parameters.= ' = ';
|
||||
if (is_bool($param['defaultValue'])){
|
||||
$parameters.= ($param['defaultValue'] === false) ? 'false' : 'true' ;
|
||||
} elseif (is_string($param['defaultValue']) && $param['defaultValue']==''){
|
||||
$parameters.= "''";
|
||||
} else {
|
||||
$parameters.= $param['defaultValue'];
|
||||
}
|
||||
}
|
||||
$parameters.= ']';
|
||||
}
|
||||
$cptParameters++;
|
||||
if ($cptParameters < count($method['params'])){
|
||||
$parameters.= ', ';
|
||||
}
|
||||
}
|
||||
$output = '<i>' . $this->transcodeType($returnType) . '</i>';
|
||||
$output.= ' ';
|
||||
$output.= '<b>' . $methodName . '</b>' . ' <b>(</b> ' . $parameters . ' <b>)</b>';
|
||||
return $output;
|
||||
}
|
||||
|
||||
private function transcodeType($type)
|
||||
{
|
||||
if(array_key_exists($type, $this->_transcodeType)){
|
||||
return $this->_transcodeType[$type];
|
||||
} else {
|
||||
return $type;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -1,81 +0,0 @@
|
||||
<?php
|
||||
class Zend_View_Helper_DocParameter extends Zend_View_Helper_Abstract
|
||||
{
|
||||
protected $serviceTypes;
|
||||
|
||||
protected $types = array(
|
||||
'string', 'str',
|
||||
'boolean', 'bool',
|
||||
'int', 'integer', 'long',
|
||||
'float', 'double',
|
||||
'array', 'object', 'mixed'
|
||||
);
|
||||
|
||||
protected $_transcodeType = array(
|
||||
'str' => 'string',
|
||||
'bool' => 'boolean',
|
||||
'integer' => 'int',
|
||||
);
|
||||
|
||||
public function docParameter($params, $serviceTypes)
|
||||
{
|
||||
$this->serviceTypes = $serviceTypes;
|
||||
$output = '';
|
||||
if (count($params)>0) {
|
||||
$output.= '<ul>';
|
||||
foreach ($params as $param) {
|
||||
$output.= $this->formatParam($param);
|
||||
}
|
||||
$output.= '</ul>';
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
||||
private function parseType($type)
|
||||
{
|
||||
$output = '';
|
||||
$type = str_replace('[]', '', $type);
|
||||
if (array_key_exists($type, $this->serviceTypes)) {
|
||||
$types = $this->serviceTypes[$type];
|
||||
$output.= '<ul>';
|
||||
foreach ($types as $param) {
|
||||
$output.= $this->formatParam($param);
|
||||
}
|
||||
$output.= '</ul>';
|
||||
} elseif (in_array($type, $this->types)) {
|
||||
$output.= '';
|
||||
} elseif ($type == 'void'){
|
||||
$output.= 'Void';
|
||||
} else {
|
||||
$output.= ' => <b>Type '.$type.' inconnu</b>';
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
||||
private function formatParam($param)
|
||||
{
|
||||
$output = '';
|
||||
$output.= '<li>';
|
||||
$output.= '<i>' . $this->transcodeType($param['type']) . '</i>';
|
||||
$output.= ' ';
|
||||
$output.= '<b>' . $param['name'] . '</b>';
|
||||
if (isset($param['description']) && !empty($param['description'])) {
|
||||
$output.= ' - '.$param['description'];
|
||||
}
|
||||
if (!in_array($param['type'], $this->types)) {
|
||||
$output.= $this->parseType($param['type']);
|
||||
}
|
||||
$output.= '</li>';
|
||||
return $output;
|
||||
}
|
||||
|
||||
private function transcodeType($type)
|
||||
{
|
||||
if(array_key_exists($type, $this->_transcodeType)){
|
||||
return $this->_transcodeType[$type];
|
||||
} else {
|
||||
return $type;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -1,74 +0,0 @@
|
||||
<?php
|
||||
class Zend_View_Helper_DocReturn extends Zend_View_Helper_Abstract
|
||||
{
|
||||
protected $serviceTypes;
|
||||
|
||||
protected $types = array(
|
||||
'string', 'str',
|
||||
'boolean', 'bool',
|
||||
'integer', 'int', 'long',
|
||||
'float', 'double',
|
||||
'array', 'object', 'mixed'
|
||||
);
|
||||
|
||||
protected $_transcodeType = array(
|
||||
'str' => 'string',
|
||||
'bool' => 'boolean',
|
||||
'integer' => 'int',
|
||||
);
|
||||
|
||||
public function docReturn($type, $serviceTypes)
|
||||
{
|
||||
$this->serviceTypes = $serviceTypes;
|
||||
return $this->parseType($type);
|
||||
}
|
||||
|
||||
private function parseType($type)
|
||||
{
|
||||
$output = '';
|
||||
$type = str_replace('[]', '', $type);
|
||||
if (array_key_exists($type, $this->serviceTypes)) {
|
||||
$types = $this->serviceTypes[$type];
|
||||
$output.= '<ul>';
|
||||
foreach ($types as $param) {
|
||||
$output.= $this->formatParam($param);
|
||||
}
|
||||
$output.= '</ul>';
|
||||
} elseif (in_array($type, $this->types)) {
|
||||
$output.= '<i>' . $type . '</i> ';
|
||||
} elseif ($type == 'void'){
|
||||
$output.= 'Void';
|
||||
} else {
|
||||
$output.= ' => <b>Type '.$type.' inconnu</b>';
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
||||
private function formatParam($param)
|
||||
{
|
||||
$output = '';
|
||||
$output.= '<li>';
|
||||
$output.= '<i>' . $this->transcodeType($param['type']) . '</i>';
|
||||
$output.= ' ';
|
||||
$output.= '<b>'. $param['name'] . '</b>';
|
||||
if (isset($param['description']) && !empty($param['description'])) {
|
||||
$output.= ' - '.$param['description'];
|
||||
}
|
||||
$type = str_replace('[]', '', $param['type']);
|
||||
if (!in_array($type, $this->types)) {
|
||||
$output.= $this->parseType($param['type']);
|
||||
}
|
||||
$output.= '</li>';
|
||||
return $output;
|
||||
}
|
||||
|
||||
private function transcodeType($type)
|
||||
{
|
||||
if(array_key_exists($type, $this->_transcodeType)){
|
||||
return $this->_transcodeType[$type];
|
||||
} else {
|
||||
return $type;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
<?php
|
||||
|
||||
class Zend_View_Helper_ProfileLink extends Zend_View_Helper_Abstract
|
||||
{
|
||||
public function profileLink()
|
||||
{
|
||||
$auth = Zend_Auth::getInstance();
|
||||
if ($auth->hasIdentity()) {
|
||||
$username = $auth->getIdentity()->username;
|
||||
$logoutUrl = $this->view->url(array(
|
||||
'controller' => 'user',
|
||||
'action' => 'logout'
|
||||
));
|
||||
return '<a href="'.$logoutUrl.'" alt="Se déconnecter">Déconnexion : ' . $username . '</a>';
|
||||
}
|
||||
}
|
||||
}
|
@ -1,13 +0,0 @@
|
||||
<h1>Démonstration - Liste des méthodes</h1>
|
||||
<ul>
|
||||
<?php
|
||||
foreach($this->methods as $method){
|
||||
?>
|
||||
<li>
|
||||
<a href="<?php echo $method['url'];?>">
|
||||
<?php echo $method['nom'];?></a>
|
||||
</li>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</ul>
|
@ -1,5 +0,0 @@
|
||||
<h2><?php echo $this->method;?></h2>
|
||||
<p><?php echo $this->message;?></p>
|
||||
<div>
|
||||
<?php echo $this->form;?>
|
||||
</div>
|
@ -1,20 +0,0 @@
|
||||
<h2>SOAP</h2>
|
||||
|
||||
<p>Requete</p>
|
||||
<textarea rows="10" cols="100" name="soap-requete">
|
||||
<?php print_r($this->soap['requete']);?>
|
||||
</textarea>
|
||||
<p>Réponse</p>
|
||||
<textarea rows="10" cols="100" name="soap-reponse">
|
||||
<?php print_r($this->soap['reponse']);?>
|
||||
</textarea>
|
||||
|
||||
<h2>XML</h2>
|
||||
<p>Requete</p>
|
||||
<textarea rows="10" cols="100" name="xml-requete">
|
||||
<?php echo $this->xml['requete'];?>
|
||||
</textarea>
|
||||
<p>Réponse</p>
|
||||
<textarea rows="10" cols="100" name="xml-reponse">
|
||||
<?php echo $this->xml['reponse'];?>
|
||||
</textarea>
|
@ -1,42 +0,0 @@
|
||||
<div id="wsdl">
|
||||
<h1>WSDL</h1>
|
||||
<p><a href="<?=$this->wsdl?>">Télécharger le WSDL</a></p>
|
||||
<i>Le fichier est accessible sans authentification.</i>
|
||||
</div>
|
||||
|
||||
<div class="op-list">
|
||||
<h1>Liste des opérations :</h1>
|
||||
<ol>
|
||||
<?php foreach ($this->serviceMethods as $method) {?>
|
||||
<li>
|
||||
<b><?php echo $method['name'];?></b>
|
||||
<a href="#<?php echo $method['name'];?>"><i>Détail</i></a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
<div class="op-detail">
|
||||
<h1>Détails :</h1>
|
||||
<?php foreach ($this->serviceMethods as $method) {?>
|
||||
<div class="function">
|
||||
<a name="<?php echo $method['name'];?>"> </a>
|
||||
<h2><?php echo $method['name'];?></h2>
|
||||
<div><u>Description : </u></div>
|
||||
<div class="description"><?=$this->docDescription($method)?></div>
|
||||
<div class="complement"><?=$this->docComplement($method)?></div>
|
||||
<div class="function-detail" id="<?=$method['name']?>">
|
||||
<p><?php echo $this->docMethod($method);?></p>
|
||||
<div><u>Paramètres : </u></div>
|
||||
<div class="parameters">
|
||||
<?php echo $this->docParameter($method['params'], $this->serviceTypes);?>
|
||||
</div>
|
||||
<div><u>Retour : </u></div>
|
||||
<div class="return">
|
||||
<?php echo $this->docReturn($method['return'], $this->serviceTypes);?>
|
||||
</div>
|
||||
</div>
|
||||
<p>Exemple : <?php echo $this->docExemple($method['name']);?></p>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
@ -1,2 +0,0 @@
|
||||
<h2><?=$this->langage?></h2>
|
||||
<pre><?=$this->code?></pre>
|
@ -1,10 +0,0 @@
|
||||
<div>
|
||||
<h1>Liste des code erreurs/messages :</h1>
|
||||
<ul>
|
||||
<?php foreach ($this->erreurs as $code => $message) {?>
|
||||
<li>
|
||||
<b><?php echo $code?></b> : <?php echo $message?>
|
||||
</li>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
</div>
|
@ -1,2 +0,0 @@
|
||||
<h2>Liste des exemples</h2>
|
||||
|
@ -1,46 +0,0 @@
|
||||
<div id="wsdl">
|
||||
<h1>WSDL</h1>
|
||||
<p><a href="<?=$this->wsdl?>">Télécharger le WSDL</a></p>
|
||||
<i>Le fichier est accessible sans authentification.</i>
|
||||
</div>
|
||||
|
||||
<div class="op-list">
|
||||
<h1>Liste des opérations :</h1>
|
||||
<ol>
|
||||
<?php foreach ($this->serviceMethods as $method) {?>
|
||||
<li>
|
||||
<b><?php echo $method['name'];?></b>
|
||||
<a href="#<?php echo $method['name'];?>"><i>Détail</i></a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
<div class="op-detail">
|
||||
<h1>Détails :</h1>
|
||||
<?php foreach ($this->serviceMethods as $method) {?>
|
||||
<div class="function">
|
||||
<a name="<?=$method['name']?>"> </a>
|
||||
<h2><?=$method['name']?></h2>
|
||||
<div class="titre">Description :</div>
|
||||
<div class="description"><?=$this->docDescription($method)?></div>
|
||||
<div class="titre">Empreinte :</div>
|
||||
<div class="complement"><?=$this->docComplement($method)?></div>
|
||||
<div class="function-detail" id="<?=$method['name']?>">
|
||||
<p><?=$this->docMethod($method)?></p>
|
||||
<div class="titre">Paramètres :</div>
|
||||
<div class="parameters">
|
||||
<?=$this->docParameter($method['params'], $this->serviceTypes);?>
|
||||
</div>
|
||||
<div class="titre">Retour :</div>
|
||||
<div class="return">
|
||||
<?=$this->docReturn($method['return'], $this->serviceTypes);?>
|
||||
</div>
|
||||
</div>
|
||||
<?php $exemple = $this->docExemple($method['name'])?>
|
||||
<?php if (!empty($exemple)) {?>
|
||||
<p>Exemple : <?=$exemple?></p>
|
||||
<?php }?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
@ -1 +0,0 @@
|
||||
Erreur
|
@ -1,28 +0,0 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>Zend Framework Default Application</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>An error occurred</h1>
|
||||
<h2><?php echo $this->message ?></h2>
|
||||
|
||||
<?php if (isset($this->exception)): ?>
|
||||
|
||||
<h3>Exception information:</h3>
|
||||
<p>
|
||||
<b>Message:</b> <?php echo $this->exception->getMessage() ?>
|
||||
</p>
|
||||
|
||||
<h3>Stack trace:</h3>
|
||||
<pre><?php echo $this->exception->getTraceAsString() ?>
|
||||
</pre>
|
||||
|
||||
<h3>Request Parameters:</h3>
|
||||
<pre><?php echo var_export($this->request->getParams(), true) ?>
|
||||
</pre>
|
||||
<?php endif ?>
|
||||
|
||||
</body>
|
||||
</html>
|
@ -1 +0,0 @@
|
||||
<?php
|
@ -1,12 +0,0 @@
|
||||
<h1>WebService Scores & Décisions</h1>
|
||||
<div>
|
||||
<div id="menu">
|
||||
<?php echo $this->navigation()->menu(); ?>
|
||||
</div>
|
||||
<div style="float:right;">
|
||||
<?php echo $this->profileLink(); ?>
|
||||
</div>
|
||||
<div id="breadcrumbs" style="clear:both;">
|
||||
<?php /*echo $this->navigation()->breadcrumbs()->setMinDepth(0)->setLinkLast(true)->setSeparator(" >> ");*/ ?>
|
||||
</div>
|
||||
</div>
|
@ -1,53 +0,0 @@
|
||||
<div>
|
||||
|
||||
<h2>Intégration d'un fichier</h2>
|
||||
|
||||
<p>Taille maximale d'un fichier : <?=$this->filesize?></p>
|
||||
|
||||
<form enctype="multipart/form-data" name="sendfile" action="<?=$this->url(array('controller'=>'import','action'=>'fileupload'))?>" method="post">
|
||||
<input type="hidden" name="APC_UPLOAD_PROGRESS" id="key" value="<?=uniqid()?>"/>
|
||||
<input type="hidden" name="idClient" value="<?=$this->idClient?>" />
|
||||
<input type="hidden" name="login" value="<?=$this->login?>" />
|
||||
|
||||
<div class="fieldgrp">
|
||||
<label>Fichier</label>
|
||||
<div class="field">
|
||||
<input type="file" id="fichier" name="fichier"/>
|
||||
<input type="submit" value="Envoi"/>
|
||||
|
||||
<div id="progressbar"></div>
|
||||
<div id="output"></div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
<?=$this->inlineScript()?>
|
||||
|
||||
<script>
|
||||
var timer;
|
||||
|
||||
$('form[name=sendfile]').ajaxForm({
|
||||
beforeSubmit: function() {
|
||||
timer = setInterval(checkProgress,200);
|
||||
$('#progressbar').reportprogress(0);
|
||||
$('#output').html('Envoi en cours...');
|
||||
},
|
||||
success: function(data) {
|
||||
clearInterval(timer);
|
||||
$('#progressbar').remove();
|
||||
$('#output').html('<strong>' + data + '</strong>');
|
||||
}
|
||||
});
|
||||
|
||||
function checkProgress() {
|
||||
$.get('<?=$this->url(array('controller'=>'import', 'action'=>'fileprogress'))?>',
|
||||
{key: $('#key').val()}, function(data) {
|
||||
var percent = data.current/data.total*100;
|
||||
$('#progressbar').reportprogress(percent);
|
||||
}, 'json');
|
||||
}
|
||||
</script>
|
@ -1,86 +0,0 @@
|
||||
<h1>Liste des services disponibles</h1>
|
||||
<ul>
|
||||
<?php foreach ($this->ws as $key => $ws) {?>
|
||||
|
||||
<li>
|
||||
<?php if ($ws['type'] == 'client'){?>
|
||||
<a href="<?=$this->url(array('controller' => 'documentation', 'action' => 'clients', 'nom' => strtolower($key)))?>">
|
||||
<?=ucfirst($key)?>
|
||||
</a>
|
||||
<?php } else {?>
|
||||
<a href="<?=$this->url(array('controller' => 'documentation', 'ws' => $key))?>">
|
||||
<?=ucfirst($key)?>
|
||||
</a>
|
||||
<?php }?>
|
||||
</li>
|
||||
|
||||
<?php if (isset($ws['version'])){ ?>
|
||||
<ul>
|
||||
<?php
|
||||
foreach ($ws['version'] as $version => $versionElement){
|
||||
if ($versionElement['actif']) {
|
||||
?>
|
||||
<li>
|
||||
<?php if ($ws['type'] == 'client'){?>
|
||||
<a href="<?=$this->url(array(
|
||||
'controller' => 'documentation',
|
||||
'action' => 'clients',
|
||||
'nom' => strtolower($key),
|
||||
'version' => $version,
|
||||
))?>">Version <?=$version?></a>
|
||||
<?php } else {?>
|
||||
<a href="<?=$this->url(array(
|
||||
'controller' => 'documentation',
|
||||
'ws' => $key,
|
||||
'version' => $version,
|
||||
))?>">Version <?=$version?></a>
|
||||
<?php }?>
|
||||
|
||||
<?php echo ( $versionElement['defaut']) ? '(défaut)' : '';?>
|
||||
</li>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
<?php } ?>
|
||||
|
||||
<?php } ?>
|
||||
</ul>
|
||||
|
||||
<br/>
|
||||
<h1>Authentification</h1>
|
||||
<p>
|
||||
Le WebService utilise une authentification http basique.
|
||||
Il s'agit donc de transmettre comme paramètres d'authentification
|
||||
</p>
|
||||
<p>http://{login}:{password}@url</p>
|
||||
<p>
|
||||
{password} est une chaine construite de cette façon md5({login}|{pass}) <br/>
|
||||
ou {login} est l'identifiant fournit <br/>
|
||||
et {pass} le mot de passe fournit.
|
||||
</p>
|
||||
<p>
|
||||
Vous trouverez dans ces exemples les prérequis pour s'authentifier et suivant
|
||||
les outils et langage la possibilité de générer le code à partir du WSDL.<br/>
|
||||
Exemple : <?=$this->docExemple('authentication')?>
|
||||
</p>
|
||||
|
||||
<br/>
|
||||
<h1>Compatibilité</h1>
|
||||
<p>Notre service web a été testé avec ces langages/librairies</p>
|
||||
<ul>
|
||||
<li>PHP : PHP5 SOAP Extension</li>
|
||||
<li>Perl : SOAP::Lite</li>
|
||||
<li>Java : JAX-WS</li>
|
||||
<li>(En cours de test) - Python : SOAPpy</li>
|
||||
<li>(En cours de test) - C# : .Net Framework</li>
|
||||
<li>(En cours de test) - VB.Net : .Net Framework</li>
|
||||
<li>(En cours de test) - C++ : gSOAP</li>
|
||||
</ul>
|
||||
|
||||
<br/>
|
||||
<p>
|
||||
Pour toutes remarques ou question merci d'adresser un email à
|
||||
<a href="mailto:support@scores-decisions.com">support@scores-decisions.com</a>
|
||||
</p>
|
@ -1,23 +0,0 @@
|
||||
<?php echo $this->doctype(); ?>
|
||||
<html>
|
||||
<head>
|
||||
<?php echo $this->headMeta(); ?>
|
||||
<?php echo $this->headTitle(); ?>
|
||||
<?php echo $this->headStyle(); ?>
|
||||
<?php echo $this->headLink(); ?>
|
||||
<?php echo $this->headScript(); ?>
|
||||
</head>
|
||||
<body>
|
||||
<div id="global">
|
||||
<div id="header">
|
||||
<?php echo $this->render('header.phtml') ?>
|
||||
</div>
|
||||
<div id="content" style="clear:both;">
|
||||
<?php echo $this->layout()->content; ?>
|
||||
</div>
|
||||
<div id="footer">
|
||||
<?php echo $this->render('footer.phtml'); ?>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -1 +0,0 @@
|
||||
<?= $this->message ?>
|
@ -1 +0,0 @@
|
||||
<?php
|
@ -1 +0,0 @@
|
||||
<?= $this->message ?>
|
@ -1 +0,0 @@
|
||||
|
@ -1,2 +0,0 @@
|
||||
<p>Identifiez-vous pour accèder aux ressources</p>
|
||||
<?=$this->form?>
|
@ -1 +0,0 @@
|
||||
Vous avez été déconnecté.
|
@ -1,55 +0,0 @@
|
||||
Le fichier Zend/Soap/Wsdl/Strategy/DefaultComplexType.php a été modifié pour
|
||||
générer la documentation automatiquement.
|
||||
|
||||
/**
|
||||
* Traitement éléments de documentation à placer dans le WSDL
|
||||
* Supprime les retours chariots.
|
||||
* Récupére les éléments de documentation
|
||||
*/
|
||||
$comment = '';
|
||||
$docBlock = preg_replace('/\n/', '', $property->getDocComment() );
|
||||
if (preg_match('/\/\*\*(.+) \* @var\s+[^\s]+\s+(?:\*|@)/m', $docBlock, $docBlockMatches)) {
|
||||
$comment.= preg_replace(
|
||||
array('/\r/', '/\t\s\*/'),
|
||||
array('', ''), $docBlockMatches[1]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Ajout des éléments de documentation au WSDL
|
||||
*/
|
||||
if (!empty($comment)){
|
||||
$annotation = $dom->createElement('xsd:annotation');
|
||||
$documentation = $dom->createElement('xsd:documentation', trim($comment));
|
||||
$annotation->appendChild($documentation);
|
||||
$element->appendChild($annotation);
|
||||
}
|
||||
|
||||
===============================================================================>
|
||||
|
||||
Le fichier Zend/Soap/AutoDiscover.php a été modifié
|
||||
function _addFunctionToWsdl
|
||||
|
||||
$sequenceElement = array(
|
||||
'name' => $param->getName(),
|
||||
'type' => $wsdl->getType($param->getType()),
|
||||
'desc' => $param->getDescription()
|
||||
);
|
||||
|
||||
===============================================================================>
|
||||
|
||||
Le fichier Zend/Soap/Wsdl.php a été modifié
|
||||
function _parseElement
|
||||
|
||||
} elseif ($key == 'desc') {
|
||||
if (!empty($value)) {
|
||||
$annotation = $this->_dom->createElement('xsd:annotation');
|
||||
$documentation = $this->_dom->createElement('xsd:documentation', trim($value));
|
||||
$annotation->appendChild($documentation);
|
||||
$elementXml->appendChild($annotation);
|
||||
}
|
||||
} else {
|
||||
|
||||
|
||||
|
||||
|
179
docs/README.txt
179
docs/README.txt
@ -1,179 +0,0 @@
|
||||
README
|
||||
======
|
||||
Le webservice est basé sur le ZendFramework pour générer les WSDLs.
|
||||
|
||||
Fichier de configuration
|
||||
========================
|
||||
La configuration est décomposé en plusieurs fichiers,
|
||||
avec adaptation suivant la machine
|
||||
- mysql.php
|
||||
- smtp.php
|
||||
- sphinx.php
|
||||
- stockage.php
|
||||
|
||||
sans adaptation suivant la machine
|
||||
- partenaires.php
|
||||
|
||||
Fonctionnement
|
||||
==============
|
||||
Obtenir les WSDL
|
||||
Pour le service Entreprise
|
||||
|
||||
- En mode développement : http://hostname/entreprise/version?wsdl-auto
|
||||
- Générer le WSDL : http://hostname/entreprise/version?wsdl-generate
|
||||
- Utiliser le WSDL généré : http://hostname/entreprise/version?wsdl
|
||||
|
||||
Pour le service Interne
|
||||
|
||||
http://hostname/interne/version?wsdl
|
||||
|
||||
Pour les clients
|
||||
|
||||
http://hostname/clients/nom_du_client/version?wsdl
|
||||
|
||||
N.B : Le fichier WSDL est généré automatiquement en appelant
|
||||
http://hostname/service?wsdl afin de ne pas provoquer d'erreur
|
||||
après une mise en production
|
||||
|
||||
Pour définir le mode (vhost d'apache)
|
||||
SetEnv APPLICATION_ENV "development"
|
||||
SetEnv APPLICATION_ENV "production"
|
||||
SetEnv APPLICATION_ENV "staging"
|
||||
|
||||
En appelant l'url http://hostname/service, le contoller de l'application,
|
||||
"service" est automatiquement utiliser.
|
||||
Tout ce qui est visible dans la class est utilisé par le controller et se
|
||||
retrouve visible dans le service (wsdl, requête)
|
||||
|
||||
Si des fonctions ne doivent pas être rendu visible il faut donc les séparer
|
||||
dans un autre controller utilisant une autre class.
|
||||
|
||||
|
||||
Documentation des méthodes et ajout spécial
|
||||
===========================================
|
||||
|
||||
La documentation est géneré en automatique.
|
||||
|
||||
Voici comment définir simplement la documentation d'une méthode
|
||||
|
||||
/**
|
||||
* Retourne les informations identitaires de l'entreprise ou de l'établissement demandé
|
||||
* @param string $key Siren de l'entreprise ou siret de l'établissement
|
||||
* @return Identite
|
||||
*/
|
||||
public function test($key)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
Attention ces informations servent aussi pour la structure du WSDL
|
||||
|
||||
Pour spécifier un lien vers un fichier ou pour générer un fichier depuis une
|
||||
requête SQL à partir de la documentation du service.
|
||||
Ajouter dans le docblock :
|
||||
- Pour un fichier
|
||||
@ref fichier:libellé:{nom_du_fichier.ext}
|
||||
- Pour une requête SQL
|
||||
@ref mysql:libellé:{nom_du_fichier.sql}
|
||||
|
||||
Les fichiers a télécharger sont à placer dans le répértoire public/fichier et
|
||||
les fichiers sql dans public/sql
|
||||
|
||||
Pour spécifier des éléments de taille (non pris en compte sur le WSDL)
|
||||
@xsd minLength=9
|
||||
@xsd maxLength=15
|
||||
|
||||
Configuration PHP
|
||||
=================
|
||||
apt-get install php5-mysql
|
||||
apt-get install php-apc
|
||||
apt-get install php5-curl
|
||||
apt-get install php5-xmlrpc
|
||||
|
||||
Paquet PEAR
|
||||
- Mail
|
||||
- Mail_Mime
|
||||
|
||||
WKHTMLTOPDF
|
||||
===========
|
||||
apt-get install libXrender1
|
||||
apt-get install libfontconfig
|
||||
|
||||
Configuration VHOST
|
||||
===================
|
||||
a2enmod rewrite
|
||||
|
||||
Exemple de vhost en mode développement
|
||||
|
||||
<VirtualHost *:80>
|
||||
ServerName scoresws.sd.dev
|
||||
AddDefaultCharset utf-8
|
||||
|
||||
# Pour la gestion des ports : $_SERVER['SERVER_NAME'], $_SERVER['SERVER_PORT']
|
||||
UseCanonicalName On
|
||||
UseCanonicalPhysicalPort On
|
||||
|
||||
DocumentRoot "D:/www/webservice/public"
|
||||
SetEnv APPLICATION_ENV "development"
|
||||
<Directory "D:/www/webservice/public/">
|
||||
DirectoryIndex index.php
|
||||
AllowOverride All
|
||||
Order allow,deny
|
||||
Allow from all
|
||||
<IfModule mod_rewrite.c>
|
||||
RewriteEngine On
|
||||
RewriteCond %{REQUEST_URI} ^/favicon.ico$ [OR]
|
||||
RewriteCond %{REQUEST_FILENAME} -s [OR]
|
||||
RewriteCond %{REQUEST_FILENAME} -l [OR]
|
||||
RewriteCond %{REQUEST_FILENAME} -d
|
||||
RewriteRule ^.*$ - [NC,L]
|
||||
RewriteRule ^.*$ index.php [NC,L]
|
||||
</IfModule>
|
||||
</Directory>
|
||||
|
||||
# Possible values include: debug, info, notice, warn, error, crit, alert, emerg.
|
||||
LogLevel debug
|
||||
ErrorLog "logs/scoresws.sd.dev-error.log"
|
||||
CustomLog "logs/scoresws.sd.dev-access.log" common
|
||||
</VirtualHost>
|
||||
|
||||
|
||||
Vhost réel
|
||||
|
||||
<VirtualHost *:8081>
|
||||
ServerName wse.scores-decisions.com
|
||||
ServerAlias wse1.scores-decisions.com
|
||||
|
||||
# Pour la gestion des ports : $_SERVER['SERVER_NAME'], $_SERVER['SERVER_PORT']
|
||||
UseCanonicalName On
|
||||
UseCanonicalPhysicalPort On
|
||||
|
||||
ServerSignature Off
|
||||
AddDefaultCharset utf-8
|
||||
DocumentRoot /home/vhosts/webservice/public
|
||||
SetEnv APPLICATION_ENV "production"
|
||||
<Directory /home/vhosts/webservice/public/>
|
||||
DirectoryIndex index.php
|
||||
AllowOverride All
|
||||
Order allow,deny
|
||||
Allow from all
|
||||
<IfModule mod_rewrite.c>
|
||||
RewriteEngine On
|
||||
RewriteCond %{REQUEST_URI} ^/favicon.ico$ [OR]
|
||||
RewriteCond %{REQUEST_FILENAME} -s [OR]
|
||||
RewriteCond %{REQUEST_FILENAME} -l [OR]
|
||||
RewriteCond %{REQUEST_FILENAME} -d
|
||||
RewriteRule ^.*$ - [NC,L]
|
||||
RewriteRule ^.*$ index.php [NC,L]
|
||||
</IfModule>
|
||||
</Directory>
|
||||
|
||||
# Possible values include: debug, info, notice, warn, error, crit, alert, emerg.
|
||||
LogLevel error
|
||||
ErrorLog /var/log/apache2/webservice-error.log
|
||||
CustomLog /var/log/apache2/webservice-access.log common
|
||||
</VirtualHost>
|
||||
|
||||
|
||||
|
||||
|
@ -1,8 +0,0 @@
|
||||
Créer un fichier "webservice" dans /etc/logrotate.d
|
||||
|
||||
/var/log/webservice/*.log {
|
||||
weekly
|
||||
missingok
|
||||
compress
|
||||
notifempty
|
||||
}
|
@ -1,96 +0,0 @@
|
||||
<?php
|
||||
class Application_Controller_Plugin_Auth extends Zend_Controller_Plugin_Abstract
|
||||
{
|
||||
/**
|
||||
* Vérifie les autorisations
|
||||
* Utilise _request et _response hérités et injectés par le FC
|
||||
*
|
||||
* @param Zend_Controller_Request_Abstract $request : non utilisé, mais demandé par l'héritage
|
||||
*/
|
||||
public function preDispatch(Zend_Controller_Request_Abstract $request)
|
||||
{
|
||||
$controller = $request->getControllerName();
|
||||
$action = $request->getActionName();
|
||||
|
||||
$checkAuth = true;
|
||||
//Pas d'authentification sur la demande d'authentification
|
||||
if ( $controller == 'user' && $action == 'login' ) {
|
||||
$checkAuth = false;
|
||||
}
|
||||
|
||||
// Pas d'authentification sur ces services
|
||||
if ( in_array($controller, array('service', 'import'))
|
||||
|| ( $controller == 'fichier' && $action == 'logs' )
|
||||
|| ( $controller == 'fichier' && $action == 'kbis' )
|
||||
|| ( $controller == 'fichier' && $action == 'csv' )
|
||||
|| ( $controller == 'fichier' && $action == 'associations' )) {
|
||||
$checkAuth = false;
|
||||
}
|
||||
|
||||
$checkWs = true;
|
||||
if ( $controller == 'fichier' ) {
|
||||
$checkWs = false;
|
||||
}
|
||||
|
||||
if ($checkAuth) {
|
||||
$login = $request->getParam('login');
|
||||
$pass = $request->getParam('pass', '');
|
||||
$hach = $request->getParam('hach');
|
||||
|
||||
$auth = Zend_Auth::getInstance();
|
||||
|
||||
//On vérifie le tout lors d'une connexion par url
|
||||
if ( !empty($login) && !empty($hach) ) {
|
||||
|
||||
$authAdapter = new Scores_AuthAdapter($login, $hach, $checkWs);
|
||||
$result = $auth->authenticate($authAdapter);
|
||||
if (!$result->isValid()) {
|
||||
$layout = Zend_Layout::getMVCInstance();
|
||||
if ( !$layout->isEnabled() ){
|
||||
echo "Identification incorrect ou périmé.";
|
||||
} else {
|
||||
$request->setModuleName('default')
|
||||
->setControllerName('user')
|
||||
->setActionName('logout');
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
$storage = new Zend_Auth_Storage_Session();
|
||||
$session = new Zend_Session_Namespace($storage->getNamespace());
|
||||
//$session->setExpirationSeconds(86400);
|
||||
$auth->setStorage($storage);
|
||||
|
||||
}
|
||||
|
||||
//Sinon on reste sur le standard
|
||||
} else {
|
||||
//Pas authentifié
|
||||
if ( !$auth->hasIdentity() || time() > $auth->getIdentity()->time ) {
|
||||
|
||||
$auth->clearIdentity();
|
||||
$session = new Zend_Session_Namespace('login');
|
||||
$session->url = $_SERVER['REQUEST_URI'];
|
||||
|
||||
$layout = Zend_Layout::getMVCInstance();
|
||||
if (!$layout->isEnabled()){
|
||||
echo "Identification incorrect ou périmé.";
|
||||
} else {
|
||||
$this->_response->setRedirect('/user/login')->sendResponse();
|
||||
}
|
||||
//Authentifié => on met à jour la session
|
||||
} else {
|
||||
|
||||
$identity = $auth->getIdentity();
|
||||
$identity->time = time() + $identity->timeout;
|
||||
$auth->getStorage()->write($identity);
|
||||
|
||||
if (Zend_Session::namespaceIsset('login')){
|
||||
Zend_Session::namespaceUnset('login');
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,28 +0,0 @@
|
||||
<?php
|
||||
class Form_Login extends Zend_Form {
|
||||
|
||||
public function init()
|
||||
{
|
||||
$this->setName('login');
|
||||
$this->setAction('login');
|
||||
$this->setMethod('post');
|
||||
$this->addElement('text', 'login', array(
|
||||
'filters' => array('StringTrim'),
|
||||
'label' => 'Identifiant : ',
|
||||
'required' => 'true',
|
||||
)
|
||||
);
|
||||
$this->addElement('password', 'pass',
|
||||
array(
|
||||
'label' => 'Mot de passe : ',
|
||||
'required' => 'true',
|
||||
)
|
||||
);
|
||||
$this->addElement('submit', 'submit',
|
||||
array(
|
||||
'label' => 'Identification',
|
||||
'ignore' => true,
|
||||
));
|
||||
}
|
||||
|
||||
}
|
@ -1,40 +0,0 @@
|
||||
<?php
|
||||
class Infogreffe_Config
|
||||
{
|
||||
/**
|
||||
* Define access for the provider
|
||||
* @var array
|
||||
*/
|
||||
protected $config = array(
|
||||
'PRD' => array(
|
||||
'URL' => "https://webservices.infogreffe.fr/WSContextInfogreffe/INFOGREFFE",
|
||||
'URI' => "https://webservices.infogreffe.fr/",
|
||||
'USER' => "85000109",
|
||||
'PASS' => "166",
|
||||
),
|
||||
'REC' => array(
|
||||
'URL' => "https://wsrcte.extelia.fr/WSContextInfogreffe/INFOGREFFE",
|
||||
'URI' => "https://wsrcte.extelia.fr/",
|
||||
'USER' => "85000109",
|
||||
'PASS' => "160409",
|
||||
),
|
||||
);
|
||||
|
||||
/**
|
||||
* Define path to the WSDL
|
||||
* @var string
|
||||
*/
|
||||
protected $wsdl = 'infogreffe.wsdl';
|
||||
|
||||
/**
|
||||
* Time in hours to keep file
|
||||
* @var int
|
||||
*/
|
||||
protected $cacheFiletime = 8;
|
||||
|
||||
/**
|
||||
* Directory where cache file are store
|
||||
* @var string
|
||||
*/
|
||||
protected $cachePath = '/cache/';
|
||||
}
|
@ -1,545 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Configuration of provider
|
||||
*/
|
||||
require_once realpath(dirname(__FILE__)).'/Config.php';
|
||||
|
||||
/**
|
||||
* Infogreffe Provider
|
||||
*
|
||||
*
|
||||
*/
|
||||
class Infogreffe extends Infogreffe_Config
|
||||
{
|
||||
|
||||
/**
|
||||
* Where pdf file are store
|
||||
* @var string
|
||||
*/
|
||||
protected $dataPath = '';
|
||||
|
||||
/**
|
||||
* SIREN
|
||||
* @var string
|
||||
*/
|
||||
protected $siren;
|
||||
|
||||
/**
|
||||
* Internal Command ID
|
||||
* @var string
|
||||
*/
|
||||
protected $idCommande;
|
||||
|
||||
/**
|
||||
* KB = Kbis, PN = privilèges et nantissements, BI = Bilan complet, BS = bilan saisi,
|
||||
* ST = Dernier Statut à jour, AC = Acte, SD = Surveillance Demande et Accusé,
|
||||
* SR = Surveillance Révélation, SP = Surveillance Portefeuille, FA = Recherche PCL,
|
||||
* FI = Inventaire, FJ = Jugement, FO = Ordonnance, FD = Dépôt divers,
|
||||
* LE = Liste Etablissements
|
||||
* @var string
|
||||
*/
|
||||
protected $typeCommande;
|
||||
|
||||
/**
|
||||
* Mode de diffusion : C = Courrier, T = Téléchargement, M = Mail, XL = XML
|
||||
* @var string
|
||||
*/
|
||||
protected $vecteur;
|
||||
|
||||
/**
|
||||
* Elements de référence
|
||||
* @var array
|
||||
*/
|
||||
protected $option = array();
|
||||
|
||||
/**
|
||||
* Error number
|
||||
* @var int
|
||||
*/
|
||||
protected $errorNum;
|
||||
|
||||
/**
|
||||
* Error message
|
||||
* @var string
|
||||
*/
|
||||
protected $errorMsg;
|
||||
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
/**
|
||||
* Define path where PDF file are store
|
||||
*/
|
||||
$this->dataPath = SECURE_STORAGE;
|
||||
|
||||
/**
|
||||
* Define path where XML cache file are store
|
||||
*/
|
||||
$this->cachePath = '';
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Send XML Request
|
||||
* We have some problem to use SOAP so we use CURL
|
||||
* @return string XML Response
|
||||
*/
|
||||
protected function getProduitsXML()
|
||||
{
|
||||
$xmlStr = '';
|
||||
$env = 'PRD';
|
||||
|
||||
//Construct the request
|
||||
$xml = new SimpleXMLElement('<demande></demande>');
|
||||
$emetteur = $xml->addChild('emetteur');
|
||||
$emetteur->addChild('code_abonne', $this->config[$env]['USER']);
|
||||
$emetteur->addChild('mot_passe', $this->config[$env]['PASS']);
|
||||
|
||||
//Set Command ID
|
||||
$emetteur->addChild('reference_client', 'G'.$this->idCommande);
|
||||
$code_requete = $emetteur->addChild('code_requete');
|
||||
$code_requete->addChild('type_profil', 'A');
|
||||
$code_requete->addChild('origine_emetteur', 'IC');
|
||||
|
||||
// C = Commande de documents
|
||||
$code_requete->addChild('nature_requete', 'C');
|
||||
|
||||
$code_requete->addChild('type_document', $this->typeCommande);
|
||||
$code_requete->addChild('type_requete', 'S'); // S = Simple
|
||||
|
||||
$mode_diffusion = $code_requete->addChild('mode_diffusion');
|
||||
// Mode de diffusion : C = Courrier, T = Téléchargement, M = Mail, XL = XML
|
||||
if ($this->vecteur=='XL' && $this->option=='')
|
||||
{
|
||||
//On ajoute tout les types de diffusions pour $vecteur = XL
|
||||
$mode_diffusion->addChild('mode')->addAttribute('type', 'C');
|
||||
$mode_diffusion->addChild('mode')->addAttribute('type', 'T');
|
||||
}
|
||||
$mode_diffusion->addChild('mode')->addAttribute('type', $this->vecteur);
|
||||
|
||||
$code_requete->addChild('media', 'WS');
|
||||
|
||||
$commande = $xml->addChild('commande');
|
||||
$commande->addChild('num_siren', $this->siren);
|
||||
|
||||
// Commande de documents : bilan saisie ou bilan complet
|
||||
if ( ($this->typeCommande=='BS' || $this->typeCommande=='BI') && count($this->option)>0 )
|
||||
{
|
||||
$commande->addChild('greffe',$this->option['greffe']);
|
||||
$commande->addChild('dossier_millesime',$this->option['dossier_millesime']);
|
||||
$commande->addChild('dossier_statut',$this->option['dossier_statut']);
|
||||
$commande->addChild('dossier_chrono',$this->option['dossier_chrono']);
|
||||
$commande->addChild('num_depot',$this->option['num_depot']);
|
||||
$commande->addChild('date_cloture', $this->option['date_cloture']);
|
||||
}
|
||||
// Commande de documents : actes
|
||||
elseif ( $this->typeCommande=='AC' && count($this->option)>0 )
|
||||
{
|
||||
$commande->addChild('greffe',$this->option['greffe']);
|
||||
$commande->addChild('dossier_millesime',$this->option['dossier_millesime']);
|
||||
$commande->addChild('dossier_statut',$this->option['dossier_statut']);
|
||||
$commande->addChild('dossier_chrono',$this->option['dossier_chrono']);
|
||||
$commande->addChild('num_depot',$this->option['num_depot']);
|
||||
$liste_actes = $commande->addChild('liste_actes');
|
||||
$liste_actes->addChild('acte')->addAttribute('num', $this->option['num_acte']);
|
||||
}
|
||||
|
||||
$xmlStr = str_replace('<?xml version="1.0"?>', '', $xml->asXML());
|
||||
|
||||
//Be sure it's in UTF-8
|
||||
$req = utf8_encode($xmlStr);
|
||||
|
||||
//Create XML request
|
||||
$post = '<?xml version="1.0" encoding="UTF-8"?>'.
|
||||
'<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" '.
|
||||
'xmlns:ns1="https://webservices.infogreffe.fr/" '.
|
||||
'xmlns:xsd="http://www.w3.org/2001/XMLSchema" '.
|
||||
'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" '.
|
||||
'xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" '.
|
||||
'SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">'.
|
||||
'<SOAP-ENV:Body>'.
|
||||
'<ns1:getProduitsWebServicesXML>'.
|
||||
'<param0 xsi:type="xsd:string">'.$req.'</param0>'.
|
||||
'</ns1:getProduitsWebServicesXML>'.
|
||||
'</SOAP-ENV:Body>'.
|
||||
'</SOAP-ENV:Envelope>';
|
||||
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_URL, $this->config[$env]['URL']);
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
|
||||
curl_setopt($ch, CURLOPT_COOKIEFILE,TRUE);
|
||||
curl_setopt($ch, CURLOPT_POST, TRUE);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
|
||||
$response = curl_exec($ch);
|
||||
|
||||
//Remove SOAP part of XML
|
||||
$response = str_replace("<?xml version='1.0' encoding='UTF-8'?><SOAP-ENV:Envelope xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/' xmlns:SOAP-ENC='http://schemas.xmlsoap.org/soap/encoding/' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema'><SOAP-ENV:Body><ns0:getProduitsWebServicesXMLResponse xmlns:ns0='urn:local' SOAP-ENV:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'><return xsi:type='xsd:string'>", '', $response);
|
||||
$response = str_replace('</return></ns0:getProduitsWebServicesXMLResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>','', $response);
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
||||
protected function log(){}
|
||||
|
||||
/**
|
||||
* Detect error
|
||||
* @param string $xml
|
||||
* @throws Exception
|
||||
*/
|
||||
protected function error($xml)
|
||||
{
|
||||
if (!empty($xml))
|
||||
{
|
||||
$doc = new DOMDocument();
|
||||
$load = $doc->loadXML($xml, LIBXML_NOERROR | LIBXML_NOWARNING);
|
||||
if (!$load) {
|
||||
$tmp = explode('-', $xml);
|
||||
$errNum = intval($tmp[0]);
|
||||
$errMsg = $tmp[1];
|
||||
if( $errNum == '5' ){
|
||||
$errMsg = 'Service partenaire indisponible.';
|
||||
}
|
||||
throw new Exception($errNum . '-' . $errMsg);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Exception('Fichier vide');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true if the file modification time is in the period of caching
|
||||
* @param string $file
|
||||
* Path of file
|
||||
* @return boolean
|
||||
*/
|
||||
protected function cachetimeover($file)
|
||||
{
|
||||
$timeover = false;
|
||||
$dateFile = filemtime($file);
|
||||
$now = mktime(date('G'), date('i'), date('s'), date('m') , date('d'), date('Y'));
|
||||
$maxTime = mktime(date('G',$dateFile)+$this->cacheFiletime, date('i',$dateFile), date('s',$dateFile), date("m",$dateFile), date("d",$dateFile), date("Y",$dateFile));
|
||||
if($now>$maxTime) $timeover = true;
|
||||
return $timeover;
|
||||
}
|
||||
|
||||
protected function bilanFileName()
|
||||
{
|
||||
return 'bilan-'.$this->siren.'-';
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param unknown $url
|
||||
* @return boolean
|
||||
*/
|
||||
public function download($url)
|
||||
{
|
||||
$result = true;
|
||||
|
||||
|
||||
|
||||
$fp = fopen(SECURE_STORAGE . ''. $file, 'w');
|
||||
$ch = curl_init($url);
|
||||
curl_setopt($ch, CURLOPT_FILE, $fp);
|
||||
$data = curl_exec($ch);
|
||||
// Check if any error occured
|
||||
if(curl_errno($ch))
|
||||
{
|
||||
$result = false;
|
||||
}
|
||||
curl_close($ch);
|
||||
fclose($fp);
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function getStatut($siren, $typeCommande = '', $ref = '', $idCommande = 0)
|
||||
{
|
||||
$this->typeCommande = 'ST';
|
||||
$this->vecteur = 'C';
|
||||
|
||||
$reponse = $this->getProduitsXML();
|
||||
|
||||
//Gestion du retour infogreffe
|
||||
if($this->erreur($xmlReponse))
|
||||
{
|
||||
$error = $this->erreurMsg($xmlReponse);
|
||||
}
|
||||
//@todo result non définie
|
||||
return array('error' => $error , 'result' => $result );
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne la liste des bilans
|
||||
* @param string $siren
|
||||
* @return array
|
||||
*/
|
||||
public function getBilans($siren)
|
||||
{
|
||||
$this->siren = $siren;
|
||||
$this->vecteur = 'XL';
|
||||
$this->typeCommande = 'BI';
|
||||
|
||||
$cacheFile = APPLICATION_PATH . $this->cachePath.'/'.$this->typeCommande.'-'.$siren.'.xml';
|
||||
|
||||
//Get cache information
|
||||
if (file_exists($cacheFile) && $this->cachetimeover($cacheFile) )
|
||||
{
|
||||
$xml = file_get_contents($cacheFile);
|
||||
}
|
||||
//Make the request
|
||||
else
|
||||
{
|
||||
$xml = $this->getProduitsXML();
|
||||
$this->error($xml);
|
||||
|
||||
//Create file for the cache
|
||||
file_put_contents($cacheFile, $xml);
|
||||
}
|
||||
|
||||
//Parse XML to make tab
|
||||
$doc = new DOMDocument();
|
||||
$doc->loadXML($xml);
|
||||
$liste_bilan_complet = $doc->getElementsByTagName('liste_bilan_complet')->item(0);
|
||||
$bilan_complet = $liste_bilan_complet->getElementsByTagName('bilan_complet');
|
||||
|
||||
$bilans = array();
|
||||
if (count($bilan_complet)>0)
|
||||
{
|
||||
foreach($bilan_complet as $element)
|
||||
{
|
||||
$bilan = array();
|
||||
$num_gest = $element->getElementsByTagName('num_gest')->item(0);
|
||||
$bilan['greffe'] = $num_gest->getElementsByTagName('greffe')->item(0)->nodeValue;
|
||||
$bilan['dossier_millesime'] = $num_gest->getElementsByTagName('dossier_millesime')->item(0)->nodeValue;
|
||||
$bilan['dossier_statut'] = $num_gest->getElementsByTagName('dossier_statut')->item(0)->nodeValue;
|
||||
$bilan['dossier_chrono'] = $num_gest->getElementsByTagName('dossier_chrono')->item(0)->nodeValue;
|
||||
$bilan['num_siren'] = $element->getElementsByTagName('num_siren')->item(0)->nodeValue;
|
||||
$bilan['date_cloture'] = $element->getElementsByTagName('date_cloture')->item(0)->nodeValue;
|
||||
$bilan['date_cloture_iso'] = $element->getElementsByTagName('date_cloture_iso')->item(0)->nodeValue;
|
||||
$bilan['millesime'] = $element->getElementsByTagName('millesime')->item(0)->nodeValue;
|
||||
$bilan['num_depot'] = $element->getElementsByTagName('num_depot')->item(0)->nodeValue;
|
||||
$bilan['type_comptes'] = $element->getElementsByTagName('type_comptes')->item(0)->nodeValue;
|
||||
$mode_diffusion = $element->getElementsByTagName('mode_diffusion')->item(0)->getElementsByTagName('mode');
|
||||
foreach($mode_diffusion as $mode)
|
||||
{
|
||||
$bilan['mode_diffusion'][] = $mode->getAttribute('type');
|
||||
}
|
||||
|
||||
//Génération de l'index pour le tri
|
||||
$date = $bilan['date_cloture_iso'];
|
||||
if(!empty($date))
|
||||
{
|
||||
$datef = substr($date,0,4).substr($date,5,2).substr($date,8,2);
|
||||
//Affectation liste générale avec un index permettant le tri
|
||||
$bilans[$datef] = $bilan;
|
||||
}
|
||||
}
|
||||
}
|
||||
krsort($bilans);
|
||||
|
||||
return $bilans;
|
||||
}
|
||||
|
||||
/**
|
||||
* Commande d'un bilan image
|
||||
* @param string $siren
|
||||
* Siren
|
||||
* @param string $diffusion
|
||||
* Mode de diffusion (C|T)
|
||||
* @param array $option
|
||||
* Référence
|
||||
* @return string
|
||||
*/
|
||||
public function getBilan($siren, $diffusion, $option)
|
||||
{
|
||||
$this->siren = $siren;
|
||||
$this->typeCommande = 'BI';
|
||||
$this->vecteur = $diffusion;
|
||||
$this->option = $option;
|
||||
$xml = $this->getProduitsXML();
|
||||
|
||||
$doc = new DOMDocument();
|
||||
$doc->loadXML($xml);
|
||||
$bilan_complet = $doc->getElementsByTagName('bilan_complet')->item(0);
|
||||
$bilan = array();
|
||||
$bilan['num_gest'] = array();
|
||||
$num_gest = $bilan_complet->getElementsByTagName('num_gest')->item(0);
|
||||
$bilan['num_gest']['greffe'] = $num_gest->getElementsByTagName('greffe')->item(0)->nodeValue;
|
||||
$bilan['num_gest']['dossier_millesime'] = $num_gest->getElementsByTagName('dossier_millesime')->item(0)->nodeValue;
|
||||
$bilan['num_gest']['dossier_statut'] = $num_gest->getElementsByTagName('dossier_statut')->item(0)->nodeValue;
|
||||
$bilan['num_gest']['dossier_chrono'] = $num_gest->getElementsByTagName('dossier_chrono')->item(0)->nodeValue;
|
||||
$bilan['num_siren'] = $bilan_complet->getElementsByTagName('num_siren')->item(0)->nodeValue;
|
||||
$bilan['date_cloture'] = $bilan_complet->getElementsByTagName('date_cloture')->item(0)->nodeValue;
|
||||
$bilan['date_cloture_iso'] = $bilan_complet->getElementsByTagName('date_cloture_iso')->item(0)->nodeValue;
|
||||
$bilan['millesime'] = $bilan_complet->getElementsByTagName('millesime')->item(0)->nodeValue;
|
||||
$bilan['num_depot'] = $bilan_complet->getElementsByTagName('num_depot')->item(0)->nodeValue;
|
||||
$bilan['type_comptes'] = $bilan_complet->getElementsByTagName('type_comptes')->item(0)->nodeValue;
|
||||
$bilan['url_acces'] = $bilan_complet->getElementsByTagName('url_acces')->item(0)->nodeValue;
|
||||
|
||||
return $bilan['url_acces'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne la liste des actes
|
||||
* @param string $siren
|
||||
* @return array
|
||||
*/
|
||||
public function getActes($siren)
|
||||
{
|
||||
$this->siren = $siren;
|
||||
$this->vecteur = 'XL';
|
||||
$this->typeCommande = 'AC';
|
||||
|
||||
$cacheFile = APPLICATION_PATH . $this->cachePath.'/'.$this->typeCommande.'-'.$siren.'.xml';
|
||||
|
||||
//Get cache information
|
||||
if (file_exists($cacheFile) && $this->cachetimeover($cacheFile) )
|
||||
{
|
||||
$xml = file_get_contents($cacheFile);
|
||||
}
|
||||
//Make the request
|
||||
else
|
||||
{
|
||||
$xml = $this->getProduitsXML();
|
||||
$this->error($xml);
|
||||
|
||||
//Create file for the cache
|
||||
file_put_contents($cacheFile, $xml);
|
||||
}
|
||||
|
||||
//Parse XML to make tab
|
||||
$doc = new DOMDocument();
|
||||
$doc->loadXML($xml);
|
||||
$liste_depot_acte = $doc->getElementsByTagName('liste_depot_acte')->item(0);
|
||||
$depot_actes = $liste_depot_acte->getElementsByTagName('depot_acte');
|
||||
$actes = array();
|
||||
foreach($depot_actes as $depot_acte)
|
||||
{
|
||||
$acte = array();
|
||||
|
||||
$acte['num_gest'] = array();
|
||||
$num_gest = $depot_acte->getElementsByTagName('num_gest')->item(0);
|
||||
$acte['num_gest']['greffe'] = $num_gest->getElementsByTagName('greffe')->item(0)->nodeValue;
|
||||
$acte['num_gest']['dossier_millesime'] = $num_gest->getElementsByTagName('dossier_millesime')->item(0)->nodeValue;
|
||||
$acte['num_gest']['dossier_statut'] = $num_gest->getElementsByTagName('dossier_statut')->item(0)->nodeValue;
|
||||
$acte['num_gest']['dossier_chrono'] = $num_gest->getElementsByTagName('dossier_chrono')->item(0)->nodeValue;
|
||||
|
||||
$acte['num_siren'] = $depot_acte->getElementsByTagName('num_siren')->item(0)->nodeValue;
|
||||
$acte['num_depot'] = $depot_acte->getElementsByTagName('num_depot')->item(0)->nodeValue;
|
||||
$acte['date_depot'] = $depot_acte->getElementsByTagName('date_depot')->item(0)->nodeValue;
|
||||
|
||||
$infoActes = $depot_acte->getElementsByTagName('acte');
|
||||
$acte['depot'] = array();
|
||||
foreach($infoActes as $infoActe)
|
||||
{
|
||||
$actenum = array();
|
||||
$actenum['date_acte'] = $infoActe->getElementsByTagName('date_acte')->item(0)->nodeValue;
|
||||
$actenum['num_acte'] = $infoActe->getElementsByTagName('num_acte')->item(0)->nodeValue;
|
||||
$actenum['type_acte'] = $infoActe->getElementsByTagName('type_acte')->item(0)->nodeValue;
|
||||
$actenum['type_acte_libelle'] = $infoActe->getElementsByTagName('type_acte_libelle')->item(0)->nodeValue;
|
||||
$actenum['nbpages_acte'] = $infoActe->getElementsByTagName('nbpages_acte')->item(0)->nodeValue;
|
||||
$decision = $infoActe->getElementsByTagName('decision')->item(0);
|
||||
if($decision)
|
||||
{
|
||||
$actenum['decision'] = array();
|
||||
$actenum['decision']['nature'] = $decision->getElementsByTagName('nature')->item(0)->nodeValue;
|
||||
$actenum['decision']['libelle'] = $decision->getElementsByTagName('libelle')->item(0)->nodeValue;
|
||||
}
|
||||
|
||||
$actenum['mode_diffusion'] = array();
|
||||
$mode_diffusion = $infoActe->getElementsByTagName('mode_diffusion')->item(0)->getElementsByTagName('mode');
|
||||
foreach($mode_diffusion as $mode)
|
||||
{
|
||||
$actenum['mode_diffusion'][] = $mode->getAttribute('type');
|
||||
}
|
||||
$acte['depot'][] = $actenum;
|
||||
}//Fin listes des infos acte
|
||||
|
||||
//Génération de l'index pour le tri
|
||||
if(!empty($acte['date_depot'])){
|
||||
$date = $acte['date_depot'];
|
||||
} else {
|
||||
$date = '';
|
||||
}
|
||||
|
||||
if(!empty($date))
|
||||
{
|
||||
$datef = substr($date,0,4).substr($date,5,2).substr($date,8,2);
|
||||
$key = $datef.'-'.$acte['num_depot'];
|
||||
//Affectation liste générale avec un index permettant le tri
|
||||
$actes[$key] = $acte;
|
||||
}
|
||||
//Prise en compte de l'acte -1
|
||||
if($acte['num_depot']==-1)
|
||||
{
|
||||
$actes[0] = $acte;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//Tri suivant la date d'acte ou de depot
|
||||
krsort($actes);
|
||||
return $actes;
|
||||
|
||||
}
|
||||
|
||||
public function getActe($siren, $diffusion, $option)
|
||||
{
|
||||
//Retourner la référence de commande interne, chez infogreffe
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$doc = new DOMDocument();
|
||||
$doc->loadXML($xml);
|
||||
|
||||
$depot_acte = $doc->getElementsByTagName('depot_acte')->item(0);
|
||||
|
||||
$info = array();
|
||||
$info['num_gest'] = array();
|
||||
|
||||
$num_gest = $depot_acte->getElementsByTagName('num_gest')->item(0);
|
||||
|
||||
$info['num_gest']['greffe'] = $num_gest->getElementsByTagName('greffe')->item(0)->nodeValue;
|
||||
$info['num_gest']['dossier_millesime'] = $num_gest->getElementsByTagName('dossier_millesime')->item(0)->nodeValue;
|
||||
$info['num_gest']['dossier_statut'] = $num_gest->getElementsByTagName('dossier_statut')->item(0)->nodeValue;
|
||||
$info['num_gest']['dossier_chrono'] = $num_gest->getElementsByTagName('dossier_chrono')->item(0)->nodeValue;
|
||||
|
||||
$info['num_siren'] = $depot_acte->getElementsByTagName('num_siren')->item(0)->nodeValue;
|
||||
$info['num_depot'] = $depot_acte->getElementsByTagName('num_depot')->item(0)->nodeValue;
|
||||
$info['date_depot'] = $depot_acte->getElementsByTagName('date_depot')->item(0)->nodeValue;
|
||||
|
||||
$infoActes = $depot_acte->getElementsByTagName('acte');
|
||||
$info['actes'] = array();
|
||||
foreach($infoActes as $infoActe)
|
||||
{
|
||||
$actenum = array();
|
||||
$actenum['date_acte'] = $infoActe->getElementsByTagName('date_acte')->item(0)->nodeValue;
|
||||
$actenum['num_acte'] = $infoActe->getElementsByTagName('num_acte')->item(0)->nodeValue;
|
||||
$actenum['type_acte'] = $infoActe->getElementsByTagName('type_acte')->item(0)->nodeValue;
|
||||
$actenum['type_acte_libelle'] = $infoActe->getElementsByTagName('type_acte_libelle')->item(0)->nodeValue;
|
||||
$actenum['nbpages_acte'] = $infoActe->getElementsByTagName('nbpages_acte')->item(0)->nodeValue;
|
||||
|
||||
$decision = $infoActe->getElementsByTagName('decision')->item(0);
|
||||
if($decision)
|
||||
{
|
||||
$actenum['decision'] = array();
|
||||
$actenum['decision']['nature'] = $decision->getElementsByTagName('nature')->item(0)->nodeValue;
|
||||
$actenum['decision']['libelle'] = $decision->getElementsByTagName('libelle')->item(0)->nodeValue;
|
||||
}
|
||||
$actenum['url_acces'] = htmlspecialchars_decode($infoActe->getElementsByTagName('url_acces')->item(0)->nodeValue);
|
||||
$info['actes'][] = $actenum;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -1,80 +0,0 @@
|
||||
|
||||
<definitions
|
||||
targetNamespace="java:com.experian.webserv.infogreffe"
|
||||
xmlns="http://schemas.xmlsoap.org/wsdl/"
|
||||
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:tns="java:com.experian.webserv.infogreffe"
|
||||
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
>
|
||||
<types>
|
||||
<schema targetNamespace='java:com.experian.webserv.infogreffe'
|
||||
xmlns='http://www.w3.org/2001/XMLSchema'>
|
||||
</schema>
|
||||
</types>
|
||||
<message name="getProduitsWebServicesXMLRequest">
|
||||
<part name="arg0" type="xsd:string" />
|
||||
</message>
|
||||
<message name="getProduitsWebServicesXMLResponse">
|
||||
<part name="return" type="xsd:string" />
|
||||
</message>
|
||||
<message name="getProduitsWebServicesRequest">
|
||||
<part name="arg0" type="xsd:string" />
|
||||
<part name="arg1" type="xsd:string" />
|
||||
<part name="arg2" type="xsd:string" />
|
||||
<part name="arg3" type="xsd:string" />
|
||||
<part name="arg4" type="xsd:string" />
|
||||
<part name="arg5" type="xsd:string" />
|
||||
<part name="arg6" type="xsd:string" />
|
||||
<part name="arg7" type="xsd:string" />
|
||||
<part name="arg8" type="xsd:string" />
|
||||
<part name="arg9" type="xsd:string" />
|
||||
<part name="arg10" type="xsd:string" />
|
||||
</message>
|
||||
<message name="getProduitsWebServicesResponse">
|
||||
<part name="return" type="xsd:string" />
|
||||
</message>
|
||||
<message name="getVersionRequest">
|
||||
</message>
|
||||
<message name="getVersionResponse">
|
||||
<part name="return" type="xsd:string" />
|
||||
</message>
|
||||
<portType name="WebServicesProduitsPortType">
|
||||
<operation name="getProduitsWebServicesXML">
|
||||
<input message="tns:getProduitsWebServicesXMLRequest"/>
|
||||
<output message="tns:getProduitsWebServicesXMLResponse"/>
|
||||
</operation>
|
||||
<operation name="getProduitsWebServices">
|
||||
<input message="tns:getProduitsWebServicesRequest"/>
|
||||
<output message="tns:getProduitsWebServicesResponse"/>
|
||||
</operation>
|
||||
<operation name="getVersion">
|
||||
<input message="tns:getVersionRequest"/>
|
||||
<output message="tns:getVersionResponse"/>
|
||||
</operation>
|
||||
</portType>
|
||||
<binding name="WebServicesProduitsBinding" type="tns:WebServicesProduitsPortType">
|
||||
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
|
||||
<operation name="getProduitsWebServicesXML">
|
||||
<soap:operation soapAction="urn:getProduitsWebServicesXML"/>
|
||||
<input><soap:body use="encoded" namespace='urn:WebServicesProduits' encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></input>
|
||||
<output><soap:body use="encoded" namespace='urn:WebServicesProduits' encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></output>
|
||||
</operation>
|
||||
<operation name="getProduitsWebServices">
|
||||
<soap:operation soapAction="urn:getProduitsWebServices"/>
|
||||
<input><soap:body use="encoded" namespace='urn:WebServicesProduits' encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></input>
|
||||
<output><soap:body use="encoded" namespace='urn:WebServicesProduits' encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></output>
|
||||
</operation>
|
||||
<operation name="getVersion">
|
||||
<soap:operation soapAction="urn:getVersion"/>
|
||||
<input><soap:body use="encoded" namespace='urn:Version' encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></input>
|
||||
<output><soap:body use="encoded" namespace='urn:Version' encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></output>
|
||||
</operation>
|
||||
</binding>
|
||||
<service name="WebServicesProduits">
|
||||
<documentation>Service Soap Experian, Service Produit</documentation>
|
||||
<port name="WebServicesProduitsPort" binding="tns:WebServicesProduitsBinding">
|
||||
<soap:address location="https://webservices.infogreffe.fr:443/WSContextInfogreffe/INFOGREFFE"/>
|
||||
</port>
|
||||
</service>
|
||||
</definitions>
|
@ -1,85 +0,0 @@
|
||||
<?
|
||||
class MBalo {
|
||||
|
||||
function getLibEven($strEven) {
|
||||
$even=9015;
|
||||
$strEven=trim($strEven);
|
||||
if (preg_match("/AUTRES OP.RATIONS . Décisions prises par des assemblées d'obligataires et homologation de résolutions/i", $strEven)) $even=9001;
|
||||
elseif (preg_match("/AUTRES OP.RATIONS . Désignation de teneurs? de comptes de titres nominatifs/i", $strEven)) $even=9002;
|
||||
elseif (preg_match("/AUTRES OP.RATIONS . Fusions et scissions/i", $strEven)) $even=9003;
|
||||
elseif (preg_match("/AUTRES OP.RATIONS . Liquidations/i", $strEven)) $even=9004;
|
||||
elseif (preg_match("/AUTRES OP.RATIONS . Offre de remboursement d'obligations/i", $strEven)) $even=9005;
|
||||
elseif (preg_match("/AUTRES OP.RATIONS . Réduction de capital/i", $strEven)) $even=9006;
|
||||
elseif (preg_match("/AUTRES OP.RATIONS . Regroupement d'actions/i", $strEven)) $even=9007;
|
||||
elseif (preg_match("/AUTRES OP.RATIONS/i", $strEven)) $even=9000;
|
||||
elseif (preg_match("/BULLETIN OFFICIEL de l'AMF/i", $strEven)) $even=9010;
|
||||
elseif (preg_match("/BULLETIN OFFICIEL du CMF/i", $strEven)) $even=9011;
|
||||
elseif (preg_match("/CONVOCATIONS . Assemblées? d'actionnaires et de porteurs de parts/i", $strEven)) $even=9020;
|
||||
elseif (preg_match("/CONVOCATIONS . Assemblées? d'obligataires ou de porteurs de titres d'emprunt/i", $strEven)) $even=9021;
|
||||
elseif (preg_match("/CONVOCATIONS . Assemblées? de porteurs de certificats d'investissement/i", $strEven)) $even=9022;
|
||||
elseif (preg_match("/CONVOCATIONS . Assemblées? de porteurs de parts de fondateur/i", $strEven)) $even=9023;
|
||||
elseif (preg_match("/CONVOCATIONS . Assemblées? de porteurs de titres participatifs/i", $strEven)) $even=9024;
|
||||
elseif (preg_match("/MISSIONS ET COTATIONS - Organismes internationaux - Bons, obligations et autres titres/i", $strEven)) $even=9030;
|
||||
elseif (preg_match("/MISSIONS ET COTATIONS . Valeurs étrangères . Actions et parts/i", $strEven)) $even=9031;
|
||||
elseif (preg_match("/MISSIONS ET COTATIONS . Valeurs étrangères . Bons d'options? sur titres et sur indices/i", $strEven)) $even=9032;
|
||||
elseif (preg_match("/MISSIONS ET COTATIONS . Valeurs étrangères . Bons, obligations et autres titres/i", $strEven)) $even=9033;
|
||||
elseif (preg_match("/MISSIONS ET COTATIONS . Valeurs européennes . Actions et parts/i", $strEven)) $even=9034;
|
||||
elseif (preg_match("/MISSIONS ET COTATIONS . Valeurs françaises . Actions et parts/i", $strEven)) $even=9035;
|
||||
elseif (preg_match("/MISSIONS ET COTATIONS . Valeurs françaises . Bons d'options? sur titres et sur indices/i", $strEven)) $even=9036;
|
||||
elseif (preg_match("/MISSIONS ET COTATIONS . Valeurs françaises . Bons, obligations et autres titres/i", $strEven)) $even=9037;
|
||||
elseif (preg_match("/MISSIONS ET COTATIONS . Valeurs françaises . Certificats d'investissement/i", $strEven)) $even=9038;
|
||||
elseif (preg_match("/PUBLICATIONS P.RIODIQUES . Entreprises d'assurances et organismes de retraites/i", $strEven)) $even=9040;
|
||||
elseif (preg_match("/PUBLICATIONS P.RIODIQUES . Sociétés commerciales et industrielles/i", $strEven)) $even=9041;
|
||||
elseif (preg_match("/PUBLICATIONS P.RIODIQUES . Sociétés commerciales et industrielles (Chiffres d'affaires)/i", $strEven)) $even=9042;
|
||||
elseif (preg_match("/PUBLICATIONS P.RIODIQUES . Sociétés commerciales et industrielles (comptes annuels)/i", $strEven)) $even=9045;
|
||||
elseif (preg_match("/PUBLICATIONS P.RIODIQUES . Sociétés commerciales et industrielles (Tableaux d'activités et résultats)/i", $strEven)) $even=9044;
|
||||
elseif (preg_match("/PUBLICATIONS P.RIODIQUES . Sociétés commerciales et industrielles (Chiffres d'affaires et situations trimestrielles)/i", $strEven))$even=9043;
|
||||
elseif (preg_match("/PUBLICATIONS P.RIODIQUES . Sociétés commerciales et industrielles (Comptes intermédiaires)/i", $strEven)) $even=9046;
|
||||
//else/*if (preg_match("/AVIS DIVERS/i", $strEven))*/ $even=9015;
|
||||
|
||||
return $even;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class MBoamp {
|
||||
|
||||
function getCodEvenSd($codEvenBoamp, $strEvenBoamp='') {
|
||||
$codEvenBoamp=str_replace('R','',$codEvenBoamp)*1;
|
||||
switch ($codEvenBoamp) {
|
||||
case 10: $libEvenSd='Annulation'; break;
|
||||
case 11: $libEvenSd='Annulation - Rectificatif'; break;
|
||||
case 20: $libEvenSd='Rectificatif'; break;
|
||||
case 22: $libEvenSd='Procédures accélérées'; break;
|
||||
case 30: $libEvenSd='Avis d\'appel public à la concurrence - Délai d\'urgence'; break;
|
||||
case 33: $libEvenSd='Avis de mise en concurrence'; break;
|
||||
case 44: $libEvenSd='Concessions'; break;
|
||||
case 50: $libEvenSd='Avis d\'appel public à la concurrence'; break;
|
||||
case 51: $libEvenSd='Avis informatifs'; break;
|
||||
case 55: $libEvenSd='Avis d\'appel public à la concurrence'; break;
|
||||
case 6 : $libEvenSd='Avis d\'attribution'; break;
|
||||
case 8 : $libEvenSd='Avis d\'attribution'; break;
|
||||
case 81: $libEvenSd='Avis d\'attribution - Annulation'; break;
|
||||
case 82: $libEvenSd='Avis d\'attribution - Rectificatif'; break;
|
||||
case 83: $libEvenSd='Avis d\'attribution - Rectificatif'; break;
|
||||
case 84: $libEvenSd='Avis d\'attribution comportant des lots infructueux'; break;
|
||||
case 9 : $libEvenSd='Résultat de marché'; break;
|
||||
case 91: $libEvenSd='Résultat de marché - Annulation'; break;
|
||||
case 92: $libEvenSd='Résultat de marché - Rectificatif'; break;
|
||||
case 93: $libEvenSd='Résultat de marché Infructueux/Sans suite'; break;
|
||||
case 94: $libEvenSd='Résultat de marché comportant des lots infructueux'; break;
|
||||
case 96: $libEvenSd='Annulation/Rectificatif/Sans suite/Infructueux'; break;
|
||||
default: $libEvenSd=$strEvenBoamp; break;
|
||||
}
|
||||
if ($strEvenBoamp<>'') return $libEvenSd;
|
||||
|
||||
return substr('95'.$codEvenBoamp.'00',0,4)*1;
|
||||
}
|
||||
|
||||
function getLibEvenBoamp($codEvenBoamp, $strEvenBoamp='') {
|
||||
return $this->getCodEvenSd($codEvenBoamp, $strEvenBoamp);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,302 +0,0 @@
|
||||
<?php
|
||||
|
||||
class ICotation {
|
||||
|
||||
var $reTrtAuto;
|
||||
var $tabBilan;
|
||||
|
||||
var $tabNotation;
|
||||
var $tabLibActivite;
|
||||
var $tabActivite;
|
||||
var $tabR;
|
||||
|
||||
|
||||
function ICotation ($tabBilan, $retraitementAutomatique=true) {
|
||||
$this->reTrtAuto = $retraitementAutomatique;
|
||||
$this->tabBilan = $tabBilan;
|
||||
|
||||
include ('paramCotation.inc');
|
||||
}
|
||||
|
||||
function calculProvisionsPourRisque () {
|
||||
if ( !$this->reTrtAuto )
|
||||
return $this->tabBilan['DP'] + $this->tabBilan['DQ'] - $this->tabBilan['X04'];
|
||||
else
|
||||
return (1/2*$this->tabBilan['DP'])+(1/2*$this->tabBilan['DQ']);
|
||||
}
|
||||
|
||||
function calculEBE () {
|
||||
return $this->tabBilan['FC'] + $this->tabBilan['FF'] + $this->tabBilan['FI'] + $this->tabBilan['FOB']
|
||||
+ $this->tabBilan['FM'] + $this->tabBilan['FN'] - $this->tabBilan['FC'] + $this->tabBilan['FC']
|
||||
- ( $this->tabBilan['FS'] + $this->tabBilan['FT'] + $this->tabBilan['FU'] + $this->tabBilan['FV'] )
|
||||
- ( $this->tabBilan['FW'] - $this->tabBilan['HP'] - $this->tabBilan['HQ'] - $this->tabBilan['HP2'] - $this->tabBilan['HQ2'] )
|
||||
- $this->tabBilan['FX'] - ( $this->tabBilan['FY'] + $this->tabBilan['FZ'] ) + ( $this->tabBilan['FO'] - $this->tabBilan['FOB'] ) ;
|
||||
}
|
||||
|
||||
function calculChiffreAffaires () {
|
||||
return $this->tabBilan['FC']
|
||||
+ $this->tabBilan['FF']
|
||||
+ $this->tabBilan['FI']
|
||||
+ $this->tabBilan['FO']
|
||||
- $this->tabBilan['FOB'] ;
|
||||
}
|
||||
|
||||
function calculMargeCommerciale () {
|
||||
return $this->tabBilan['FC'] - ( $this->tabBilan['FS'] + $this->tabBilan['FT'] ) ;
|
||||
}
|
||||
|
||||
function calculProduction () {
|
||||
return $this->tabBilan['FF'] + $this->tabBilan['FI'] + $this->tabBilan['FM'] + $this->tabBilan['FN'] ;
|
||||
}
|
||||
|
||||
function calculValeurAjoutee () {
|
||||
return $this->calculMargeCommerciale() + $this->calculProduction()
|
||||
- ( $this->tabBilan['FU'] + $this->tabBilan['FV'] + $this->tabBilan['FW'] ) ;
|
||||
}
|
||||
|
||||
function calculEBEnonCASA () {
|
||||
return $this->calculValeurAjoutee() + $this->tabBilan['FO'] - $this->tabBilan['FX'] - ( $this->tabBilan['FY'] + $this->tabBilan['FZ'] ) ;
|
||||
}
|
||||
|
||||
function calculFondsPropresNetsCorriges() {
|
||||
return $this->tabBilan['DA'] + $this->tabBilan['DC'] + $this->tabBilan['DB'] + $this->tabBilan['DD'] + $this->tabBilan['DE'] + $this->tabBilan['DF'] + $this->tabBilan['DG'] + $this->tabBilan['DK'] - (1/3*$this->tabBilan['X01'])
|
||||
+ $this->tabBilan['DH'] + $this->tabBilan['DI'] + $this->tabBilan['DJ']
|
||||
- $this->tabBilan['CL'] - $this->tabBilan['AB'] + $this->tabBilan['AC'] - $this->tabBilan['AA'] - $this->tabBilan['CB'] + $this->tabBilan['CC'] - $this->tabBilan['X02'] - $this->tabBilan['CM'] - $this->tabBilan['CN']
|
||||
+ $this->tabBilan['DM'] + $this->tabBilan['DN']
|
||||
- $this->tabBilan['X03'] + $this->calculProvisionsPourRisque() - $this->tabBilan['RAD'] ;
|
||||
}
|
||||
|
||||
function calculDettesFinancieresBancairesBrutes () {
|
||||
return $this->tabBilan['DS'] - $this->tabBilan['CM1'] + $this->tabBilan['EI'] - $this->tabBilan['CM2']
|
||||
+ $this->tabBilan['DT'] - $this->tabBilan['CM3'] + $this->tabBilan['DU'] - $this->tabBilan['EH']
|
||||
+ (3/4*$this->tabBilan['YQ']) + (2/3*$this->tabBilan['YR'])
|
||||
+ (3/4*$this->tabBilan['YQ2']) + (2/3*$this->tabBilan['YR2'])
|
||||
+ $this->tabBilan['DV'] - $this->tabBilan['EI'] - $this->tabBilan['DVI1'] - $this->tabBilan['CM2']
|
||||
+ $this->tabBilan['YS'] + $this->tabBilan['X08']
|
||||
+ $this->tabBilan['EH'] + $this->tabBilan['VI1'] - ( $this->tabBilan['X20'] + $this->tabBilan['X21'] ) ;
|
||||
}
|
||||
|
||||
|
||||
|
||||
function noteCapitalisation () {
|
||||
if ( !$this->reTrtAuto ) {
|
||||
$autresDettesExploit = $this->tabBilan['EA'] - $this->tabBilan['EAVI1'] - $this->tabBilan['EAB'] + $this->tabBilan['EB'] + $this->tabBilan['X01'] + $this->tabBilan['X04'] ;
|
||||
$dettesFiscalesSociales = $this->tabBilan['DY'] - $this->tabBilan['DYA'];
|
||||
} else {
|
||||
$autresDettesExploit = $this->tabBilan['EA'] - $this->tabBilan['EAVI1'] - $this->tabBilan['EAB'] + $this->tabBilan['EB'] + $this->tabBilan['X01'] + 2/3*((1/2*$this->tabBilan['DP'])+(1/2*$this->tabBilan['DQ']));
|
||||
$dettesFiscalesSociales = $this->tabBilan['DY'] + 1/3*((1/2*$this->tabBilan['DP'])+(1/2*$this->tabBilan['DQ'])) - $this->tabBilan['DYA'] ;
|
||||
}
|
||||
|
||||
$numerateur = $this->calculFondsPropresNetsCorriges();
|
||||
|
||||
$denominateur = $numerateur + $this->tabBilan['DS'] - $this->tabBilan['CM1'] + $this->tabBilan['EI'] - $this->tabBilan['CM2'] + $this->tabBilan['DU'] - $this->tabBilan['EH']
|
||||
+ $this->tabBilan['DV'] - $this->tabBilan['DVI1'] - $this->tabBilan['EI'] + $this->tabBilan['DT'] - $this->tabBilan['CM3'] + 3/4*$this->tabBilan['YQ'] + 2/3*$this->tabBilan['YR']
|
||||
+ 3/4*$this->tabBilan['YQ2'] + 2/3*$this->tabBilan['YR2']
|
||||
+ $this->tabBilan['DW'] + $this->tabBilan['DX'] + $dettesFiscalesSociales
|
||||
+ $autresDettesExploit + $this->tabBilan['DZ'] + $this->tabBilan['DIA'] + $this->tabBilan['ED'] + $this->tabBilan['EAB'] + $this->tabBilan['DYA']
|
||||
+ $this->tabBilan['EH'] + $this->tabBilan['YS'] + $this->tabBilan['VI1'];
|
||||
// + $this->tabBilan['X08']
|
||||
// - $this->tabBilan['X20'] + $this->tabBilan['YS'] - $this->tabBilan['X08'];
|
||||
|
||||
if ($denominateur==0)
|
||||
return array('NUMERATEUR'=>$numerateur*100,'DENOMINATEUR'=>$denominateur,'NOTE'=>0);
|
||||
|
||||
return array('NUMERATEUR'=>$numerateur* 100,'DENOMINATEUR'=>$denominateur,'NOTE'=>($numerateur* 100)/$denominateur);
|
||||
}
|
||||
|
||||
function noteLevierEndettement () {
|
||||
|
||||
$numerateur = $this->calculDettesFinancieresBancairesBrutes();
|
||||
|
||||
$denominateur = $this->calculFondsPropresNetsCorriges();
|
||||
|
||||
if ($denominateur==0)
|
||||
return array('NUMERATEUR'=>$numerateur,'DENOMINATEUR'=>$denominateur,'NOTE'=>0);
|
||||
|
||||
return array('NUMERATEUR'=>$numerateur,'DENOMINATEUR'=>$denominateur,'NOTE'=>$numerateur/$denominateur);
|
||||
}
|
||||
|
||||
function noteCapaciteRemboursement () {
|
||||
|
||||
$numerateur = $this->calculDettesFinancieresBancairesBrutes();
|
||||
|
||||
$denominateur = $this->calculEBE();
|
||||
|
||||
if ($denominateur==0)
|
||||
return array('NUMERATEUR'=>$numerateur,'DENOMINATEUR'=>$denominateur,'NOTE'=>0);
|
||||
|
||||
return array('NUMERATEUR'=>$numerateur,'DENOMINATEUR'=>$denominateur,'NOTE'=>$numerateur/$denominateur);
|
||||
}
|
||||
|
||||
function noteCouvChargesFi () {
|
||||
|
||||
$numerateur = $this->calculEBE();
|
||||
|
||||
$denominateur = $this->tabBilan['GR'] + ( 1/4*$this->tabBilan['HP'] + 1/3*$this->tabBilan['HQ'] )
|
||||
+ ( 1/4*$this->tabBilan['HP2'] + 1/3*$this->tabBilan['HQ2'] )
|
||||
+ $this->tabBilan['GS']
|
||||
+ $this->tabBilan['GT']
|
||||
- $this->tabBilan['GJ']
|
||||
- $this->tabBilan['GK']
|
||||
- $this->tabBilan['GL']
|
||||
- $this->tabBilan['GN']
|
||||
- $this->tabBilan['GO']
|
||||
- $this->tabBilan['GH']
|
||||
+ $this->tabBilan['GI'] ;
|
||||
|
||||
if ($denominateur==0)
|
||||
return array('NUMERATEUR'=>$numerateur,'DENOMINATEUR'=>$denominateur,'NOTE'=>0);
|
||||
|
||||
return array('NUMERATEUR'=>$numerateur,'DENOMINATEUR'=>$denominateur,'NOTE'=>$numerateur/$denominateur);
|
||||
}
|
||||
|
||||
function noteTresorerie () {
|
||||
|
||||
$numerateur = $this->tabBilan['CD'] - $this->tabBilan['CE'] + $this->tabBilan['CF'] - $this->tabBilan['CG']
|
||||
- $this->tabBilan['EH'] - ( $this->tabBilan['YS'] + $this->tabBilan['X08'] ) ;
|
||||
|
||||
$denominateur = $this->calculChiffreAffaires();
|
||||
if ($denominateur==0)
|
||||
return array('NUMERATEUR'=>$numerateur*360,'DENOMINATEUR'=>$denominateur,'NOTE'=>0);
|
||||
|
||||
return array('NUMERATEUR'=>$numerateur*360,'DENOMINATEUR'=>$denominateur,'NOTE'=>$numerateur*360/$denominateur);
|
||||
|
||||
}
|
||||
|
||||
function noteMargeExploitation () {
|
||||
|
||||
$numerateur = $this->calculEBE();
|
||||
|
||||
$denominateur = $this->calculChiffreAffaires();
|
||||
|
||||
if ($denominateur==0)
|
||||
return array('NUMERATEUR'=>$numerateur*100,'DENOMINATEUR'=>$denominateur,'NOTE'=>0);
|
||||
|
||||
return array('NUMERATEUR'=>$numerateur*100,'DENOMINATEUR'=>$denominateur,'NOTE'=>$numerateur*100/$denominateur);
|
||||
}
|
||||
|
||||
|
||||
|
||||
function getSecteurActivite($naf) {
|
||||
|
||||
$nbSecteurs=count($this->tabActivite);
|
||||
|
||||
while (strlen($naf) > 1)
|
||||
{
|
||||
for ($i=1; $i<$nbSecteurs; $i++)
|
||||
{
|
||||
for ($j=0; isset($this->tabActivite[$i][$j]); $j++)
|
||||
{
|
||||
if ($this->tabActivite[$i][$j]==$naf)
|
||||
// echo 'NAF '.$naf.' TROUVÉ !<br>';
|
||||
return $i;
|
||||
}
|
||||
}
|
||||
// echo 'NAF '.$naf.' non trouvé !<br>';
|
||||
$naf=substr($naf,0,strlen($naf)-1);
|
||||
}
|
||||
return 17; // Secteur d'activité par défaut si non trouvé
|
||||
}
|
||||
|
||||
function getBorne($note, $borne, $secteur) {
|
||||
|
||||
// print_array($this->tabR[$borne][$secteur],0);
|
||||
for ($j=0; $j<10; $j++)
|
||||
{
|
||||
$tabMinMax=explode(':',$this->tabR[$borne][$secteur][$j]);
|
||||
if ($tabMinMax[0]!='') $min=$tabMinMax[0];
|
||||
else $min=-1E99;
|
||||
if ($tabMinMax[1]!='') $max=$tabMinMax[1];
|
||||
else $max=1E99;
|
||||
|
||||
if ( ( $note>$min && $note<=$max ) )
|
||||
{
|
||||
// echo "TROUVE ++++ $note > ".$tabMinMax[0]." et $note <= ". $tabMinMax[1].'<br/>';
|
||||
if ($j==0) return 3;
|
||||
elseif ($j<4) return $j+4;
|
||||
else return $j*2+1;
|
||||
}
|
||||
// echo "NOK $note < ".$tabMinMax[0]." ou $note > ". $tabMinMax[1].'<br/>';
|
||||
}
|
||||
return 3; // On retourne la plus basse note par défaut
|
||||
}
|
||||
|
||||
|
||||
function getNoteBorne($note, $borne, $secteur, $numerateur, $denominateur) {
|
||||
|
||||
$noteBorneBrute=$this->getBorne($note, $borne, $secteur);
|
||||
|
||||
switch($borne)
|
||||
{
|
||||
case 1:
|
||||
if ($numerateur<0) return 3;
|
||||
else return $noteBorneBrute;
|
||||
break;
|
||||
case 2:
|
||||
if ($numerateur==0) return 19;
|
||||
else return $noteBorneBrute;
|
||||
break;
|
||||
case 3:
|
||||
if ($numerateur==0 && $denominateur>0) return 19;
|
||||
elseif ($denominateur<0) return 3;
|
||||
else return $noteBorneBrute;
|
||||
break;
|
||||
case 4:
|
||||
if ($note<0) return 19;
|
||||
else return $noteBorneBrute;
|
||||
break;
|
||||
default:
|
||||
return $noteBorneBrute;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function getNotationFin ($coteMoy) {
|
||||
if( $coteMoy > 18.5 )
|
||||
return 'A';
|
||||
elseif( $coteMoy > 16 )
|
||||
return 'B+';
|
||||
elseif( $coteMoy > 14 )
|
||||
return 'B';
|
||||
elseif( $coteMoy > 12.5 )
|
||||
return 'C+';
|
||||
elseif( $coteMoy > 11 )
|
||||
return 'C';
|
||||
elseif( $coteMoy > 10 )
|
||||
return 'C-';
|
||||
elseif( $coteMoy > 9 )
|
||||
return 'D+';
|
||||
elseif( $coteMoy > 8 )
|
||||
return 'D';
|
||||
elseif( $coteMoy > 7 )
|
||||
return 'D-';
|
||||
elseif( $coteMoy > 6 )
|
||||
return 'E+';
|
||||
elseif( $coteMoy > 4.5 )
|
||||
return 'E';
|
||||
elseif( $coteMoy > 3 )
|
||||
return 'E-';
|
||||
else
|
||||
return 'E--';
|
||||
}
|
||||
|
||||
|
||||
function getInfosNotation ($notation, $csv=false) {
|
||||
if ($csv) {
|
||||
$str =$this->tabNotation[$notation][1].';'.
|
||||
$this->tabNotation[$notation][2].';'.
|
||||
$this->tabNotation[$notation][3].';'.
|
||||
$this->tabNotation[$notation][4].';';
|
||||
return $str;
|
||||
} else {
|
||||
$str ='Notation : '. $this->tabNotation[$notation][0]."\r\n";
|
||||
$str.='Equivalence BDF : '. $this->tabNotation[$notation][1]."\r\n";
|
||||
$str.='Grades Moody\'s : '. $this->tabNotation[$notation][2]."\r\n";
|
||||
$str.='Grades S&P : '. $this->tabNotation[$notation][3]."\r\n";
|
||||
$str.='Probabilité de défaillance : '. $this->tabNotation[$notation][4]." %\r\n";
|
||||
return $str;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -1,47 +0,0 @@
|
||||
<?
|
||||
|
||||
function isinPoidsLettre($lettre) {
|
||||
$ascii=ord($lettre);
|
||||
if ($ascii>64 && $ascii<91 )
|
||||
/* En ASCII : A=65 et Z=90
|
||||
En ISIN... A=10 et Z=35 */
|
||||
return ($ascii-55);
|
||||
return false;
|
||||
}
|
||||
|
||||
/** Test si un code ISIN donné est valable à partir de son algo de contrôle.
|
||||
** @param string $isin Code ISIN à vérifier
|
||||
** @return bool
|
||||
**/
|
||||
function isValidIsin($isin) {
|
||||
|
||||
$pays=substr($isin, 0,2);
|
||||
$nsin=''.substr($isin, 2,9);
|
||||
$clef=substr($isin,11,1)*1;
|
||||
|
||||
$calcul=''.isinPoidsLettre($pays[0]).isinPoidsLettre($pays[1]).$nsin;
|
||||
//echo "Etape 1 = $calcul".EOL;
|
||||
|
||||
$sommeImpair=$sommePair=0;
|
||||
for ($impair=0; $impair<12; $impair=$impair+2) {
|
||||
$strImpair=''.$calcul[$impair]*2;
|
||||
if (isset($strImpair[1])) $reste=$strImpair[1]*1;
|
||||
else $reste=0;
|
||||
$sommeImpair+=$strImpair[0]*1+$reste;
|
||||
}
|
||||
|
||||
for ($pair=1; $pair<12; $pair=$pair+2)
|
||||
$sommePair+=$calcul[$pair]*1;
|
||||
|
||||
$totalcalcul=$sommeImpair+$sommePair;
|
||||
//echo "Etape 3 = $sommeImpair + $sommePair = $totalcalcul".EOL;
|
||||
|
||||
$dizSuperieur=ceil($totalcalcul/10)*10;
|
||||
$delta=$dizSuperieur-$totalcalcul;
|
||||
//echo "Etape 4 = $dizSuperieur - $totalcalcul = $delta".EOL;
|
||||
|
||||
if ($delta==$clef) return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
?>
|
@ -1,339 +0,0 @@
|
||||
<?
|
||||
/** Parse une page Html et retourne son contenu dans un tableau :
|
||||
** "code" => Code réponse Serveur
|
||||
** "header" => Headers du serveur
|
||||
** "body" => Page HTML
|
||||
**/
|
||||
function parse_response($this_response) {
|
||||
|
||||
|
||||
// Split response into header and body sections
|
||||
list($response_headers, $response_body) = explode("\r\n\r\n", $this_response, 2);
|
||||
$response_header_lines = explode("\r\n", $response_headers);
|
||||
|
||||
// First line of headers is the HTTP response code
|
||||
$http_response_line = array_shift($response_header_lines);
|
||||
if(preg_match('@^HTTP/[0-9]\.[0-9] ([0-9]{3})@',$http_response_line, $matches)) { $response_code = $matches[1]; }
|
||||
|
||||
// put the rest of the headers in an array
|
||||
$response_header_array = array();
|
||||
$nbRMID=0;
|
||||
foreach($response_header_lines as $header_line)
|
||||
{
|
||||
list($header,$value) = explode(': ', $header_line, 2);
|
||||
|
||||
if ($header=='Set-cookie' && substr($value,0,5)=='RMID=' && $nbRMID<5)//{
|
||||
$nbRMID++;
|
||||
// echo ("Je gicle le RMID n°$nbRMID\r\n");}
|
||||
else
|
||||
$response_header_array[$header] .= $value."\n";
|
||||
}
|
||||
return array('code' => $response_code, 'header' => $response_header_array, 'body' => $response_body);
|
||||
}
|
||||
|
||||
/** Récupère une page HTML en fonction des paramètres :
|
||||
** $url Url distante de la page à récupérer
|
||||
** $strCookies Chaine de caractère contenant les cookies
|
||||
** $postData Tableau des données à passer en POST uniquement
|
||||
** $referer Referer à indiquer lors de l'appel de la page
|
||||
** $debug Activer le débogage (True/False)
|
||||
**
|
||||
** ... et retourne son contenu dans un tableau :
|
||||
** "code" => Code réponse Serveur
|
||||
** "header" => Headers du serveur
|
||||
** "body" => Page HTML
|
||||
**/
|
||||
function getUrl($url, $strCookies='', $postData='', $referer='', $debug=false, $host='') {
|
||||
|
||||
|
||||
$ch = curl_init();
|
||||
|
||||
if ($host=='')
|
||||
$this_header = array('Host: '. HOST_INSEE);
|
||||
else
|
||||
$this_header = array('Host: '. $host);
|
||||
|
||||
curl_setopt($ch, CURLOPT_URL, $url);
|
||||
curl_setopt($ch, CURLOPT_HEADER, 1);
|
||||
//curl_setopt($ch, CURLOPT_PROXY, '10.142.10.254:80');
|
||||
//curl_setopt($ch, CURLOPT_PROXYUSERPWD, 'username:password'); // Pas nécessaire en authentification NT
|
||||
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
||||
//curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
|
||||
//curl_setopt($ch, CURLOPT_MAXREDIRS, 1);
|
||||
|
||||
$user_agent = 'Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)';
|
||||
curl_setopt($ch, CURLOPT_USERAGENT, $user_agent);
|
||||
curl_setopt($ch, CURLOPT_REFERER, $referer);
|
||||
|
||||
// Add each cookie that has been returned in the response
|
||||
// If cookies need to be added/deleted or value changed, then add code here
|
||||
if ($strCookies!='') {
|
||||
//die('"'.$strCookies.'"');
|
||||
//echo $strCookies."\r\n";
|
||||
$cookies = explode("\n", $strCookies);
|
||||
// Create the basic header
|
||||
foreach($cookies as $this_cookie) {
|
||||
if (trim($this_cookie)<>'')
|
||||
array_push($this_header, 'Cookie: '.$this_cookie);
|
||||
}
|
||||
}
|
||||
|
||||
if ($postData!='') {
|
||||
if (is_array($postData))
|
||||
$post_data=$postData;
|
||||
|
||||
$o="";
|
||||
foreach ($post_data as $k=>$v)
|
||||
{
|
||||
$o.= "$k=".utf8_encode($v)."&";
|
||||
}
|
||||
$post_data=substr($o,0,-1);
|
||||
|
||||
curl_setopt($ch, CURLOPT_POST, 1);
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
|
||||
//if in_array('',$this_header
|
||||
/*array_push($this_header, "Content-type: application/x-www-form-urlencoded");
|
||||
array_push($this_header, "Content-Length: 44");*/
|
||||
}
|
||||
|
||||
curl_setopt($ch, CURLOPT_HTTPHEADER, $this_header);
|
||||
//print_r($this_header);
|
||||
|
||||
$page=curl_exec($ch);
|
||||
$response = parse_response($page);
|
||||
if ($debug){
|
||||
$url2=str_replace('http://', '', $url);
|
||||
$url2=str_replace('/', '_', $url2);
|
||||
$url2=str_replace('?', '(param)', $url2);
|
||||
$url2=str_replace('&', '(et)', $url2);
|
||||
|
||||
|
||||
$fp=fopen('/var/www/_includes/partenaires/insee/'. date('Ymd-His') .'-'. microtime_float(true) .'-'. $url2 . '.html', 'a');
|
||||
fwrite($fp, $url."\r\n");
|
||||
fwrite($fp, $page);
|
||||
fclose($fp);
|
||||
//echo strip_tags(html_entity_decode($response['body']), '<td>');
|
||||
}
|
||||
//print_r(curl_getinfo($ch));
|
||||
curl_close($ch);
|
||||
return $response;
|
||||
}
|
||||
|
||||
|
||||
function rechercheTelephone($raisonSociale='', $adresse='', $localite='', $departement='', $activite='') {
|
||||
|
||||
$response1=getUrl(SITE_PJ.'pj.cgi?', '', '', '', true, HOST_PJ);
|
||||
//print_r($response1['header']['Set-cookie']);
|
||||
$pageHtml=$response1['body'];
|
||||
$SESSION_ID=getTextInHtml($pageHtml, '<input type="hidden" name="SESSION_ID" value="', ' value="', '">');
|
||||
$VID=getTextInHtml($pageHtml, '<input type="hidden" name="VID" value="', ' value="', '">');
|
||||
$e_cookie=getTextInHtml($pageHtml, '<noscript><img ALT="" src="http://e.pagesjaunes.fr/m/web/', 'src="', '" BORDER=0 width=1 height=1></noscript>');
|
||||
|
||||
$response=getUrl(SITE_PJ.'files/look2002/FR/commun/pji.css', '', '', SITE_PJ.'pj.cgi?', false, HOST_PJ);
|
||||
$response=getUrl(SITE_PJ.'files/look2002/FR/commun/pji_PJ.css', '', '', SITE_PJ.'pj.cgi?', false, HOST_PJ);
|
||||
$response=getUrl(SITE_PJ.'files/look2002/FR/commun/script_open.js', '', '', SITE_PJ.'pj.cgi?', false, HOST_PJ);
|
||||
$response=getUrl(SITE_PJ.'files/look2002/FR/commun/alerte.js', '', '', SITE_PJ.'pj.cgi?', false, HOST_PJ);
|
||||
$response=getUrl(SITE_PJ.'files/look2002/FR/commun/script_VED.js', '', '', SITE_PJ.'pj.cgi?', false, HOST_PJ);
|
||||
$response=getUrl(SITE_PJ.'sitecrm/popup.js', '', '', SITE_PJ.'pj.cgi?', false, HOST_PJ);
|
||||
$response=getUrl('http://sbx.pagesjaunes.fr/RealMedia/ads/Creatives/OasDefault/AUTOPROMO_PJ_banniere_activite/hotel_pj.swf?clickTAG=http://sbx.pagesjaunes.fr/RealMedia/ads/click_lx.ads/www.pagesjaunes.fr/GENERAL/GENERAL/PJ/1238513556/Top/OasDefault/AUTOPROMO_PJ_banniere_activite/hotel_pj.html/61633130323433353434346339306330?', '', '', SITE_PJ.'pj.cgi?', false, HOST_PJ);
|
||||
$response=getUrl(SITE_PJ.'files/look2002/FR/commun/script_VED.js', '', '', SITE_PJ.'pj.cgi?', false, HOST_PJ);
|
||||
$response=getUrl('http://sbx.pagesjaunes.fr/RealMedia/ads/Creatives/OasDefault/EDITO_HOME_RIGHT/anim_HP_v2-04-2006.swf', '', '', SITE_PJ.'pj.cgi?', false, HOST_PJ);
|
||||
$response=getUrl('http://sbx.pagesjaunes.fr/RealMedia/ads/Creatives/OasDefault/EDITO_HOME_RIGHT/visuels_webcam.swf', '', '', SITE_PJ.'pj.cgi?', false, HOST_PJ);
|
||||
$response=getUrl('http://sbx.pagesjaunes.fr/RealMedia/ads/Creatives/OasDefault/EDITO_HOME_RIGHT/visuels_photo.swf', '', '', SITE_PJ.'pj.cgi?', false, HOST_PJ);
|
||||
$response=getUrl('http://sbx.pagesjaunes.fr/RealMedia/ads/Creatives/OasDefault/EDITO_HOME_RIGHT/visuels_trafic.swf', '', '', SITE_PJ.'pj.cgi?', false, HOST_PJ);
|
||||
$response=getUrl('http://sbx.pagesjaunes.fr/RealMedia/ads/Creatives/OasDefault/Edito_webcams/new_04-2006.jpg', '', '', SITE_PJ.'pj.cgi?', false, HOST_PJ);
|
||||
$response=getUrl('http://e.pagesjaunes.fr/js/m.js', '', '', SITE_PJ.'pj.cgi?', false, HOST_PJ);
|
||||
|
||||
$response2=getUrl($e_cookie, $response1['header']['Set-cookie'], '', SITE_PJ, true, HOST_PJ);
|
||||
|
||||
$cookies=$response1['header']['Set-cookie'] . $response2['header']['Set-Cookie'];
|
||||
|
||||
$input_image=$VALID_ARR=$NUM_RUE=$NEW_DEPARTEMENT=$OBJ_GEO='';
|
||||
|
||||
// Requête d'interrogation
|
||||
$postData=array(
|
||||
'ACTIVITE_VALIDATED_ASCII'=>'',
|
||||
'ID_THEME_SDE'=>'',
|
||||
'LISTE_RUB_AVEC_THEME'=>'',
|
||||
'input_image'=>$input_image,
|
||||
|
||||
'FRM_ACTIVITE'=>$activite,
|
||||
'FRM_NOM'=>$raisonSociale,
|
||||
'FRM_ADRESSE'=>$adresse,
|
||||
'FRM_LOCALITE'=>$localite,
|
||||
'FRM_DEPARTEMENT'=>$departement,
|
||||
|
||||
'JF_INSCRIPTIONS_REQ.x'=>'25',
|
||||
'JF_INSCRIPTIONS_REQ.y'=>'4',
|
||||
'faire'=>'decode_input_image',
|
||||
'DEFAULT_ACTION'=>'jf_inscriptions_req',
|
||||
'SESSION_ID'=>$SESSION_ID,
|
||||
'VID'=>$VID,
|
||||
'INFO_VILLE'=>'non',
|
||||
'CODE_LOC_INFO_VILLE'=>'00000000',
|
||||
'IV_ACTIVATION'=>'oui',
|
||||
'lang'=>'FR',
|
||||
'pays'=>'FR',
|
||||
'srv'=>'PJ',
|
||||
'TYPE_RECHERCHE'=>'ZZZ');
|
||||
//print_r($postData);//die();
|
||||
sleep(1);
|
||||
$response=getUrl(SITE_PJ, $cookies, $postData, SITE_PJ, true, HOST_PJ);
|
||||
$pageHtml=$response['body'];
|
||||
|
||||
if (count($tabNT=getTabListeNonTrouve($pageHtml))>0)
|
||||
{
|
||||
// Pas de réponses pour ces critères
|
||||
// Il faut élargir la recherche !
|
||||
$tabNTk=array_keys($tabNT);
|
||||
$input_image=$tabNT[0];
|
||||
$DEFAULT_ACTION='inscriptions_req';
|
||||
$NEW_DEPARTEMENT=getTextInHtml($pageHtml, '<input type="hidden" name="NEW_DEPARTEMENT" value="', 'value="', '">');
|
||||
$OBJ_GEO=getTextInHtml($pageHtml, '<input type=hidden name=OBJ_GEO value="', 'value="', '">');
|
||||
}
|
||||
elseif (count($tabGU=getTabListeGU($pageHtml))>0)
|
||||
{
|
||||
// Plusieurs Adresses possibles pour l'adresse donnée
|
||||
// print_r($tabGU);
|
||||
$input_image=getBonneAdresse($adresse, $tabGU);
|
||||
$DEFAULT_ACTION='jf_inscriptions_req';
|
||||
$VALID_ARR=getTextInHtml($pageHtml, '<input type=hidden name=VALID_ARR value="', 'value="', '">');
|
||||
$NUM_RUE=getTextInHtml($pageHtml, '<input type=hidden name=NUM_RUE value="', 'value="', '">');
|
||||
}
|
||||
|
||||
if ($input_image<>'') {
|
||||
$CODE_LOC_INFO_VILLE=getTextInHtml($pageHtml, '<input type="hidden" name="CODE_LOC_INFO_VILLE" value="', 'value="', '">');
|
||||
|
||||
$postData=array(
|
||||
'GEO_DEP'=>'', // New
|
||||
'faire'=>'decode_input_image',
|
||||
'DEFAULT_ACTION'=>$DEFAULT_ACTION,
|
||||
'input_image'=>$input_image,// diff
|
||||
'SESSION_ID'=>$SESSION_ID,
|
||||
'VID'=>$VID,
|
||||
'INFO_VILLE'=>'oui', // non dans la recherche préc.
|
||||
'CODE_LOC_INFO_VILLE'=>$CODE_LOC_INFO_VILLE, // diff
|
||||
'IV_ACTIVATION'=>'oui',
|
||||
'lang'=>'FR',
|
||||
'pays'=>'FR',
|
||||
'srv'=>'PJ',
|
||||
'TYPE_RECHERCHE'=>'CLOC', // ZZZ
|
||||
'SAV_ADRESSE'=>$adresse, //
|
||||
'SAV_LOCALITE'=>$localite, // New
|
||||
'SAV_DEPARTEMENT'=>$departement, //
|
||||
'FRM_NOM'=>$raisonSociale,
|
||||
'FRM_ADRESSE'=>$adresse,
|
||||
'FRM_LOCALITE'=>$localite,
|
||||
'FRM_DEPARTEMENT'=>$departement,
|
||||
|
||||
'FRM_TYPE_PUB'=>'TOUS',
|
||||
'RP_FORM'=>'',
|
||||
'VALID_LOC'=>$CODE_LOC_INFO_VILLE,
|
||||
'VALID_ARR'=>$VALID_ARR,
|
||||
'NUM_RUE'=>$NUM_RUE,
|
||||
'test_flash'=>'',
|
||||
'ESPLUS'=>'',
|
||||
'NEW_DEPARTEMENT'=>$NEW_DEPARTEMENT,
|
||||
'OBJ_GEO'=>$OBJ_GEO,
|
||||
);
|
||||
print_r($postData);
|
||||
sleep(1);
|
||||
$response=getUrl(SITE_PJ, $cookies, $postData, SITE_PJ, true, HOST_PJ);
|
||||
$pageHtml=$response['body'];
|
||||
}
|
||||
|
||||
$nbReponses=trim(getTextInHtml($pageHtml, '<tr><td align="left" class=txtrequetetotal valign=middle nowrap><b>', '<b>', 'réponse(s)</b></td>'));
|
||||
$tabRep=getTabResponses($pageHtml);
|
||||
|
||||
if (count($tabRep)==$nbReponses)
|
||||
return $tabRep;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
function getTabResponses($pageHtml) {
|
||||
|
||||
$tabRepTmp=explode ('class=fdinscr', $pageHtml);
|
||||
$tabRep=array();
|
||||
foreach($tabRepTmp as $key => $value)
|
||||
{
|
||||
if ($key>0) {
|
||||
$raisonSociale=getTextInHtml($value, 'class=fdrsinscr', '<b>', '</b>');
|
||||
$ligneAdresse=html_entity_decode(getTextInHtml($value, '<td align="left" class=txtinscr ><b>', '<b>', '|'));
|
||||
$tabligneAdresse=explode('<br>', $ligneAdresse);
|
||||
$ligneAdresse1=strip_tags($tabligneAdresse[0]);
|
||||
$ligneAdresse2=strip_tags($tabligneAdresse[1]);
|
||||
$dispoPlan =(bool)(strpos($value, '<b>Plan</b>'));
|
||||
$dispoIti =(bool)(strpos($value, '<b>Itinéraire</b>'));
|
||||
$dispoPhoto =(bool)(strpos($value, '<b>Photo</b>'));
|
||||
$dispoWeb =(bool)(strpos($value, '<b>Site</b></a> '));
|
||||
$lienWeb=getTextInHtml($value, '<a target="_blank" href="http://www.pagesjaunes.fr/CGI/MOD?', 'href="', '" ');
|
||||
$page=getUrl($lienWeb, '', '', '', true);
|
||||
$lienWeb=$page['header']['Location'];
|
||||
|
||||
/*echo "Enreg n°$key : RS='$raisonSociale'\r\n";
|
||||
echo "Enreg n°$key : Adresse1='$ligneAdresse1'\r\n";
|
||||
echo "Enreg n°$key : Adresse2='$ligneAdresse2'\r\n";
|
||||
echo "Enreg n°$key : Plan ?='$dispoPlan'\r\n";
|
||||
echo "Enreg n°$key : Itineraire ?='$dispoIti'\r\n";
|
||||
echo "Enreg n°$key : Photo ?='$dispoPhoto'\r\n";
|
||||
echo "Enreg n°$key : Web ?='$dispoWeb'\r\n";
|
||||
echo "Enreg n°$key : Site WEB='$lienWeb'\r\n\r\n";*/
|
||||
array_push($tabRep, array( 'raisonSociale' =>$raisonSociale,
|
||||
'AdresseLigne1' =>$ligneAdresse1,
|
||||
'AdresseLigne2' =>$ligneAdresse2,
|
||||
'Dispo_Plan' =>$dispoPlan,
|
||||
'Dispo_Iti' =>$dispoIti,
|
||||
'Dispo_Photo' =>$dispoPhoto,
|
||||
'Dispo_Web' =>$dispoWeb,
|
||||
'LienWeb' =>$lienWeb));
|
||||
}
|
||||
}
|
||||
return $tabRep;
|
||||
}
|
||||
|
||||
function getBonneAdresse($adresse, $tabGU) {
|
||||
|
||||
// tableau de mots à vérifier
|
||||
$words = array_keys($tabGU);
|
||||
|
||||
// aucune distance de trouvée pour le moment
|
||||
$shortest = -1;
|
||||
|
||||
// boucle sur les des mots pour trouver le plus près
|
||||
foreach ($words as $word) {
|
||||
|
||||
// calcule la distance avec le mot mis en entrée,
|
||||
// et le mot courant
|
||||
$lev = levenshtein($adresse, $word);
|
||||
|
||||
// cherche une correspondance exacte
|
||||
if ($lev == 0) {
|
||||
|
||||
// le mot le plus près est celui-ci (correspondance exacte)
|
||||
$closest = $word;
|
||||
$shortest = 0;
|
||||
|
||||
// on sort de la boucle ; nous avons trouvé une correspondance exacte
|
||||
break;
|
||||
}
|
||||
|
||||
// Si la distance est plus petite que la prochaine distance trouvée
|
||||
// OU, si le prochain mot le plus près n'a pas encore été trouvé
|
||||
if ($lev <= $shortest || $shortest < 0) {
|
||||
// définission du mot le plus près ainsi que la distance
|
||||
$closest = $word;
|
||||
$shortest = $lev;
|
||||
}
|
||||
}
|
||||
/*
|
||||
echo "Mot entré : $adresse\n";
|
||||
if ($shortest == 0) {
|
||||
echo "Correspondance exacte trouvée : $closest\n";
|
||||
} else {
|
||||
echo "Vous voulez dire : $closest ?\n";
|
||||
}*/
|
||||
return $tabGU[$closest];
|
||||
}
|
||||
?>
|
@ -1,548 +0,0 @@
|
||||
<?
|
||||
class Insee {
|
||||
}
|
||||
|
||||
function getDataEtablissement($pageHtml)
|
||||
{
|
||||
global $libelleErreur;
|
||||
|
||||
$responseSiege=$pageHtml;
|
||||
$tabRet=array();
|
||||
|
||||
// On recherche si on est sur un établissement siège ou secondaire
|
||||
$pos=strpos($pageHtml, '<table cols="2" width="100%"><tr><td bgcolor="#FFCC33" align="left"><font face="Arial" size="2"><B>Fiche Etablissement</B>');
|
||||
if ($pos>0)
|
||||
$tabRet['typeEtablissement']='secondaire';
|
||||
|
||||
$pos=strpos($pageHtml, '<table cols="2" width="100%"><tr><td bgcolor="#FFCC33" align="left"><font face="Arial" size="2"><B>Fiche siège</B>');
|
||||
if ($pos>0)
|
||||
$tabRet['typeEtablissement']='siège';
|
||||
|
||||
// Recherche Dernière MAJ / Activité
|
||||
$pos=strpos($responseSiege, '<font face="Arial" size="2">(dernière mise à jour :');
|
||||
if ($pos>0) {
|
||||
$tabRet['dateMAJ']=substr($responseSiege, $pos+51, 10);
|
||||
$tabRet['dateAbsActivite']='';
|
||||
$tabRet['active']='O';
|
||||
} else {
|
||||
$tabRet['active']='N';
|
||||
$tabRet['dateMAJ']='';
|
||||
$pos=strpos($responseSiege, '<font face="Arial" size="2">Absence d\'activité notée le : ');
|
||||
if ($pos>0) $tabRet['dateAbsActivite']=substr($responseSiege, $pos+78, 10);
|
||||
else {
|
||||
$pos=strpos($responseSiege, '<font face="Arial" size="2">Absence d\'activité');
|
||||
if ($pos>0) $tabRet['dateAbsActivite']='';
|
||||
}
|
||||
}
|
||||
|
||||
$pos=strpos($responseSiege, ' size="-1"> <B>n° SIRET :</B></FONT></td><td valign="top"><font face="Arial" size="-1">');
|
||||
$tabRet['siret']=str_replace(' ', '', html_entity_decode(substr($responseSiege, $pos+97, 32)));
|
||||
|
||||
$pos=strpos($responseSiege, 'size="-1"> <B>Date de création :</B></FONT></td><td valign="top"><font face="Arial" size="-1">');
|
||||
if ($pos>0) {
|
||||
$posFin=strpos($responseSiege, '</font>', $pos+109);
|
||||
$tabRet['dateCreation']=str_replace(' ', '', html_entity_decode(substr($responseSiege, $pos+109, $posFin-($pos+109))));
|
||||
}
|
||||
else $tabRet['dateCreation']='';
|
||||
|
||||
$pos=strpos($responseSiege, ' size="-1"> <B>Raison sociale et Enseigne :</B></FONT></td><td valign="top" colspan="3"><font face="Arial" size="-1">');
|
||||
$len=127;
|
||||
if ($pos==0){
|
||||
$pos=strpos($responseSiege, ' size="-1"> <B>Raison sociale et Enseigne :</B></FONT></td><td valign="top" colspan="3"><font face="Arial" size="-1">');
|
||||
$len=122;
|
||||
if ($pos==0){
|
||||
$pos=strpos($responseSiege, ' size="-1"> <B>Raison sociale et Enseigne :</B></FONT></td><td valign="top" colspan="3"><font face="Arial" size="-1">');
|
||||
$len=126;
|
||||
$libelleErreur='Informations INSEE non diffusables';
|
||||
}
|
||||
}
|
||||
if ($libelleErreur=='') {
|
||||
//LARGE*DOMINIQUE MICHEL/ <BR>GERANT SARL BIMAGIQUE </font>
|
||||
$posFin=strpos($responseSiege, '</font>', $pos+$len);
|
||||
$raisonSocialeStr=trim(substr($responseSiege, $pos+$len, $posFin-($pos+$len)));
|
||||
$raisonSocialeTabLigne=explode('<BR>', $raisonSocialeStr);
|
||||
$tabRet['raisonSociale']=trim(str_replace(' ', '', html_entity_decode($raisonSocialeTabLigne[0])));
|
||||
$tabRet['Enseigne']=trim(str_replace(' ', '', html_entity_decode($raisonSocialeTabLigne[1])));
|
||||
|
||||
$pos=strpos($responseSiege, ' size="-1"> <B>Activité principale :</B></FONT></td><td valign="top" colspan="3"><font face="Arial" size="-1">');
|
||||
$tabRet['NafCode']=substr($responseSiege, $pos+120, 4);
|
||||
$tabRet['NafLib']=trim(substr($responseSiege, $pos+137, 70));
|
||||
|
||||
$pos=strpos($responseSiege, ' size="-1"> <B>Adresse :</B></FONT></td><td valign="top" colspan="3"><font face="Arial" size="-1">');
|
||||
$posFin=strpos($responseSiege, '</font>', $pos+103);
|
||||
$AdresseStr=substr($responseSiege, $pos+103, $posFin-($pos+103));
|
||||
$AdresseTabLigne=explode('<BR>', $AdresseStr);//'
|
||||
$tabRet['AdresseLigne1']=str_replace(' ', '/', $AdresseTabLigne[0]);
|
||||
$tabRet['AdresseLigne2']=str_replace(' ', '/', $AdresseTabLigne[1]);
|
||||
$tabRet['AdresseLigne3']=str_replace(' ', '/', $AdresseTabLigne[2]);
|
||||
/*
|
||||
$AdresseNum=$AdresseTabLigne1[0];
|
||||
$AdresseVoi=$AdresseTabLigne1[1];
|
||||
$AdresseRue=$AdresseTabLigne1[2];
|
||||
$AdresseCP=$AdresseTabLigne2[0];
|
||||
$AdresseVille=$AdresseTabLigne2[1];
|
||||
*/
|
||||
$pos=strpos($responseSiege, '<font face="Arial" size="-1"><b>L\'entreprise est connue au répertoire comme ');
|
||||
if ($pos>0) {
|
||||
$posFin=strpos($responseSiege, '</b>', $pos+106);
|
||||
$tabRet['etatJuridique']=html_entity_decode(substr($responseSiege, $pos+106, $posFin-($pos+106)));
|
||||
$tabRet['dateEtatJuridique']='';
|
||||
} else {
|
||||
$pos=strpos($responseSiege, '<font face="Arial" size="-1"><b>L\'entreprise est cessée le : ');
|
||||
$tabRet['dateEtatJuridique']=substr($responseSiege, $pos+86, 10);
|
||||
$tabRet['etatJuridique']='cessée';
|
||||
}
|
||||
//echo 'GetDataEtab="'.$libelleErreur."\"\r\n";
|
||||
|
||||
return $tabRet;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function getDataEntreprise($pageHtml)
|
||||
{
|
||||
global $libelleErreur;
|
||||
|
||||
$responseEntreprise=$pageHtml;
|
||||
$tabRet=array();
|
||||
|
||||
if ($libelleErreur=='') {
|
||||
|
||||
$pos=strpos($responseEntreprise, 'size="-1"> <B>Date de création :</B></FONT></td><td valign="top"><font face="Arial" size="-1">');
|
||||
if ($pos>0)
|
||||
$tabRet['dateCreationEntrep']=substr($responseEntreprise, $pos+109, 10);
|
||||
else
|
||||
$tabRet['dateCreationEntrep']='';
|
||||
|
||||
// Raison sociale et Sigle
|
||||
$pos=strpos($responseEntreprise, ' size="-1"> <B>Raison sociale et Sigle :</B></FONT></td><td valign="top" colspan="3"><font face="Arial" size="-1">');
|
||||
$posFin=strpos($responseEntreprise, '</font>', $pos+123);
|
||||
$raisonSocialeStr=trim(substr($responseEntreprise, $pos+123, $posFin-($pos+123)));
|
||||
$raisonSocialeTabLigne=explode('<BR>', $raisonSocialeStr);
|
||||
$tabRet['raisonSocialeEntrep']=trim(str_replace(' ', '', html_entity_decode($raisonSocialeTabLigne[0])));
|
||||
$tabRet['sigle']=trim(str_replace(' ', '', html_entity_decode($raisonSocialeTabLigne[1])));
|
||||
|
||||
// Activité prinicpale Entrep
|
||||
$pos=strpos($responseEntreprise, ' size="-1"> <B>Activité principale :</B></FONT></td><td valign="top" colspan="3"><font face="Arial" size="-1">');
|
||||
$tabRet['NafCodeEntrep']=substr($responseEntreprise, $pos+120, 4);
|
||||
$tabRet['NafLibEntrep']=trim(substr($responseEntreprise, $pos+137, 70));
|
||||
|
||||
// Forme Juridique
|
||||
$pos=strpos($responseEntreprise, ' size="-1"> <B>Forme juridique :</B></FONT></td><td valign="top" colspan="3"><font face="Arial" size="-1">');
|
||||
$tabRet['FJCodeEntrep']=substr($responseEntreprise, $pos+116, 4);
|
||||
$tabRet['FJLibEntrep']=trim(substr($responseEntreprise, $pos+133, 70));
|
||||
|
||||
// Nb Etab Actifs
|
||||
$pos=strpos($responseEntreprise, ' size="-1"> <B>Nb établissements actifs :</B></FONT></td><td valign="top"><font face="Arial" size="-1">');
|
||||
$posFin=strpos($responseEntreprise, '</font>', $pos+118);
|
||||
$tabRet['nbEtabActifs']=trim(str_replace(' ', '', html_entity_decode(substr($responseEntreprise, $pos+118, $posFin-($pos+118)))));
|
||||
}
|
||||
return $tabRet;
|
||||
}
|
||||
|
||||
/*
|
||||
* parseHtml.php
|
||||
* Author: Carlos Costa Jordao
|
||||
* Email: carlosjordao@yahoo.com
|
||||
*
|
||||
* My notation of variables:
|
||||
* i_ = integer, ex: i_count
|
||||
* a_ = array, a_html
|
||||
* b_ = boolean,
|
||||
* s_ = string
|
||||
*
|
||||
* What it does:
|
||||
* - parses a html string and get the tags
|
||||
* - exceptions: html tags like <br> <hr> </a>, etc
|
||||
* - At the end, the array will look like this:
|
||||
* ["IMG"][0]["SRC"] = "xxx"
|
||||
* ["IMG"][1]["SRC"] = "xxx"
|
||||
* ["IMG"][1]["ALT"] = "xxx"
|
||||
* ["A"][0]["HREF"] = "xxx"
|
||||
*
|
||||
*/
|
||||
function parseHtml( $s_str )
|
||||
{
|
||||
$i_indicatorL = 0;
|
||||
$i_indicatorR = 0;
|
||||
$s_tagOption = '';
|
||||
$i_arrayCounter = 0;
|
||||
$a_html = array();
|
||||
// Search for a tag in string
|
||||
while( is_int(($i_indicatorL=strpos($s_str,'<',$i_indicatorR))) ) {
|
||||
// Get everything into tag...
|
||||
$i_indicatorL++;
|
||||
$i_indicatorR = strpos($s_str,'>', $i_indicatorL);
|
||||
$s_temp = substr($s_str, $i_indicatorL, ($i_indicatorR-$i_indicatorL) );
|
||||
$a_tag = explode( ' ', $s_temp );
|
||||
// Here we get the tag's name
|
||||
list( ,$s_tagName,, ) = each($a_tag);
|
||||
$s_tagName = strtoupper($s_tagName);
|
||||
// Well, I am not interesting in <br>, </font> or anything else like that...
|
||||
// So, this is false for tags without options.
|
||||
$b_boolOptions = is_array(($s_tagOption=each($a_tag))) && $s_tagOption[1];
|
||||
if( $b_boolOptions ) {
|
||||
// Without this, we will mess up the array
|
||||
$i_arrayCounter = (int)count($a_html[$s_tagName]);
|
||||
// get the tag options, like src="htt://". Here, s_tagTokOption is 'src' and s_tagTokValue is '"http://"'
|
||||
|
||||
do {
|
||||
$s_tagTokOption = strtoupper(strtok($s_tagOption[1], "="));
|
||||
$s_tagTokValue = trim(strtok("="));
|
||||
$a_html[$s_tagName][$i_arrayCounter][$s_tagTokOption] =
|
||||
$s_tagTokValue;
|
||||
$b_boolOptions = is_array(($s_tagOption=each($a_tag))) &&
|
||||
$s_tagOption[1];
|
||||
} while( $b_boolOptions );
|
||||
}
|
||||
}
|
||||
return $a_html;
|
||||
}
|
||||
|
||||
function getDataEntrepriseRNCS($pageHtml) {
|
||||
|
||||
global $libelleErreur;
|
||||
|
||||
$tabRet=array();
|
||||
|
||||
// Liste et liens vers les Bilans
|
||||
$tabRet['tabListeBilans']=getTabListeBilans($pageHtml);
|
||||
$tabRet['raisonSociale']=getTextInHtml($pageHtml, '<td align="left" valign="top"><span class="boldred"><br>', '<br>', '</span>');
|
||||
$tabRet['RCS']=getTextInHtml($pageHtml, '<span class="textarial">RCS ', 'RCS ', '</span>', true);
|
||||
$tabRet['activite']=getTextInHtml($pageHtml, '<td width="185" align="left" valign="top" bgcolor="#FFFFFF" class="boldtextarial">Activité</td>', 'class="basictext">', '</td>');
|
||||
$tabRet['adresseSiege']=getTextInHtml($pageHtml, '<td align="left" valign="top" bgcolor="#FFFFFF" class="boldtextarial">Siège
|
||||
social</td>', 'class="basictext">', '</td>');
|
||||
print_r($tabRet);
|
||||
die();
|
||||
// Capital social
|
||||
|
||||
// Chiffre d'affaires
|
||||
|
||||
// Date CA
|
||||
|
||||
// Effectif
|
||||
|
||||
// Forme Juridique
|
||||
|
||||
// Nationalité
|
||||
|
||||
// Activité
|
||||
|
||||
// Siège social
|
||||
/*
|
||||
<tr>
|
||||
<td bgcolor="#336699"><img src="../images/shim.gif" width="2" height="2"></td>
|
||||
<td align="left" valign="top" bgcolor="#FFFFFF" class="boldtextarial">Siège
|
||||
social</td>
|
||||
<td bgcolor="#336699"><img src="../images/shim.gif" width="2" height="2"></td>
|
||||
|
||||
<td align="left" valign="top" bgcolor="#EBF0F5" class="basictext">75 Avenue la Grande Armee<br>
|
||||
75116 PARIS 16 </td>
|
||||
</tr>
|
||||
</table>
|
||||
<div align="center"><img src="../images/degrade580grey.jpg" width="580" height="12"><br>
|
||||
<br>
|
||||
</div>
|
||||
<table width="600" border="0" cellspacing="0" cellpadding="0">
|
||||
|
||||
<tr>
|
||||
<td align="left" valign="top"><img src="../images/arrowsmallblue.gif" width="9" height="10"><span class="boldtextarialblue15">Renseignements
|
||||
juridiques</span></td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
</table>
|
||||
<table width="580" border="0" align="center" cellpadding="1" cellspacing="2">
|
||||
|
||||
|
||||
<tr align="left" valign="top">
|
||||
<td width="5" bgcolor="#336699"><img src="../images/shim.gif" width="2" height="2"></td>
|
||||
|
||||
<td width="185" bgcolor="#FFFFFF" class="boldtextarial">Forme
|
||||
juridique</td>
|
||||
<td width="5" bgcolor="#336699"><img src="../images/shim.gif" width="2" height="2"></td>
|
||||
<td width="385" bgcolor="#EBF0F5" class="basictext">SA à conseil d'administration</td>
|
||||
</tr>
|
||||
|
||||
<tr align="left" valign="top">
|
||||
<td width="5" bgcolor="#336699"><img src="../images/shim.gif" width="2" height="2"></td>
|
||||
<td width="185" bgcolor="#FFFFFF" class="boldtextarial">Capital social</td>
|
||||
|
||||
<td width="5" bgcolor="#336699"><img src="../images/shim.gif" width="2" height="2"></td>
|
||||
<td width="385" bgcolor="#EBF0F5" class="basictext">171.285.000,00
|
||||
EURO</td>
|
||||
</tr>
|
||||
|
||||
<tr align="left" valign="top">
|
||||
<td width="5" bgcolor="#336699"><img src="../images/shim.gif" width="2" height="2"></td>
|
||||
<td width="185" bgcolor="#FFFFFF" class="boldtextarial">Nationalité</td>
|
||||
<td width="5" bgcolor="#336699"><img src="../images/shim.gif" width="2" height="2"></td>
|
||||
<td bgcolor="#EBF0F5" class="basictext">France</td>
|
||||
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
<div align="center"><img src="../images/degrade580grey.jpg" width="580" height="12"><br>
|
||||
<br>
|
||||
</div>
|
||||
<div align="center">
|
||||
<table width="588" border="0" cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<td width="210" align="left" valign="top"><img src="../images/arrowsmallblue.gif" width="9" height="10"><span class="boldtextarialblue15">Chiffres
|
||||
clés</span></td>
|
||||
|
||||
<td width="378" align="left" valign="top" class="smalltext">au 31-12-2004</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table width="580" border="0" align="center" cellpadding="1" cellspacing="2">
|
||||
<tr>
|
||||
<td width="5" bgcolor="#336699"><img src="../images/shim.gif" width="2" height="2"></td>
|
||||
<td width="185" align="left" valign="top" bgcolor="#FFFFFF" class="boldtextarial">Chiffre
|
||||
d'affaires</td>
|
||||
<td width="5" bgcolor="#336699"><img src="../images/shim.gif" width="2" height="2"></td>
|
||||
|
||||
<td width="385" align="left" valign="top" bgcolor="#EBF0F5" class="basictext">18.049.000.000
|
||||
EU</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="5" bgcolor="#336699"><img src="../images/shim.gif" width="2" height="2"></td>
|
||||
<td width="185" align="left" valign="top" bgcolor="#FFFFFF" class="boldtextarial">Effectif</td>
|
||||
<td width="5" bgcolor="#336699"><img src="../images/shim.gif" width="2" height="2"></td>
|
||||
<td width="385" align="left" valign="top" bgcolor="#EBF0F5" class="basictext">De 5150 à 5720</td>
|
||||
|
||||
</tr>
|
||||
</table>
|
||||
<div align="center"><img src="../images/degrade580grey.jpg" width="580" height="12"><br>
|
||||
<br>
|
||||
<br>
|
||||
</div>
|
||||
</div>
|
||||
<table width="600" border="0" cellspacing="2" cellpadding="0">*/
|
||||
return $tabRet;
|
||||
}
|
||||
|
||||
function getDataEcoCoface($pageHtml) {
|
||||
|
||||
global $libelleErreur;
|
||||
|
||||
$tabRet=array();
|
||||
|
||||
// SIREN
|
||||
$pos=strpos($pageHtml, '<b><font class="nota">La forme juridique ou la date de création trop récente de l\'entreprise ne nous permettant pas d\'obtenir suffisamment d\'informations, nous vous offrons ce produit.</font></b>');
|
||||
if ($pos>0) {
|
||||
$tabRet['infoEco']='OUI';
|
||||
$tabRet['societeInactive']=@getTextInHtml($pageHtml, '<td bgcolor="#F3E5CC" class="tabligne" > Société inactive</td>', '<td bgcolor="#FFF3DE" class="tabval" > ', '</td>');
|
||||
$strCapital=@getTextInHtml($pageHtml, '<td bgcolor="#F3E5CC" class="tabligne" > Capital   (', '(', '</tr><tr>');
|
||||
$tabTmp=explode('</td>', $strCapital);
|
||||
$tabRet['capital_source']=str_replace(')', '', $tabTmp[0]);
|
||||
$tabTmp=explode(' ', $tabTmp[1]);
|
||||
$tabRet['capital_montant']=str_replace(chr(160), '', trim(strip_tags($tabTmp[0])));
|
||||
$tabRet['capital_devise']=trim(strip_tags($tabTmp[1]));
|
||||
$tabRet['dateCreation']=@getTextInHtml($pageHtml, '<td bgcolor="#F3E5CC" class="tabligne" > Date de création</td>', '<td bgcolor="#FFF3DE" class="tabval" > ', '</td>');
|
||||
$tabRet['formeJuridique']=@getTextInHtml($pageHtml, '<td bgcolor="#F3E5CC" class="tabligne" > Forme juridique</td>', '<td bgcolor="#FFF3DE" class="tabval" > ', '</td>');
|
||||
$tabRet['cotationBourse']=@getTextInHtml($pageHtml, '<td bgcolor="#F3E5CC" class="tabligne" > Cotation en bourse</td>', '<td bgcolor="#FFF3DE" class="tabval" > ', '</td>');
|
||||
$tabRet['effectifSociete']=@getTextInHtml($pageHtml, '<td bgcolor="#F3E5CC" class="tabligne" > Effectif société</td>', '<td bgcolor="#FFF3DE" class="tabval" > ', '</td>');
|
||||
$tabRet['activite']=@getTextInHtml($pageHtml, '<td bgcolor="#F3E5CC" class="tabligne" > Activité</td>', '<td bgcolor="#FFF3DE" class="tabval" > ', '</td>');
|
||||
|
||||
$tabRet['sigle']=@getTextInHtml($pageHtml, '<td bgcolor="#F3E5CC" class="tabligne" > Sigle</td>', '<td bgcolor="#FFF3DE" class="tabval" > ', '</td>');
|
||||
$tabRet['enseigne']=@getTextInHtml($pageHtml, '<td bgcolor="#F3E5CC" class="tabligne" > Enseigne</td>', '<td bgcolor="#FFF3DE" class="tabval" > ', '</td>');
|
||||
|
||||
// Dirigeants
|
||||
$strDir=@getTextInHtml($pageHtml, '<td class="tabtot">IDENTITE</td>', '<td> </td>', '</table>');
|
||||
$tabDir=explode('</tr>', $strDir);
|
||||
$nbDir=1;
|
||||
foreach ($tabDir as $key => $dir)
|
||||
{
|
||||
$tabTmp=explode('<td bgcolor="#FFF3DE" class="tabval" > ', $dir);
|
||||
$typeDir=trim(strip_tags($tabTmp[0]));
|
||||
$nomDir=trim(strip_tags($tabTmp[1]));
|
||||
if ($typeDir<>'' && $typeDir<>'Date de création' && $typeDir<>'Forme juridique' && $typeDir<>'Cotation en bourse'
|
||||
&& $typeDir<>'Effectif société' && $typeDir<>'Société inactive' && $typeDir<>'Activité'
|
||||
&& $typeDir<>'Sigle' && $typeDir<>'Enseigne'
|
||||
&& substr($typeDir, 0, 8) <>'Capital ' )
|
||||
{
|
||||
//$tabDir['Produits'].=$produit.'/';
|
||||
//$produit=str_replace(' ','_',$produit);
|
||||
$tabRet['Dirigeant'.$nbDir.'Type']=trim($typeDir);
|
||||
$tabTmp=explode(' ', $nomDir);
|
||||
$tabRet['Dirigeant'.$nbDir.'Genre']=trim($tabTmp[0]);
|
||||
$tabRet['Dirigeant'.$nbDir.'Prenom']=trim($tabTmp[1]);
|
||||
$tabRet['Dirigeant'.$nbDir.'Nom']=trim($tabTmp[2]);
|
||||
$nbDir++;
|
||||
}
|
||||
}
|
||||
$tabRet['NbDirigeants']=$nbDir-1;
|
||||
|
||||
// Liens Financiers
|
||||
$strTmp=@getTextInHtml($pageHtml, '<td class="tabtot">LIENS FINANCIERS</td>', '<td> </td>', '</table>');
|
||||
if (strpos($strTmp, 'Néant')>0)
|
||||
$tabRet['LiensFinanciers']='Néant';
|
||||
else
|
||||
$tabRet['LiensFinanciers']='Présence liens';
|
||||
|
||||
// ELEMENTS FINANCIERS
|
||||
$strTmp=@getTextInHtml($pageHtml, '<td class="tabtot">ELEMENTS FINANCIERS</td>', '<td> </td>', '</table>');
|
||||
if (strpos($strTmp, 'Néant')>0)
|
||||
$tabRet['ElementsFinanciers']='Néant';
|
||||
else
|
||||
$tabRet['ElementsFinanciers']='Présence El.Fi.';
|
||||
}
|
||||
else
|
||||
$tabRet['infoEco']='NON';
|
||||
|
||||
//echo $pageHtml;
|
||||
//print_r($tabRet);
|
||||
//die();
|
||||
|
||||
return $tabRet;
|
||||
}
|
||||
|
||||
|
||||
function getDataEntrepriseCoface($pageHtml) {
|
||||
|
||||
global $libelleErreur;
|
||||
|
||||
$tabRet=array();
|
||||
|
||||
// SIREN
|
||||
$tabRet['siren']=@getTextInHtml($pageHtml, 'portail/entreprise_identite/identite.asp?nsiren=', '?nsiren=', '&IMPRESSION=OUI');
|
||||
//$tabRet['siren']=@getTextInHtml($pageHtml, '<a href="http://www.coface.fr" target="_blank"> Qui sommes nous </a>-<a href="javascript:;" onClick="MM_openBrWindow(\'../mod_cofacescrl/part_recherche.asp?nscrl=18452&metier=ALL&geo=ALL&idnav=168d25840396c5f38f4
|
||||
$tabRet['nscrl']=@getTextInHtml($pageHtml, 'Plan du site </a>-<a href="http://www.coface.fr" target="_blank"> Qui sommes nous </a>-<a href="javascript:;" onClick="MM_openBrWindow(\'../mod_cofacescrl/part_recherche.asp?nscrl=', '?nscrl=', '&metier=ALL&geo=ALL&idnav=');
|
||||
|
||||
// Raison Sociale, Adresse et lien vers Géoloc
|
||||
$strRS_Adr=@getTextInHtml($pageHtml, '<td WIDTH="40%" bgcolor="#F3E5CC" class="tabligne"> <b> Raison sociale<br>', '<td WIDTH="60%" bgcolor="#FFF3DE" class="tabval"><b>', '</b></td>');
|
||||
$tabRS_Adr=explode('<br>', $strRS_Adr);
|
||||
$tabRet['raisonSociale']=trim($tabRS_Adr[0]);
|
||||
$tabRS_Adr1=explode(' ', $tabRS_Adr[1]);
|
||||
$tabRet['AdresseLigne1']=trim($tabRS_Adr1[0]);
|
||||
$tabRet['AdresseLigne2']=trim($tabRS_Adr1[1]);
|
||||
$tabRS_Adr1=explode(' ', $tabRS_Adr[2]);
|
||||
$tabRet['codePostal']=trim($tabRS_Adr1[0]);
|
||||
$tabRet['ville']=trim($tabRS_Adr1[1]);
|
||||
$tabRet['UrlGeoLoc']=@getTextInHtml($pageHtml, '<td WIDTH="60%" bgcolor="#FFF3DE" class="tabval"><a href="javascript:;" onClick="MM_openBrWindow(\'', 'onClick="MM_openBrWindow(\'', '\',\'Planfax');
|
||||
|
||||
// Téléphone / Fax
|
||||
$strTelFax=@getTextInHtml($pageHtml, '<td bgcolor="#F3E5CC" class="tabligne"><b>Téléphone<br>', '<td bgcolor="#FFF3DE" class="tabval" valign="top">', '</td>');
|
||||
$tabTelFax=explode('<br>', $strTelFax);
|
||||
$tabRet['tel']=trim($tabTelFax[0]);
|
||||
$tabRet['fax']=trim($tabTelFax[1]);
|
||||
|
||||
// Adresse Internet / Email
|
||||
$strInet=@getTextInHtml($pageHtml, '<td bgcolor="#F3E5CC" class="tabligne"><b>Adresse internet <br>', '<td bgcolor="#FFF3DE" class="tabval"><a class="tabval" HREF="', '</a></td>');
|
||||
$tabInet=explode('<br>', $strInet);
|
||||
$tabRet['web']=trim( @getTextInHtml($tabInet[0], ' target="_new">', '>', '</a>') );
|
||||
$tabRet['mail']=trim( @getTextInHtml($tabInet[1], ' href="mailto:', ':', '">') );
|
||||
|
||||
// Bourse
|
||||
$strBourse=@getTextInHtml($pageHtml, '<td bgcolor="#F3E5CC" class="tabligne"> <b>'."\r\n".' Code Sicovam<br>', '<td bgcolor="#FFF3DE" class="tabval">', '</td>');
|
||||
$tabBourse=explode('<br>', $strBourse);
|
||||
$tabRet['bourse_isin']=trim($tabBourse[0]);
|
||||
$tabRet['bourse_marche']=trim($tabBourse[1]);
|
||||
$tabRet['bourse_ville']=trim($tabBourse[2]);
|
||||
|
||||
// Activité
|
||||
$tabRet['activite']=trim(str_replace(' ', ' ', @getTextInHtml($pageHtml, '<td WIDTH="40%" bgcolor="#F3E5CC" class="tabligne" valign="top"><b>Libellé code activité </b></td>', '<td WIDTH="60%" bgcolor="#FFF3DE" class="tabval">', '</td>')));
|
||||
|
||||
// Produits disponibles
|
||||
$strDispos=@getTextInHtml($pageHtml, '<table border="0" cellpadding="0" cellspacing="0" width="98%"><tr><td class="normal"><b>Produits disponibles</b></td></tr><tr><td bgcolor="#E1D0B6"><img src="../images/vide.gif" border="0" height="1"><br></td></tr><tr><td><img src="../images/vide.gif" border="0" height="5"><br></td></tr></table>', '<table border="0" cellpadding="5" cellspacing="0" width="100%">', '</table>');
|
||||
$tabDispos=explode('<td align="left" width="25%"', $strDispos);
|
||||
$tabRet['Produits']='';
|
||||
foreach ($tabDispos as $key => $produit)
|
||||
{
|
||||
$produit=trim(str_replace('>', '', str_replace('nowrap>', '', strip_tags($produit))));
|
||||
if ($produit<>'' && $produit<>' ') {
|
||||
$tabRet['Produits'].=$produit.'/';
|
||||
$produit=str_replace(' ','_',$produit);
|
||||
$tabRet['Produit_'.$produit]='Oui';
|
||||
}
|
||||
}
|
||||
// print_r($tabRet);
|
||||
// die();
|
||||
|
||||
return $tabRet;
|
||||
}
|
||||
|
||||
|
||||
function getTabListeBilans($pageHtml) {
|
||||
$tabUrl=array();
|
||||
$deb=$fin=0;
|
||||
while( is_int(($deb=strpos($pageHtml,'<a href="http://www.societe.com/cgi-bin/bilan?bil=',$fin))) ) {
|
||||
$deb=$deb+9;
|
||||
$fin = strpos($pageHtml,'</a>', $deb);
|
||||
$s_temp = substr($pageHtml, $deb, ($fin-$deb));
|
||||
//echo $s_temp."\r\n";
|
||||
$a_temp = explode('" class="basic">', $s_temp);
|
||||
$tabUrl[$a_temp[1]]=$a_temp[0];
|
||||
}
|
||||
return $tabUrl;
|
||||
}
|
||||
|
||||
function getTabListeGU($pageHtml) {
|
||||
$tabGU=array();
|
||||
$deb=$fin=0;
|
||||
/* <tr><td><img alt="" src="b.gi onMouseOver="javascript:mOvr(this);" onMouseOut="javascript:mOut(this);"><a class=txt9px href="javascript:ChoixGeo('CP_PDR_SUP_LOC_REQ')">Lancer la recherche dans toute la localité</td></tr>
|
||||
<tr><td><img src="b.gif" alt="" border=0></td><td align="left" onMouseOver="javascript:mOvr(this);" onMouseOut="javascript:mOut(this);"><a class=txt9px href="javascript:ChoixGeo('CP_INSCRIPTIONS_REQ')">Lancer la recherche sans l'adresse</td></tr>
|
||||
*/
|
||||
while( is_int(($deb=strpos($pageHtml,'<td onMouseOver="javascript:mOvr(this);" onMouseOut="javascript:mOut(this);"><a class="txt9px" href="javascript:ChoixGeo(\'',$fin))) ) {
|
||||
$deb=$deb+122;
|
||||
$fin = strpos($pageHtml,'</td></tr>', $deb);
|
||||
$s_temp = substr($pageHtml, $deb, ($fin-$deb));
|
||||
//echo $s_temp."\r\n";
|
||||
$a_temp = explode('\')">', $s_temp);
|
||||
$tabGU[$a_temp[1]]=$a_temp[0];
|
||||
}
|
||||
return $tabGU;
|
||||
}
|
||||
|
||||
function getTabListeNonTrouve($pageHtml) {
|
||||
$tabGU=array();
|
||||
$deb=$fin=0;
|
||||
/* onMouseOver="javascript:mOvr(this);" onMouseOut="javascript:mOut(this);"><a class=txt9px href="javascript:ChoixGeo('CP_PDR_SUP_LOC_REQ')">Lancer la recherche dans toute la localité</td></tr>
|
||||
onMouseOver="javascript:mOvr(this);" onMouseOut="javascript:mOut(this);"><a class=txt9px href="javascript:ChoixGeo('CP_INSCRIPTIONS_REQ')">Lancer la recherche sans l'adresse</td></tr>
|
||||
*/
|
||||
while( is_int(($deb=strpos($pageHtml,'onMouseOver="javascript:mOvr(this);" onMouseOut="javascript:mOut(this);"><a class=txt9px href="javascript:ChoixGeo(\'',$fin))) ) {
|
||||
$deb=$deb+116;
|
||||
$fin = strpos($pageHtml,'</td></tr>', $deb);
|
||||
$s_temp = substr($pageHtml, $deb, ($fin-$deb));
|
||||
//echo $s_temp."\r\n";
|
||||
$a_temp = explode('\')">', $s_temp);
|
||||
$tabGU[$a_temp[1]]=$a_temp[0];
|
||||
}
|
||||
return $tabGU;
|
||||
}
|
||||
/** Recherche un texte dans une page HTML
|
||||
**
|
||||
**/
|
||||
function getTextInHtml($pageHtml, $strToFind, $strDeb, $strEnd, $include_strDeb=false, $include_strEnd=false, $ltrim=true, $rtrim=true, &$fin, $nbOcc=1) {
|
||||
$tabRet=array();
|
||||
$deb=$nbOccTrouve=0;
|
||||
while( is_int(($deb=strpos($pageHtml,$strToFind,$fin))) ) {
|
||||
$deb++;
|
||||
$deb2 = strpos($pageHtml,$strDeb, $deb);
|
||||
$fin = strpos($pageHtml,$strEnd, $deb2);
|
||||
if (!$include_strDeb)
|
||||
$deb2+=strlen($strDeb);
|
||||
$s_temp = substr($pageHtml, $deb2, ($fin-$deb2));
|
||||
|
||||
if ($ltrim) $s_temp=ltrim($s_temp);
|
||||
if ($rtrim) $s_temp=rtrim($s_temp);
|
||||
|
||||
if ($nbOcc==1) return $s_temp;
|
||||
//echo $s_temp."\r\n";
|
||||
//$a_temp = explode('" class="basic">', $s_temp);
|
||||
$tabUrl[$nbOccTrouve]=$s_temp;
|
||||
$nbOccTrouve++;
|
||||
|
||||
if ($nbOcc==$nbOccTrouve) {
|
||||
// echo "j'ai trouvé le nb demandé, je sort\r\n";
|
||||
break;
|
||||
};
|
||||
}
|
||||
|
||||
return $tabUrl;
|
||||
/*<span class="mongrasvert">
|
||||
<li>Le type de voie a été modifié<br>
|
||||
<li>L'orthographe du mot directeur a été modifiée<br>
|
||||
<li>Le code postal a été forcé à partir du département et de la localité<br> </span>
|
||||
*/
|
||||
}
|
||||
?>
|
@ -1,89 +0,0 @@
|
||||
<?
|
||||
//include('fonctions.php');
|
||||
//include('insee.class.php');
|
||||
define('HOST_NORMAD', 'www.normad.fr');
|
||||
define('SITE_NORMAD', 'http://'. HOST_NORMAD .'/');
|
||||
|
||||
//$normad2=new Normad('SCI BRYGE', 'Kervegant', '', '', '', '29', 'SCAER');
|
||||
|
||||
class Normad {
|
||||
/** Normalise l'adresse postale donnée en paramètre. Seule la ligne 1 qui devrait comporter la Raison Sociale ou le nom de l'expéditeur reste inchangée !
|
||||
** @param $adrL1 Obligatoirement le Nom ou la Raison Sociale du destinataire
|
||||
** @param $adrL2 Normalisation = Appart.,Bâtiment...
|
||||
** @param $adrL3 Normalisation = Résidence,Cité...
|
||||
** @param $adrL4 Normalisation = Num./Bis/Type voie/Nom voie
|
||||
** @param $adrL5 Normalisation = BP,TSA,Lieu-dit...
|
||||
** @param $codPos Code Postal (ou département)
|
||||
** @param $ville Ville (orthographe correcte si possible si pas de CP)
|
||||
** @return array
|
||||
**/
|
||||
function Normad ($adrL1, $adrL2, $adrL3, $adrL4, $adrL5, $codPos, $ville) {
|
||||
$adrL1 =substr(trim($adrL1) , 0, 40);
|
||||
$adrL2 =substr(trim($adrL2) , 0, 40);
|
||||
$adrL3 =substr(trim($adrL3) , 0, 40);
|
||||
$adrL4 =substr(trim($adrL4) , 0, 40);
|
||||
$adrL5 =substr(trim($adrL5) , 0, 40);
|
||||
$codPos=substr(trim($codPos), 0, 5);
|
||||
$ville =substr(trim($ville) , 0, 33);
|
||||
$postData=array( 'ad1'=>$adrL2, //htmlentities($adrL2),
|
||||
'ad2'=>$adrL3, //htmlentities($adrL3),
|
||||
'ad3'=>$adrL4, //htmlentities($adrL4),
|
||||
'ad4'=>$adrL5, //htmlentities($adrL5),
|
||||
'cod'=>$codPos,
|
||||
'loc'=>htmlentities($ville),
|
||||
'hiddenField'=>'GEN',);
|
||||
$tabHtml=getUrl(SITE_NORMAD.'traiter_adresse.php', '', $postData, SITE_NORMAD.'validez.php', true, HOST_NORMAD);
|
||||
$page=$tabHtml['body'];
|
||||
$posInHtml=0;
|
||||
$tabRet=array();
|
||||
|
||||
$retour=trim(str_replace(chr(173), '', getTextInHtml($page, '<td colspan=2><font face="Arial" size="2" color="#3F5A80"><b>', '<b>', '</b></font>', false, true, true, true, $posInHtml)));
|
||||
$retour=explode('[*', $retour);
|
||||
$tabRet['retour_code']=str_replace(']','',$retour[1]);
|
||||
$tabRet['retour_libelle']=trim($retour[0]);
|
||||
$tabRet['retour_messages']=getTextInHtml($page, '<li>', 'i>', '<br>', false, false, true, true, $posInHtml, 0);
|
||||
|
||||
// Récupération des Lignes d'adresse
|
||||
$tabRet['ligne1']=$adrL1;
|
||||
$tabRet['ligne2']=getTextInHtml($page, '<td class="gris2"><span class=grasnoir>Adresse en sortie :</span>', '<td class=gras nowrap>', '</td>', false, false, true, true, $posInHtml);
|
||||
$tabRet['ligne3']=getTextInHtml($page, '<td class=pet align=right nowrap> Volet 2 : </td>', '<td class=gras nowrap>', '</td>', false, false, true, true, $posInHtml);
|
||||
$tabRet['ligne4']=getTextInHtml($page, '<td class=pet align=right nowrap> Volet ', '<td class=gras nowrap>', '</td>', false, false, true, true, $posInHtml);
|
||||
$tabRet['ligne5']=getTextInHtml($page, '<td class=pet align=right nowrap> Volet 4 : </td>', '<td class=gras nowrap>', '</td>', false, false, true, true, $posInHtml);
|
||||
$tabRet['CP']=getTextInHtml($page, '<td class=pet align=right nowrap> CP : </td>', '<td class=gras nowrap>', '</td>', false, false, true, true, $posInHtml);
|
||||
$tabRet['ville']=getTextInHtml($page, '<td class=pet align=right nowrap> Localité : </td>', '<td class=gras nowrap>', '</td>', false, false, true, true, $posInHtml);
|
||||
$tabRet['ligne6']=$tabRet['CP'] .' '. $tabRet['ville'];
|
||||
|
||||
// Découpage de la rue
|
||||
$tabRet['voie_num']=getTextInHtml($page, '<span class=pet>Numéro ', '<span class=gras>', '</span><br>', false, false, true, true, $posInHtml);
|
||||
$tabRet['voie_btq']=getTextInHtml($page, '<span class=pet>Bis/Ter/Quater/...', '<span class=gras>', '</span><br>', false, false, true, true, $posInHtml);
|
||||
$tabRet['voie_type']=getTextInHtml($page, '<span class=pet>Type', '<span class=gras>', '</span><br>', false, false, true, true, $posInHtml);
|
||||
$tabRet['voie_denom']=getTextInHtml($page, '<span class=pet>Dénomination', '<span class=gras>', '</span><br>', false, false, true, true, $posInHtml);
|
||||
$tabRet['voie_motDir']=getTextInHtml($page, 'directeur :</span> ', '<span class=gras>', '</span><br>', false, false, true, true, $posInHtml);
|
||||
$tabRet['voie_matric']=getTextInHtml($page, '<span class=pet>Matricule voie :</span>', '</span>', '<br>', false, true, true, true, $posInHtml);
|
||||
$tabRet['code_insee_commune']=getTextInHtml($page, '<span class=pet>Code INSEE commune :</span>', '</span>', '<br>', false, true, true, true, $posInHtml);
|
||||
|
||||
print_r($tabRet);
|
||||
//echo "$voie_num\r\n$voie_btq\r\n$voie_type\r\n$voie_denom\r\n$voie_motDir\r\n$voie_matric\r\n$code_insee_commune\r\n";
|
||||
}
|
||||
|
||||
/*
|
||||
<td class="gris2" valign=top><span class=grasnoir>Détails :</span><br>
|
||||
|
||||
00441644 <br>
|
||||
|
||||
28074 <br>
|
||||
<br>
|
||||
<br>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<hr size=1>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan=3><p class="gris2" align="justify"> </p>
|
||||
<p class="mongrasvert" align="right"> Référentiels
|
||||
d'avril 2006 </p>
|
||||
*/
|
||||
|
||||
} ?>
|
@ -1,170 +0,0 @@
|
||||
<?PHP
|
||||
|
||||
$this->tabNotation['A+']=array('Exceptionnel', 'A3++', 'Aaa' ,'AAA' ,'0.001');
|
||||
$this->tabNotation['A'] =array('Excellent', 'A3+', 'Aa1 Aa2 Aa3' ,'AA+ AA AA-' ,'0.01');
|
||||
$this->tabNotation['B+']=array('Très bon', '3++', 'A1' ,'A+' ,'0.02');
|
||||
$this->tabNotation['B'] =array('Bon', '3+', 'A2 A3' ,'A A-' ,'0.04');
|
||||
$this->tabNotation['C+']=array('Assez bon', '3', 'Baa1' ,'BBB+' ,'0.15');
|
||||
$this->tabNotation['C'] =array('Acceptable', '3', 'Baa2' ,'BBB' ,'0.30');
|
||||
$this->tabNotation['C-']=array('Moyen', '3', 'Baa3' ,'BBB-' ,'0.60');
|
||||
$this->tabNotation['D+']=array('Passable', '4+', 'Ba1' ,'BB+' ,'0.90');
|
||||
$this->tabNotation['D'] =array('Médiocre', '4', 'Ba2' ,'BB' ,'1.25');
|
||||
$this->tabNotation['D-']=array('Très médiocre', '4', 'Ba3' ,'BB-' ,'1.60');
|
||||
$this->tabNotation['E+']=array('Mauvais (sous surveillance)', '5', 'B1 B2 B3', 'B+ B B-', '5.00');
|
||||
$this->tabNotation['E'] =array('Très mauvais (sensible, sans incident)', '6', 'Caa', 'CCC', '14.00');
|
||||
$this->tabNotation['E-']=array('Très mauvais (sensible avec incidents)', '8', 'Ca C', 'CC C', '17.00');
|
||||
$this->tabNotation['F'] =array('En défaut, hors procédures judiciaires (douteux)', '8 9', 'D', 'D', 'Défaut');
|
||||
$this->tabNotation['Z'] =array('En défaut, avec procédures judiciaires ou contentieuses (douteux)', 'P', '', '', 'Défaut');
|
||||
|
||||
$this->tabLibActivite[0]='';
|
||||
$this->tabLibActivite[15]='Industries Alimentaires : Collecte Appro';
|
||||
$this->tabLibActivite[3]='Industries Alimentaires : Collecte et 1ère transformation';
|
||||
$this->tabLibActivite[5]='Industries Alimentaires : Eaux de vie et Champagne';
|
||||
$this->tabLibActivite[2]='Industries Alimentaires : Autres activités';
|
||||
$this->tabLibActivite[6]='Industries extractives / Production Distribution : Énergie Eau';
|
||||
$this->tabLibActivite[7]='Construction - BTP';
|
||||
$this->tabLibActivite[1]='Industries Manufacturières';
|
||||
$this->tabLibActivite[8]='Négoce';
|
||||
$this->tabLibActivite[4]='Commerce de Gros';
|
||||
$this->tabLibActivite[9]='Commerce Distribution';
|
||||
$this->tabLibActivite[10]='Grande Distribution';
|
||||
$this->tabLibActivite[12]='Transports';
|
||||
$this->tabLibActivite[13]='Media Technologie de l\'information';
|
||||
$this->tabLibActivite[14]='Services';
|
||||
$this->tabLibActivite[11]='Hôtellerie et Loisirs / Activités immobilières';
|
||||
$this->tabLibActivite[16]='Banques. Assurances. Activités financières';
|
||||
$this->tabLibActivite[17]='Agriculture. Sylviculture. Pêche. Aquaculture';
|
||||
|
||||
$this->tabActivite[15]=array('512A');
|
||||
$this->tabActivite[3]=array('151A','151C','152','153E','155','157','159G','159J','159N','159Q');
|
||||
$this->tabActivite[5]=array('159A','159F');
|
||||
$this->tabActivite[2]=array('151E','151F','153A','153C','153F','154','156','158','159B','159D','159L','159S','159T');
|
||||
$this->tabActivite[6]=array('11','10','12','13','14','401','402','403','410');
|
||||
$this->tabActivite[7]=array('451','452','453','454','455');
|
||||
$this->tabActivite[1]=array('251','252','241','242','243','245','246','247','261','262','263','264','265','266','267','268','244','297','300','311','312','313','314','315','316','321','322','323','17','18','19','20','21','271','272','273','274','275','281','282','283','284','285','286','287','291','292','293','294','295','296','341','342','343','353','351','352','354','355','223','331','332','333','334','335','361','362','363','364','365','366','231','232','233','222','371','372');
|
||||
$this->tabActivite[8]=array();
|
||||
$this->tabActivite[4]=array('511A','511N','511P','512C','512E','512G','512J','513','511C','515A','515C','511E','511G','511J','511L','511R','511T','511U','514','515E','515F','515H','515J','515L','515N','515Q','516','517');
|
||||
$this->tabActivite[9]=array('501','502','503','504','505','521A','521B','521C','521J','522','523','524A','524C','524E','524F','524H','524J','524L','524N','524R','524T','524U','524V','524W','524X','524Y','524Z','525','526');
|
||||
$this->tabActivite[10]=array('521D','521E','521F','521H','524P');
|
||||
$this->tabActivite[12]=array('621','622','623','611','612','602','603','631','632','634','634B','634C','634A','641');
|
||||
$this->tabActivite[13]=array('221','722','721','723','724','725','726','924','642','922','921');
|
||||
$this->tabActivite[14]=array('703','712E','711','712A','713','714','712C','741A','741C','741E','741G','742','743','741J','744','745','746','747','748','900','633','801','802','803','804','851','852','853','930','911','912','913','527','950');
|
||||
$this->tabActivite[11]=array('923','925','926','927','551','552','553','554','555','702');
|
||||
$this->tabActivite[16]=array('651','660','672','652E','652A','652C','652F','671');
|
||||
$this->tabActivite[17]=array('751','990','752','990','701');
|
||||
|
||||
$this->tabR[1][0]=array();
|
||||
$this->tabR[1][1]=array('0:15.5','15.5:21.7','21.7:25','25:29.1','29.1:33.4','33.4:37','37:40','40:42.6','42.6:44.9','44.9:100');
|
||||
$this->tabR[1][2]=array('0:18.7','18.7:22.8','22.8:25','25:27.7','27.7:30.6','30.6:33','33:35','35:36.7','36.7:38.3','38.3:100');
|
||||
$this->tabR[1][3]=array('0:18.7','18.7:22.8','22.8:25','25:27.7','27.7:30.6','30.6:33','33:35','35:36.7','36.7:38.3','38.3:100');
|
||||
$this->tabR[1][4]=array('0:8.7','8.7:12.8','12.8:15','15:17.7','17.7:20.6','20.6:23','23:25','25:26.7','26.7:28.3','28.3:100');
|
||||
$this->tabR[1][5]=array('0:18.7','18.7:22.8','22.8:25','25:27.7','27.7:30.6','30.6:33','33:35','35:36.7','36.7:38.3','38.3:100');
|
||||
$this->tabR[1][6]=array('0:20.5','20.5:26.7','26.7:30','30:34.1','34.1:38.4','38.4:42','42:45','45:47.6','47.6:49.9','49.9:100');
|
||||
$this->tabR[1][7]=array('0:13.7','13.7:17.8','17.8:20','20:22.7','22.7:25.6','25.6:28','28:30','30:31.7','31.7:33.3','33.3:100');
|
||||
$this->tabR[1][8]=array('0:3.7','3.7:7.8','7.8:10','10:12.7','12.7:15.6','15.6:18','18:20','20:21.7','21.7:23.3','23.3:100');
|
||||
$this->tabR[1][9]=array('0:13.7','13.7:17.8','17.8:20','20:22.7','22.7:25.6','25.6:28','28:30','30:31.7','31.7:33.3','33.3:100');
|
||||
$this->tabR[1][10]=array('0:5.7','5.7:9.8','9.8:12','12:14.7','14.7:17.6','17.6:20','20:22','22:23.7','23.7:25.3','25.3:100');
|
||||
$this->tabR[1][11]=array('0:18.7','18.7:22.8','22.8:25','25:27.7','27.7:30.6','30.6:33','33:35','35:36.7','36.7:38.3','38.3:100');
|
||||
$this->tabR[1][12]=array('0:13.7','13.7:17.8','17.8:20','20:22.7','22.7:25.6','25.6:28','28:30','30:31.7','31.7:33.3','33.3:100');
|
||||
$this->tabR[1][13]=array('0:23.7','23.7:27.8','27.8:30','30:32.7','32.7:35.6','35.6:38','38:40','40:41.7','41.7:43.3','43.3:100');
|
||||
$this->tabR[1][14]=array('0:18.7','18.7:22.8','22.8:25','25:27.7','27.7:30.6','30.6:33','33:35','35:36.7','36.7:38.3','38.3:100');
|
||||
$this->tabR[1][15]=array('0:15.5','15.5:21.7','21.7:25','25:29.1','29.1:33.4','33.4:37','37:40','40:42.6','42.6:44.9','44.9:100');
|
||||
$this->tabR[1][16]=array('0:6.8','6.8:8.9','8.9:10','10:11.4','11.4:12.8','12.8:14','14:15','15:15.9','15.9:16.6','16.6:100');
|
||||
$this->tabR[1][17]=array('0:18.7','18.7:22.8','22.8:25','25:27.7','27.7:30.6','30.6:33','33:35','35:36.7','36.7:38.3','38.3:100');
|
||||
|
||||
$this->tabR[2][0]=array();
|
||||
$this->tabR[2][1]=array('1.8:','1.6:1.8','1.5:1.6','1.4:1,5','1.2:1.4','1.0:1.2','0.9:1.0','0.8:0,9','0.7:0,8','0:0.7');
|
||||
$this->tabR[2][2]=array('2.2:','1.9:2.2','1.8:1.9','1.6:1.8','1.4:1.6','1.2:1.4','1.0:1.2','0.9:1.0','0.7:0.9','0:0.7');
|
||||
$this->tabR[2][3]=array('2.2:','1.9:2.2','1.8:1.9','1.6:1.8','1.4:1.6','1.2:1.4','1.0:1.2','0.9:1.0','0.7:0.9','0:0.7');
|
||||
$this->tabR[2][4]=array('3.0:','2.7:3.0','2.5:2.7','2.3:2.5','2.0:2.3','1.7:2.0','1.5:1.7','1.3:1.5','1.1:1.3','0:1.1');
|
||||
$this->tabR[2][5]=array('2.6:','2.4:2.6','2.2:2.4','2.0:2.2','1.7:2.0','1.5:1.7','1.3:1.5','1.1:1.3','1.0:1.1','0:1');
|
||||
$this->tabR[2][6]=array('1.7:','1.6:1.7','1.5:1.6','1.4:1.5','1.2:1.4','1.1:1.2','1.0:1.1','0.9:1.0','0.8:0.9','0:0.8');
|
||||
$this->tabR[2][7]=array('1.5:','1.4:1.5','1.3:1.4','1.1:1.3','1.0:1.2','0.9:1.0','0.8:0.9','0.7:0.8','0.6:0.7','0:0.6');
|
||||
$this->tabR[2][8]=array('10.1:','8.8:10.1','8:8.8','7:8','5.8:7','4.8:5.8','4:4.8','3.3:4','2.8:3.3','0:2.8');
|
||||
$this->tabR[2][9]=array('3:','2.7:3','2.5:2.7','2.3:2.5','2:2.3','1.7:2','1.5:1.7','1.3:1.5','1.1:1.3','0:1.1');
|
||||
$this->tabR[2][10]=array('3.8:','3.3:3.8','3.0:3.3','2.6:3.0','2.2:2.6','1.8:2.2','1.5:1.8','1.2:1.5','1.0:1.2','0:1');
|
||||
$this->tabR[2][11]=array('2.3:','2.1:2.3','2:2.1','1.8:2','1.6:1.8','1.5:1.6','1.3:1.5','1.2:1.3','1:1.2','0:1');
|
||||
$this->tabR[2][12]=array('2.3:','2.1:2.3','2:2.1','1.8:2','1.6:1.8','1.5:1.6','1.3:1.5','1.2:1.3','1:1.2','0:1');
|
||||
$this->tabR[2][13]=array('1.8:','1.6:1.8','1.5:1.6','1.4:1.5','1.2:1.4','1:1.2','0.9:1','0.8:0.9','0.7:0.8','0:0.7');
|
||||
$this->tabR[2][14]=array('1.8:','1.6:1.8','1.5:1.6','1.4:1.5','1.2:1.4','1:1.2','0.9:1','0.8:0.9','0.7:0.8','0:0.7');
|
||||
$this->tabR[2][15]=array('2.2:','1.9:2.2','1.7:1.9','1.5:1.7','1.2:1.5','1.0:1.2','0.8:1.0','0.7:0.8','0.5:0.7','0:0.5');
|
||||
$this->tabR[2][16]=array('10.1:','8.8:10.1','8:8.8','7:8','5.8:7','4.8:5.8','4:4.8','3.3:4','2.8:3.3','0:2.8');
|
||||
$this->tabR[2][17]=array('2.2:','1.9:2.2','1.8:1.9','1.6:1.8','1.4:1.6','1.2:1.4','1:1.2','0.9:1','0.7:0.9','0:0.7');
|
||||
|
||||
$this->tabR[3][0]=array();
|
||||
$this->tabR[3][1]=array('4.4:','4:4.4','3.8:4','3.5:3.8','3.1:3.5','2.8:3.1','2.5:2.8','2.2:2.5','2:2.2','0:2');
|
||||
$this->tabR[3][2]=array('5.2:','4.7:5.2','4.5:4.7','4.1:4.5','3.7:4.1','3.3:3.7','3:3.3','2.7:3','2.4:2.7','0:2.4');
|
||||
$this->tabR[3][3]=array('5.2:','4.7:5.2','4.5:4.7','4.1:4.5','3.7:4.1','3.3:3.7','3:3.3','2.7:3','2.4:2.7','0:2.4');
|
||||
$this->tabR[3][4]=array('5.2:','4.7:5.2','4.5:4.7','4.1:4.5','3.7:4.1','3.3:3.7','3:3.3','2.7:3','2.4:2.7','0:2.4');
|
||||
$this->tabR[3][5]=array('8.6:','7.9:8.6','7.5:7.9','6.9:7.5','6.2:6.9','5.6:6.2','5:5.6','4.5:5','4:4.5','0:4');
|
||||
$this->tabR[3][6]=array('4.4:','4:4.4','3.8:4','3.5:3.8','3.1:3.5','2.8:3.1','2.5:2.8','2.2:2.5','2:2.2','0:2');
|
||||
$this->tabR[3][7]=array('4.4:','4:4.4','3.8:4','3.5:3.8','3.1:3.5','2.8:3.1','2.5:2.8','2.2:2.5','2:2.2','0:2');
|
||||
$this->tabR[3][8]=array('10.9:','9.7:10.9','9:9.7','8:9','6.8:8','5.8:6.8','5:5.8','4.3:5','3.7:4.3','0:3.7');
|
||||
$this->tabR[3][9]=array('5.2:','4.7:5.2','4.5:4.7','4.1:4.5','3.7:4.1','3.3:3.7','3:3.3','2.7:3','2.4:2.7','0:2.4');
|
||||
$this->tabR[3][10]=array('5.2:','4.7:5.2','4.5:4.7','4.1:4.5','3.7:4.1','3.3:3.7','3:3.3','2.7:3','2.4:2.7','0:2.4');
|
||||
$this->tabR[3][11]=array('5.2:','4.7:5.2','4.5:4.7','4.1:4.5','3.7:4.1','3.3:3.7','3:3.3','2.7:3','2.4:2.7','0:2.4');
|
||||
$this->tabR[3][12]=array('5.9:','5.4:5.9','5:5.4','4.5:5','3.9:4.5','3.4:3.9','3:3.4','2.6:3','2.3:2.6','0:2.3');
|
||||
$this->tabR[3][13]=array('4.2:','3.8:4.2','3.5:3.8','3.1:3.5','2.7:3.1','2.3:2.7','2:2.3','1.7:2','1.5:1.7','0:1.5');
|
||||
$this->tabR[3][14]=array('4.2:','3.8:4.2','3.5:3.8','3.1:3.5','2.7:3.1','2.3:2.7','2:2.3','1.7:2','1.5:1.7','0:1.5');
|
||||
$this->tabR[3][15]=array('6.9:','6.3:6.9','6.0:6.3','5.5:6.0','5.0:5.5','4.5:5.0','4.0:4.5','3.6:4.0','3.2:3.6','0:3.2');
|
||||
$this->tabR[3][16]=array('10.9:','9.7:10.9','9:9.7','8:9','6.8:8','5.8:6.8','5:5.8','4.3:5','3.7:4.3','0:3.7');
|
||||
$this->tabR[3][17]=array('5.2:','4.7:5.2','4.5:4.7','4.1:4.5','3.7:4.1','3.3:3.7','3:3.3','2.7:3','2.4:2.7','0:2.4');
|
||||
|
||||
$this->tabR[4][0]=array();
|
||||
$this->tabR[4][1]=array('0:2','2:2.3','2.3:2.5','2.5:2.9','2.9:3.5','3.5:4.2','4.2:5','5:6','6:7.2','7.2:');
|
||||
$this->tabR[4][2]=array('0:2','2:2.3','2.3:2.5','2.5:2.9','2.9:3.5','3.5:4.2','4.2:5','5:6','6:7.2','7.2:');
|
||||
$this->tabR[4][3]=array('0:2','2:2.3','2.3:2.5','2.5:2.9','2.9:3.5','3.5:4.2','4.2:5','5:6','6:7.2','7.2:');
|
||||
$this->tabR[4][4]=array('0:2','2:2.3','2.3:2.5','2.5:2.9','2.9:3.5','3.5:4.2','4.2:5','5:6','6:7.2','7.2:');
|
||||
$this->tabR[4][5]=array('0:1.36','1.36:1.44','1.44:1.5','1.5:1.58','1.58:1.71','1.71:1.85','1.85:2','2:2.16','2.16:2.33','2.33:');
|
||||
$this->tabR[4][6]=array('0:2','2:2.3','2.3:2.5','2.5:2.9','2.9:3.5','3.5:4.2','4.2:5','5:6','6:7.2','7.2:');
|
||||
$this->tabR[4][7]=array('0:2','2:2.3','2.3:2.5','2.5:2.9','2.9:3.5','3.5:4.2','4.2:5','5:6','6:7.2','7.2:');
|
||||
$this->tabR[4][8]=array('0:1.1','1.1:1.2','1.2:1.3','1.3:1.4','1.4:1.6','1.6:1.8','1.8:2','2:2.2','2.2:2.5','2.5:');
|
||||
$this->tabR[4][9]=array('0:2','2:2.3','2.3:2.5','2.5:2.9','2.9:3.5','3.5:4.2','4.2:5','5:6','6:7.2','7.2:');
|
||||
$this->tabR[4][10]=array('0:2','2:2.3','2.3:2.5','2.5:2.9','2.9:3.5','3.5:4.2','4.2:5','5:6','6:7.2','7.2:');
|
||||
$this->tabR[4][11]=array('0:2','2:2.3','2.3:2.5','2.5:2.9','2.9:3.5','3.5:4.2','4.2:5','5:6','6:7.2','7.2:');
|
||||
$this->tabR[4][12]=array('0:2','2:2.3','2.3:2.5','2.5:2.9','2.9:3.5','3.5:4.2','4.2:5','5:6','6:7.2','7.2:');
|
||||
$this->tabR[4][13]=array('0:2.4','2.4:2.7','2.7:3','3:3.4','3.4:4.1','4.1:5','5:6','6:7.2','7.2:8.7','8.7:');
|
||||
$this->tabR[4][14]=array('0:2.4','2.4:2.7','2.7:3','3:3.4','3.4:4.1','4.1:5','5:6','6:7.2','7.2:8.7','8.7:');
|
||||
$this->tabR[4][15]=array('0:2.9','2.9:3.4','3.4:3.7','3.7:4.3','4.3:5.2','5.2:6.2','6.2:7.5','7.5:9.1','9.1:10.9','10.9:');
|
||||
$this->tabR[4][16]=array('0:1.1','1.1:1.2','1.2:1.3','1.3:1.4','1.4:1.6','1.6:1.8','1.8:2','2:2.2','2.2:2.5','2.5:');
|
||||
$this->tabR[4][17]=array('0:2','2:2.3','2.3:2.5','2.5:2.9','2.9:3.5','3.5:4.2','4.2:5','5:6','6:7.2','7.2:');
|
||||
|
||||
$this->tabR[5][0]=array();
|
||||
$this->tabR[5][1]=array('-99:-40','-40:-34','-34:-30','-30:-24','-24:-16','-16:-8','-8:0','0:8.1','8.1:16.1','16.1:');
|
||||
$this->tabR[5][2]=array('-99:-40','-40:-34','-34:-30','-30:-24','-24:-16','-16:-8','-8:0','0:8.1','8.1:16.1','16.1:');
|
||||
$this->tabR[5][3]=array('-99:-40','-40:-34','-34:-30','-30:-24','-24:-16','-16:-8','-8:0','0:8.1','8.1:16.1','16.1:');
|
||||
$this->tabR[5][4]=array('-99:-16.7','-16.7:-12.7','-12.7:-10','-10:-6','-6:-0.7','-0.7:4.7','4.7:10','10:15.3','15.3:20.7','20.7:');
|
||||
$this->tabR[5][5]=array('-999:-420','-420:-384','-384:-360','-360:-324','-324:-276','-276:-228','-228:-180','-180:-132','-132:-84','-84:');
|
||||
$this->tabR[5][6]=array('-99:-40','-40:-34','-34:-30','-30:-24','-24:-16','-16:-8','-8:0','0:8.1','8.1:16.1','16.1:');
|
||||
$this->tabR[5][7]=array('-99:-30','-30:-24','-24:-20','-20:-14','-14:-6','-6:2','2:10','10:18','18:26','26:');
|
||||
$this->tabR[5][8]=array('-99:-41.7','-41.7:-34.7','-34.7:-30','-30:-23','-23:-13.7','-13.7:-4.3','-4.3:5','5:14.3','14.3:23.7','23.7:');
|
||||
$this->tabR[5][9]=array('-99:-16.7','-16.7:-12.7','-12.7:-10','-10:-6','-6:-0.7','-0.7:4.7','4.7:10','10:15.3','15.3:20.7','20.7:');
|
||||
$this->tabR[5][10]=array('-99:-5','-5:-2','-2:0','0:3','3:7','7:11','11:15','15:19','19:23','23:');
|
||||
$this->tabR[5][11]=array('-99:-6.7','-6.7:-2.7','-2.7:0','0:4','4:9.3','9.3:14.7','14.7:20','20:25.3','25.3:30.7','30.7:');
|
||||
$this->tabR[5][12]=array('-99:-6.7','-6.7:-2.7','-2.7:0','0:4','4:9.3','9.3:14.7','14.7:20','20:25.3','25.3:30.7','30.7:');
|
||||
$this->tabR[5][13]=array('-99:-6.7','-6.7:-2.7','-2.7:0','0:4','4:9.3','9.3:14.7','14.7:20','20:25.3','25.3:30.7','30.7:');
|
||||
$this->tabR[5][14]=array('-99:-6.7','-6.7:-2.7','-2.7:0','0:4','4:9.3','9.3:14.7','14.7:20','20:25.3','25.3:30.7','30.7:');
|
||||
$this->tabR[5][15]=array('-99:-38.3','-38.3:-36.3','-36.3:-35.0','-35:-33','-33.0:-30','-30:-27.7','-27.7:-25.0','-25.0:-22.3','-22.3:-19.7','-19.7:');
|
||||
$this->tabR[5][16]=array('-99:-41.7','-41.7:-34.7','-34.7:-30','-30:-23','-23:-13.7','-13.7:-4.3','-4.3:5','5:14.3','14.3:23.7','23.7:');
|
||||
$this->tabR[5][17]=array(':-58.3','-58.3:53.3','-53.3:-50','-50:-45','-45:-38.3','-38.3:-31.7','-31.7:-25','-25:-18.3','-18.3:-11.7','-11.7:');
|
||||
|
||||
$this->tabR[6][0]=array();
|
||||
$this->tabR[6][1]=array('0:6','6:6.6','6.6:7','7:7.6','7.6:8.4','8.4:9.2','9.2:10','10:10.8','10.8:11.6','11.6:');
|
||||
$this->tabR[6][2]=array('0:6','6:6.6','6.6:7','7:7.6','7.6:8.4','8.4:9.2','9.2:10','10:10.8','10.8:11.6','11.6:');
|
||||
$this->tabR[6][3]=array('0:1.5','1.5:2.1','2.1:2.5','2.5:3.1','3.1:3.9','3.9:4.7','4.7:5.5','5.5:6.3','6.3:7.1','7.1:');
|
||||
$this->tabR[6][4]=array('0:1.8','1.8:2.2','2.2:2.5','2.5:2.9','2.9:3.4','3.4:4','4:4.5','4.5:5','5:5.6','5.6:');
|
||||
$this->tabR[6][5]=array('0:6.7','6.7:7.5','7.5:8','8:8.8','8.8:9.9','9.9:10.9','10.9:12','12:13.1','13.1:14.1','14.1:');
|
||||
$this->tabR[6][6]=array('0:7.7','7.7:8.5','8.5:9','9:9.8','9.8:10.9','10.9:11.9','11.9:13','13:14.1','14.1:15.1','15.1:');
|
||||
$this->tabR[6][7]=array('0:3','3:3.6','3.6:4','4:4.6','4.6:5.4','5.4:6.2','6.2:7','7:7.8','7.8:8.6','8.6:');
|
||||
$this->tabR[6][8]=array('0:1.3','1.3:1.7','1.7:2','2:2.4','2.4:2.9','2.9:3.5','3.5:4','4:4.5','4.5:5.1','5.1:');
|
||||
$this->tabR[6][9]=array('0:1.8','1.8:2.2','2.2:2.5','2.5:2.9','2.9:3.4','3.4:4','4:4.5','4.5:5','5:5.6','5.6:');
|
||||
$this->tabR[6][10]=array('0:1.3','1.3:1.7','1.7:2','2:2.4','2.4:2.9','2.9:3.5','3.5:4','4:4.5','4.5:5.1','5.1:');
|
||||
$this->tabR[6][11]=array('0:8.3','8.3:9.3','9.3:10','10:11','11:12.3','12.3:13.7','13.7:15','15:16.3','16.3:17.7','17.7:');
|
||||
$this->tabR[6][12]=array('0:4.7','4.7:5.5','5.5:6','6:6.8','6.8:7.9','7.9:8.9','8.9:10','10:11.1','11.1:12.1','12.1:');
|
||||
$this->tabR[6][13]=array('0:3','3:4.8','4.8:6','6:7.8','7.8:10.2','10.2:12.6','12.6:15','15:17.4','17.4:19.8','19.8:');
|
||||
$this->tabR[6][14]=array('0:3','3:4.8','4.8:6','6:7.8','7.8:10.2','10.2:12.6','12.6:15','15:17.4','17.4:19.8','19.8:');
|
||||
$this->tabR[6][15]=array('0:2','2:2.3','2.3:2.5','2.5:2.8','2.8:3.2','3.2:3.6','3.6:4.0','4.0:4.4','4.4:4.8','4.8:');
|
||||
$this->tabR[6][16]=array('0:1.7','1.7:1.9','1.9:2','2:2.2','2.2:2.5','2.5:2.7','2.7:3','3:3.3','3.3:3.5','3.5:');
|
||||
$this->tabR[6][17]=array('0:4.7','4.7:5.5','5.5:6','6:6.8','6.8:7.9','7.9:8.9','8.9:10','10:11.1','11.1:12.1','12.1:');
|
||||
|
||||
?>
|
@ -1,9 +0,0 @@
|
||||
<?
|
||||
class Rncs {
|
||||
|
||||
function Rncs () {}
|
||||
|
||||
|
||||
|
||||
}
|
||||
?>
|
@ -1,795 +0,0 @@
|
||||
<?php
|
||||
require_once 'framework/common/chiffres.php';
|
||||
require_once 'framework/common/dates.php';
|
||||
require_once 'Metier/bodacc/classMBodacc.php';
|
||||
require_once 'Metier/insee/classMInsee.php';
|
||||
require_once 'Metier/partenaires/classMRncs.php';
|
||||
require_once 'Metier/partenaires/classMBilans.php';
|
||||
require_once 'Metier/partenaires/classMBourse.php';
|
||||
require_once 'Metier/partenaires/classMLiens.php';
|
||||
require_once 'Metier/scores/classMFinancier.php';
|
||||
require_once 'Metier/scores/classMSolvabilite.php';
|
||||
require_once 'Metier/scores/classMScores.php';
|
||||
require_once 'Metier/partenaires/classMTva.php';
|
||||
require_once 'Metier/partenaires/classMMap.php';
|
||||
require_once 'Metier/partenaires/classMGreffes.php';
|
||||
require_once 'Metier/partenaires/classMPrivileges.php';
|
||||
require_once 'Metier/tmp/configMRatios.php';
|
||||
|
||||
require_once 'framework/mail/sendMail.php';
|
||||
|
||||
global $tabEvenSolib;
|
||||
global $tabEven2SO;
|
||||
global $tabEven2RO;
|
||||
|
||||
$tabEvenSolib=array(1=>'CR',
|
||||
11=>'CR',
|
||||
13=>'CR',
|
||||
14=>'CR',
|
||||
15=>'CR',
|
||||
16=>'CR',
|
||||
17=>'CR',
|
||||
18=>'CR',
|
||||
19=>'CR',
|
||||
2=>'VT',
|
||||
21=>'VT',
|
||||
22=>'VT',
|
||||
24=>'VT',
|
||||
25=>'VT',
|
||||
3=>'CE',
|
||||
31=>'ME',
|
||||
32=>'ME',
|
||||
33=>'ME',
|
||||
34=>'ME',
|
||||
35=>'Rec',
|
||||
36=>'MAF',
|
||||
37=>'LG',
|
||||
38=>'LG',
|
||||
39=>'MD',
|
||||
4=>'RD',
|
||||
41=>'DIS',
|
||||
42=>'FLG',
|
||||
51=>'RJ',
|
||||
52=>'RJ',
|
||||
53=>'RA',
|
||||
56=>'PIE',
|
||||
57=>'SAUVJ',
|
||||
58=>'SAUVP',
|
||||
59=>'RR',
|
||||
6=>'R&L',
|
||||
61=>'LB',
|
||||
62=>'LJ',
|
||||
63=>'FP',
|
||||
64=>'INT',
|
||||
65=>'LQ',
|
||||
69=>'RL',
|
||||
7=>'Suite',
|
||||
71=>'SRJ',
|
||||
72=>'SRLJ',
|
||||
73=>'SP',
|
||||
74=>'AP',
|
||||
75=>'MP',
|
||||
76=>'EP',
|
||||
77=>'PRO',
|
||||
78=>'DC',
|
||||
79=>'CIA',
|
||||
8=>'INFR',
|
||||
91=>'DC',
|
||||
92=>'CP',
|
||||
);
|
||||
|
||||
$tabEven2SO=array( // PROCOL
|
||||
1010=>92, // Déclaration de cessation de paiement
|
||||
1050=>7, // Homologation de la conciliation
|
||||
1055=>7, // Résolution de la conciliation
|
||||
1100=>57, // Jugement de sauvegarde
|
||||
1101=>58, // Plan de sauvegarde
|
||||
1200=>52, // Redressement Judiciaire
|
||||
1201=>52, // Conversion sauvegarde en Redressement Judiciaire
|
||||
1202=>75, // Renouv. Periode Observation
|
||||
1203=>78, // Avis de dépot de l'état de collocation
|
||||
1204=>78, // Dépôt des créances
|
||||
1205=>78,
|
||||
1206=>78,
|
||||
1207=>53, // Règlemement amiable
|
||||
1208=>78,
|
||||
1209=>51, // Règlement Judiciaire
|
||||
1210=>77, // Production
|
||||
1211=>52, // Redressement Judiciaire par extension au(x) gérant(s)
|
||||
1212=>69, // Rectif ou Annul.LJ
|
||||
1214=>78, // Avis de dépôt de l'état des créances (Loi de 1985)
|
||||
1215=>7, // Jugement de désignation des organes de la procédure
|
||||
1216=>78, // Autre avis de dépôt
|
||||
1300=>62, // Conversion Redressement Judiciaire en Liquidation
|
||||
1301=>62, // Ouverture Liquidation Judiciaire
|
||||
1302=>66, // Ouverture Liquidation Judiciaire Simplifiée
|
||||
1303=>62, // Ouverture Liquidation Judiciaire sur résolution
|
||||
1304=>62, // Réouverture Liquidation Judiciaire
|
||||
1305=>62, // Liquidation Judiciaire
|
||||
1306=>66, // Liquidation Judiciaire simplifiée
|
||||
1307=>62, // Conversion sauvegarde en Liquidation Judiciaire
|
||||
1308=>62, // Fin du régime de Liquidation Judiciaire Simplifiée
|
||||
1309=>62, // Conversion Liquidation Judiciaire en Liquidation
|
||||
1310=>56, // Procédure d'Insolvabilité Européenne
|
||||
1311=>62, // Liquidation Judiciaire par extension au(x) gérants
|
||||
1312=>62, // Liquidation Judiciaire avec continuation d'exploitation
|
||||
1313=>62, // Liquidation Judiciaire sans remise des accessoires
|
||||
1346=>7, // Procédure d'insolvabilité (Règlement 1346/2000 du Conseil Européen)
|
||||
1400=>7, // Nomination d'un administrateur judiciaire
|
||||
1401=>7, // Nomination d'un mandataire judiciaire
|
||||
1402=>7, // Nomination d'un représentant des créanciers
|
||||
1403=>7, // Nominnation/Remplacement de commissaire à l'exécution du plan
|
||||
1404=>7, // Prolongement de la mission du commissaire à l'exécution du plan
|
||||
1405=>7, // Nomination d'un juge commissaire
|
||||
1406=>7, // Changement de SYNDIC
|
||||
1407=>75, // Modif. de Plan
|
||||
1408=>75, // Modification du plan de cession
|
||||
1409=>75, // Modif. de de continuation
|
||||
1410=>75, // Suite de jugement/règlement/liquidation
|
||||
1411=>75, // Arrêt du plan de cession
|
||||
1412=>75, // Arrêt du plan de cession partielle
|
||||
1413=>75, // Arrêt du plan de continuation
|
||||
1414=>75, // Arrêt du plan de redressement
|
||||
1415=>75, // Prolongement du plan cession
|
||||
1416=>75, // Jugement constatant la bonne exécution du plan
|
||||
1417=>62, // Jugement d'extension de liquidation judiciaire
|
||||
1418=>52, // Jugement d'extension d'une procédure de redressement judiciaire
|
||||
1419=>57, // Jugement d'extension d'une procédure de sauvegarde
|
||||
1420=>7, // Nomination d'un liquidateur judiciaire
|
||||
1421=>7, // Jugement prorogeant le plan de redressement
|
||||
1425=>7, // Plan de cession avec location gérance
|
||||
1430=>7, // Jugement autorisant la poursuite d'activité
|
||||
1431=>7, // Jugement de cessation partielle d'activité
|
||||
1435=>7, // Suspension de l'exécution provisoire
|
||||
1436=>7, // Suspension provisoire des poursuites
|
||||
1440=>7, // Jugement accordant un délai pour déposer la liste des créances
|
||||
1445=>7, // Concordat
|
||||
1450=>92, //Cessation paiement
|
||||
1455=>7, // Jugement arrêtant le plan d'apurement du passif
|
||||
1460=>7, // Homologation du plan
|
||||
1470=>7, // Fin de mission d'administrateur judiciaire
|
||||
1480=>7, // Jugement ordonnant la jonction des procédures
|
||||
1500=>79, // Clôture de la procédure
|
||||
1501=>79, // Clôture de la procédure après cession totale
|
||||
1502=>76, // Clôture de la procédure pour extinction du passif
|
||||
1503=>79, // Cloture insuf.Actif
|
||||
1504=>79, // Clôture sauvegarde pour absence de projet de plan
|
||||
1505=>74, // Appel de jugement
|
||||
1506=>59, // Rectif ou Annulation RJ
|
||||
1507=>74, // Appel de jugement
|
||||
1508=>7, // Extinction du plan de sauvegarde
|
||||
1509=>7, // Extinction du plan de redressement
|
||||
1510=>74, // Rejet du plan
|
||||
1511=>7, // Résolution du plan de cession
|
||||
1512=>7, // Résolution du plan de continuation
|
||||
1513=>7, // Résolution du plan de sauvegarde
|
||||
1515=>74, // Arrêt divers
|
||||
1517=>59, // Rectification d'une erreur matérielle
|
||||
1520=>7, // Ordonnance
|
||||
1525=>74, // Appel du ministère public
|
||||
1530=>7, // Jugement constatant l'impécuniosité de la procédure de liquidation
|
||||
1540=>7, // Ordonnance statuant sur les contestations du projet de répartition
|
||||
1541=>74, // Rétractation de prononcé de liquidation judiciaire sur tierce opposition
|
||||
1542=>74, // Rétractation de jugement d'ouverture d'une procédure de sauvegarde sur tierce opposition
|
||||
1543=>74, // Rétractation de jugement d'ouverture d'une procédure de redressement judiciaire sur tierce opposition
|
||||
1544=>74, // Rétractation de jugement d'ouverture d'une procédure de liquidation judiciaire sur tierce opposition
|
||||
1545=>74, // Rétractation de jugement d'ouverture sur tierce opposition
|
||||
1546=>74, // Autre rétractation sur tierce opposition
|
||||
1550=>7, // Suites de jugements
|
||||
1580=>7, // Jugement prononçant la continuation de l'activité par apurement du passif
|
||||
1600=>63, // Faillite personnelle
|
||||
1601=>64, // Interdiction de gérer
|
||||
1602=>7, // Jugement de réhabilitation
|
||||
1603=>61, // Liquidation de Biens
|
||||
1604=>8, // Banqueroute
|
||||
1605=>7, // Jugement autorisant la reprise des poursuites individuelles
|
||||
1610=>8, // Faillite personnelle (Loi de 1985)
|
||||
1611=>8, // Interdiction de gérer (Loi de 1985)
|
||||
1620=>7, // Jugement condamnant le dirigeant en comblement du passif
|
||||
1650=>8, // Rétablissement Personnel
|
||||
1700=>7, // Décision soumise à publicité
|
||||
1900=>8, // Interdiction temporaire d'exercice de la profession de CAC
|
||||
1901=>8, // Radiation de la liste des CAC
|
||||
1999=>7, // Autre procédure collective
|
||||
// MMD
|
||||
2000=>4, // Mention d'office
|
||||
2100=>39, // Chg.Capital/Cess.apport de parts
|
||||
2101=>39, // Chg.Capital/Cess.apport de parts
|
||||
2102=>39, // Chg.Capital/Cess.apport de parts
|
||||
2200=>4, // Cessation d'activité
|
||||
2201=>4, // Cessation d'activité temporaire
|
||||
2202=>41, // Dissolution
|
||||
2203=>41, // Dissolution de la société
|
||||
2204=>41, // Cessation d'activité avec dissolution
|
||||
2205=>4, // Fermeture du fonds
|
||||
2206=>39, // Mise en sommeil de la société
|
||||
2207=>39, // Suppression d'une branche d'activité
|
||||
2208=>39, // Suppression de l'établissement principal
|
||||
2209=>39, // Vente du fonds
|
||||
2210=>39, // Déclaration de dissolution par l'associé unique.
|
||||
2211=>39, // Clôture de la liquidation
|
||||
2212=>39, // Liquidation amiable
|
||||
2300=>39, // Changement d'Adresse
|
||||
2301=>39, // Modification de l'adresse du siège
|
||||
2302=>39, // Modification de l'enseigne
|
||||
2303=>39, // Modification de la date de clôture de l'exercice
|
||||
2304=>39, // Modification de la date de début d'activité
|
||||
2305=>39, // Modification de la dénomination
|
||||
2306=>39, // Modification de la durée de la société
|
||||
2307=>39, // Modification de la forme juridique
|
||||
2308=>39, // Modification du nom
|
||||
2309=>39, // Modification du nom commercial
|
||||
2310=>39, // Modification du pseudonyme
|
||||
2311=>39, // Modification sur l'exploitation
|
||||
2312=>39, // Modification(s) diverse(s)
|
||||
2313=>39, // Modification de l'activité
|
||||
2314=>39, // Poursuite de l'activité
|
||||
2315=>39, // Modification de l'administration
|
||||
2316=>39, // Mise en activité de la société
|
||||
2317=>39, // Modification du sigle
|
||||
2318=>39, // Modifications diverses
|
||||
2319=>39, // Poursuite de l'activité malgré la perte de plus de...
|
||||
2320=>39, // Reconsitution de l'actif net
|
||||
2321=>39, // Reconsitution de la moitié de l'actif net
|
||||
2350=>39, // Déclaration des associés (loi du 1er février 2005)
|
||||
2401=>39, // Changement de régime matrimonial
|
||||
2402=>39, // Changement de régime matrimonial (divorce)
|
||||
2403=>39, // Changement de régime matrimonial (mariage)
|
||||
2404=>39, // Changement de régime matrimonial (veuvage)
|
||||
2405=>39, // Changement de régime matrimonial (contrat de maria...
|
||||
2406=>39, // Reprise du fonds par le conjoint
|
||||
2407=>39, // Mention du conjoint collaborateur
|
||||
2408=>39, // Radiation du conjoint collaborateur
|
||||
2500=>3, // Confirmation établissement principal ou secondaire
|
||||
2510=>39, // L'établissement secondaire devient principal
|
||||
2520=>39, // Extension de l'établissement principal
|
||||
2600=>39, // Décès
|
||||
2610=>39, // Décision de l'unique actionnaire
|
||||
2620=>39, // Transmission universelle du patrimoine
|
||||
2630=>39, // Donation/Partage
|
||||
2635=>39, // Cession de parts
|
||||
2639=>39, // Nantissement de parts sociales
|
||||
2640=>39, // Changement de domicile personnel
|
||||
2650=>39, // Changement de nationalité
|
||||
2660=>39, // Réalisation de l'apport partiel d'actif
|
||||
2661=>39, // Apport partiel
|
||||
2700=>39, // Fusion/Absorption (entitée absorbante)
|
||||
2701=>39, // Fusion/Absorption (Entitée absorbante. Entité abso...
|
||||
2702=>39, // Fusion/Absorption (Entitée absorbante. Entité abso...
|
||||
2703=>39, // Fusion/Absorption (Entitée absorbante. Entité abso...
|
||||
2710=>39, // Projet de fusion (entitée absorbante)
|
||||
2720=>39, // Fusion/Absorption (entitée absorbée)
|
||||
2721=>39, // Fusion/Absorption (entitée absorbée non identifiée...
|
||||
2725=>39, // Fusion/Absorption
|
||||
2726=>39, // Projet de Fusion/Absorption
|
||||
2730=>39, // Projet de fusion (entitée absorbée)
|
||||
2740=>39, // Scission
|
||||
2750=>39, // Société participation
|
||||
2800=>37, // Location gérance reçue
|
||||
2840=>38, // Location/Gérance
|
||||
2850=>38, // Location gérance donnée : Précédent propriétaire e...
|
||||
2851=>38, // Location gérance donnée : Précédent propriétaire
|
||||
2860=>38, // Location gérance donnée : Précédent exploitant
|
||||
2870=>38, // Location gérance donnée
|
||||
2875=>38, // Gérance/Mandat
|
||||
2880=>38, // Renouvellement de location gérance
|
||||
2881=>38, // Changement de location gérance
|
||||
2885=>42, // Fin de location gérance
|
||||
2890=>38, // Location gérance relative à une branche
|
||||
2891=>39, // Location gérance relative à un établissement
|
||||
2892=>39, // Location gérance relative à un fond
|
||||
2900=>32, // Transfert d'établissement
|
||||
2901=>32, // Transfert de siège
|
||||
2902=>32, // Transfert du fonds
|
||||
2903=>32, // Projet de transfert du siège
|
||||
2904=>32, // Transfert du siège à l'étranger
|
||||
2950=>32, // Création de fonds
|
||||
2980=>32, // Transfert entre tribunaux
|
||||
// DEPOTS DES COMPTES
|
||||
3100=>91,
|
||||
3200=>91,
|
||||
3300=>91,
|
||||
3999=>91,
|
||||
// CREATIONS
|
||||
4000=>1, // Création d'entreprise
|
||||
4050=>1, // Création d'entreprise sans activité
|
||||
4100=>1, // Création d'entreprise sans établissement
|
||||
4200=>17, // Création d'établissement
|
||||
4250=>17, // Création suite à transfert
|
||||
4300=>17, // Création suite à reprise d'activité
|
||||
4350=>1, // Création suite à fin de location-gérance
|
||||
4355=>1, // Création suite à prise en location-gérance
|
||||
4360=>1, // Reprise d'activité par suite de la résolution de v
|
||||
4400=>1, // Création suite à changement de FJ
|
||||
4410=>1, // Création suite à héritage ou donation
|
||||
4450=>1, // Création suite à reprise par le conjoint
|
||||
4500=>17, // Fonds acquis dans le cadre d'une PC
|
||||
4501=>17, // Fonds acquis par achat
|
||||
4502=>17, // Fonds acquis par apport
|
||||
4600=>1, // Immatriculation d'une société de droit européen
|
||||
4999=>1, // Création
|
||||
|
||||
// ventes !!!
|
||||
5500=>2, // Entreprise réalisant la vente
|
||||
5501=>2, // Entreprise réalisant la vente : Ancien propriétair... BODA ventes 12 0000-00-00 00:00:00
|
||||
5502=>2, // Entreprise réalisant la vente : Ancien propriétair... BODA ventes 12 0000-00-00 00:00:00
|
||||
5503=>2, // Entreprise réalisant la vente : Ancien propriétair... BODA ventes 12 0000-00-00 00:00:00
|
||||
5510=>2, // Entreprise réalisant la vente : Co-propriétaire BODA ventes 12 0000-00-00 00:00:00
|
||||
5600=>2, // Entreprise réalisant l'acquisition BODA ventes 12 0000-00-00 00:00:00
|
||||
5650=>2,
|
||||
5700=>2, // Entreprise réalisant l'acquisition BODA ventes 12 0000-00-00 00:00:00
|
||||
5999=>2,
|
||||
|
||||
// RADIATIONS
|
||||
6000=>4, //Radiation pour cause de clôture de la liquidation (amiable/simplifié/général)
|
||||
6001=>4, //Radiation pour cause de clôture de la liquidation amiable
|
||||
6002=>4, //Radiation pour cause de clôture de la liquidation judiciaire pour IA
|
||||
6003=>4, //Radiation pour cause de clôture de la liquidation judiciaire
|
||||
6004=>4, //Radiation pour cause de clôture de la liquidation judiciaire simplifié
|
||||
6005=>4, //Radiation pour clôture du plan de cession
|
||||
6100=>4, //Radiation pour cause de décès
|
||||
6200=>4, //Radiation pour cause de mention d'office
|
||||
6201=>4, //Radiation pour cause de cessation d'activité
|
||||
6300=>4, //Radiation pour cause de non-exercice
|
||||
6400=>4, //Radiation pour cause de transfert
|
||||
6500=>4, //Radiation pour cause de jugement de clôture du plan de cession
|
||||
6600=>4, //Radiation d'un établissement
|
||||
6700=>4, //Radiation
|
||||
);
|
||||
$tabEven2RO=array( 2305=>'a',
|
||||
2308=>'a', // Chg de dénomination(RS,Ens,Sigle)
|
||||
2309=>'a', // Modification du nom commercial BODB mmd 12 0000-00-00 00:00:00
|
||||
2310=>'a', // Modification du pseudonyme
|
||||
2300=>'b', // Changement d'Adresse
|
||||
2301=>'b',
|
||||
2900=>'b', // Transfert d'établissement
|
||||
2901=>'b', // Transfert de siège
|
||||
2902=>'b', // Transfert du fonds
|
||||
2903=>'b', // Projet de transfert du siège
|
||||
2904=>'b', // Transfert du siège à l'étranger
|
||||
2950=>'b', // Création de fonds
|
||||
2980=>'b', // Transfert entre tribunaux
|
||||
2101=>'c', // Chg.Capital/Cess.apport de parts
|
||||
2315=>'d', // Changement de Dirigeants
|
||||
2313=>'e', // Mod Act/obj.soc./Cess./Mise somm.
|
||||
2307=>'f', // Changement de Forme juridique
|
||||
2318=>'g', // Opération sur Participations
|
||||
2725=>'h', // Fusion Absorption
|
||||
2318=>'i', // Mod.garantie financière/Caution
|
||||
2401=>'j', // Changement de régime matrimonial
|
||||
2319=>'k', // Non dissolution anticipée
|
||||
2318=>'l', // Non dissolution anticipée
|
||||
2318=>'m', // Dissolution anticipée (ou non)
|
||||
2303=>'n', // Mod.date cloture exercice social
|
||||
5500=>'V', // Entreprise réalisant la vente
|
||||
5501=>'V', // Entreprise réalisant la vente : Ancien propriétair... BODA ventes 12 0000-00-00 00:00:00
|
||||
5502=>'V', // Entreprise réalisant la vente : Ancien propriétair... BODA ventes 12 0000-00-00 00:00:00
|
||||
5503=>'V', // Entreprise réalisant la vente : Ancien propriétair... BODA ventes 12 0000-00-00 00:00:00
|
||||
5510=>'V', // Entreprise réalisant la vente : Co-propriétaire BODA ventes 12 0000-00-00 00:00:00
|
||||
5600=>'V',
|
||||
5650=>'V',
|
||||
5700=>'A', // Entreprise réalisant l'acquisition BODA ventes 12 0000-00-00 00:00:00
|
||||
1411=>'F', // Arrêt du plan de cession
|
||||
1408=>'G', // Modification du plan de cession
|
||||
1409=>'N', // Modification du plan de continuation
|
||||
1414=>'M', // Arrêt du plan de redressement
|
||||
|
||||
);
|
||||
|
||||
|
||||
function exporte($txt, $lon, $sep='') {
|
||||
$txt=strtr(trim($txt),array('''=>"'",'&'=>'&', '²'=>'²', "\r"=>'', "\n"=>'', "\t"=>''));
|
||||
|
||||
if ($sep=='') return sprintf("%-".$lon.'.'.$lon."s", $txt);
|
||||
|
||||
return trim(sprintf("%-".$lon.'.'.$lon."s", $txt)).$sep;
|
||||
}
|
||||
|
||||
|
||||
function conversionSd2So2000($nomFichierIn, $numeroAbonneBil='000960030', $nomFichierOut='', $optionFicheId='S') {
|
||||
|
||||
$message='';
|
||||
$iDb=new WDB();
|
||||
$iBodacc=new MBodacc();
|
||||
$iInsee=new MInsee();
|
||||
$iRncs=new MRncs();
|
||||
|
||||
global $tabEvenSolib;
|
||||
global $tabEven2SO;
|
||||
global $tabEven2RO;
|
||||
|
||||
$tabLignes=file($nomFichierIn);
|
||||
//print_r($tabLignes);
|
||||
//die();
|
||||
|
||||
$ligne001=$ligne100=$ligne104=$ligne999=0;
|
||||
if ($nomFichierOut=='') $nomFichierOut=$nomFichierIn.'.bil';
|
||||
|
||||
$fp=fopen($nomFichierOut, 'w');
|
||||
$dateJ=date('Ymd');
|
||||
$ecrireLignePre=false;
|
||||
|
||||
/** Codes/Variables à gérer **/
|
||||
$depPar=0;
|
||||
$SOSTAE='';
|
||||
$typeFicheId='I'; // Fiche Identifiant
|
||||
$optExtInsee=$optScore=false;
|
||||
|
||||
/** Type de fiche Id **/
|
||||
if (strpos($optionFicheId, 'S')==true) $typeFicheId='S'; // Fiche Standard
|
||||
elseif (strpos($optionFicheId, 'C')==true) $typeFicheId='C'; // Fiche Complète
|
||||
if (strpos($optionFicheId, 'E')==true) $optExtInsee=true; // Option Extension INSEE
|
||||
if (strpos($optionFicheId, 'N')==true) $optScore=true; // Option Score
|
||||
|
||||
foreach ($tabLignes as $i=>$ligne) {
|
||||
$typeLigne=substr($ligne, 0, 3)*1;
|
||||
switch ($typeLigne) {
|
||||
case 1: // Ligne ignorée
|
||||
// Ecriture de l'entête
|
||||
$ligne001++;
|
||||
break;
|
||||
case 100: // Structure Bodacc
|
||||
case 999: // Fin
|
||||
$strTxt=wordwrap($txtAnn, 39, EOL);
|
||||
$tabTxt=explode(EOL, $strTxt);
|
||||
foreach($tabTxt as $j=>$txt) {
|
||||
$SOSEQ++;
|
||||
if($j%16==0) {
|
||||
// Type d'enregistrement 1=EntConf, 2=Rejet, 4=Multipropo, 5=Suivi MAJ Entrep, 7=Infos, 8=Envoi documen, 9=Annonce
|
||||
$typEnr=9;
|
||||
if ($j==0) $ligneTXT =initstr($SONABO, 9, '0', ALIGN_RIGHT); // Numéro d'abonné BIL ?
|
||||
else $ligneTXT.=EOL.initstr($SONABO, 9, '0', ALIGN_RIGHT); // Numéro d'abonné BIL ?
|
||||
$ligneTXT.=initstr($SONUME, 9, '0', ALIGN_RIGHT); // Numéro d'entreprise BIL ?
|
||||
$ligneTXT.=initstr($SONUS, 9, '0', ALIGN_RIGHT); // Numéro d'UFS BIL ?
|
||||
$ligneTXT.=initstr($nann, 9, '0', ALIGN_RIGHT); // Numéro d'annonce BIL ?
|
||||
$ligneTXT.=initstr($siren, 9, '0', ALIGN_RIGHT); // Siren
|
||||
$ligneTXT.=initstr($nic, 5, '0', ALIGN_RIGHT); // Nic
|
||||
$ligneTXT.=exporte('SE', 2); // Code produit BIL ? SE, DE, DI, SJ
|
||||
$ligneTXT.=initstr($SOSEQ, 5, '0', ALIGN_RIGHT); // Numéro dans la séquence
|
||||
$ligneTXT.=initstr($dateJ, 8, '0', ALIGN_RIGHT); // Numéro dans la séquence
|
||||
$ligneTXT.=exporte($typEnr, 1); // Type d'enregistrement 1=EntConf, 2=Rejet, 4=Multipropo, 5=Suivi MAJ Entrep, 7=Infos, 8=Envoi documen, 9=Annonce
|
||||
$ligneTXT.=exporte('TXT', 3); // Structure identité
|
||||
$ligneTXT.=exporte('A', 1); // Confirmation 'A'uto ou 'C' pour manuelle
|
||||
$ligneTXT.=exporte($ref, 30); // Réf. Client
|
||||
$ligneTXT.=exporte($SOORIG, 1); // 1:Insee actif, 2=Ufs, 3=Annonce, 4=Manuelle, 5=Asso, 7=RCS actif, 8=Insee cessa eco, 9=Insee/RCS radié
|
||||
$ligneTXT.=exporte($SOJAL, 3); // 001=Bodacc A, 200=Bodacc B, 300=Bodacc C
|
||||
$ligneTXT.=initstr($datePar, 8, '0', ALIGN_RIGHT); // Date de parution
|
||||
$ligneTXT.=initstr(0, 5, '0', ALIGN_RIGHT); // Page
|
||||
$ligneTXT.=exporte($codeEve, 2); //
|
||||
$ligneTXT.=initstr($depPar, 2, '0', ALIGN_RIGHT);
|
||||
$ligneTXT.=initstr($numAnn, 6, '0', ALIGN_RIGHT);
|
||||
$ligneTXT.=exporte($codeRol, 1); //
|
||||
$ligneTXT.=exporte('T', 1);
|
||||
}
|
||||
$ligneTXT.=exporte($txt, 40);
|
||||
}
|
||||
$codeEve=$codeRol='';
|
||||
$ligneOut=$ligneID.EOL.$ligneANN.EOL.$ligneTXT;
|
||||
if ($ligne100>1) $ecrireLignePre=true;
|
||||
if($typeLigne==999) {
|
||||
$ligne999++;
|
||||
break;
|
||||
}
|
||||
|
||||
$nann = trim(substr($ligne, 3 , 10 ))*1; // N° d'annonce
|
||||
$siren = substr($ligne, 13 , 9 ); // Siren de l'entreprise concernée par l'annonce
|
||||
$tabIdentite=@$iInsee->getIdentiteEntreprise($siren);
|
||||
$nic = trim(substr($ligne, 22, 5 ))*1; // Nic
|
||||
$ref = trim(substr($ligne, 71, 18 )); // Référence Client
|
||||
$numPar = substr($ligne, 27 , 3 ); // Numéro de parution du Bodacc dans l'année
|
||||
$bodacc = substr($ligne, 30 , 1 ); // Code Bodacc (A, B ou C) A, B ou C
|
||||
$datePar= substr($ligne, 31 , 8 )*1; // Date de parution du Bodacc Format AAAAMMJJ
|
||||
$numAnn = substr($ligne, 39 , 5 ); // Numéro de l'annonce dans le Bodacc
|
||||
$typeAnn= substr($ligne, 47 , 1 ); // Type d'annonce Bodacc I=Insertion (publication d'une annonce), A=Additif (ajout à une précédente annonce), (1) R=Rectificatif (correction d'une annonce), S=Suppression d'une annonce
|
||||
$corNumA= substr($ligne, 48 , 5 ); // Numéro de l'annonce corrigée Si annonce différent de Insertion
|
||||
$corDate= substr($ligne, 53 , 8 ); // Date du Bodacc de l'annonce corrigée Si annonce différent de Insertion. Format AAAAMMJJ
|
||||
$corPage= substr($ligne, 61 , 6 ); // Première page du Bodacc de l'annonce corrigée Si annonce différent de Insertion
|
||||
$corNumP= substr($ligne, 67 , 4 ); // Numéro parution du Bodacc dans l'année de l'annonce corrigée Si annonce différent de Insertion
|
||||
$numRC = trim(substr($ligne,95 , 9 )); // Numéro de RC (Registre du Commerce) de l'entreprise
|
||||
$rs = trim(substr($ligne,104, 150 )); // Raison sociale de l'entreprise
|
||||
$nomCom = trim(substr($ligne,254, 100 )); // Nom Commerciale
|
||||
$ens = trim(substr($ligne,354, 100 )); // Enseigne
|
||||
$fj = trim(substr($ligne,484, 4 ))*1; // FJ
|
||||
$fjLib = trim(substr($ligne,488, 90 )); // FJ libellé
|
||||
$capMnt = trim(substr($ligne,578, 15 )); // Capital
|
||||
$capDev = trim(substr($ligne,593, 3 )); // Capital Devise
|
||||
$adrNum = trim(substr($ligne,596, 4 )); //
|
||||
$adrBtq = trim(substr($ligne,600, 1 )); // FJ libellé
|
||||
$adrVoi = trim(substr($ligne,601, 5 )); // FJ libellé
|
||||
$adrLib = trim(substr($ligne,606, 50 )); // FJ libellé
|
||||
$adrL2 = trim(substr($ligne,656, 50 )); // FJ libellé
|
||||
$adrL3 = trim(substr($ligne,706, 40 )); // FJ libellé
|
||||
$adrCP = trim(substr($ligne,746, 5 ))*1; // FJ libellé
|
||||
$adrVil = trim(substr($ligne,751, 45 )); // FJ libellé
|
||||
if ($adrCP==0) {
|
||||
$adrNum = trim(substr($ligne,796, 4 )); // FJ libellé
|
||||
$adrBtq = trim(substr($ligne,800, 1 )); // FJ libellé
|
||||
$adrVoi = trim(substr($ligne,801, 5 )); // FJ libellé
|
||||
$adrLib = trim(substr($ligne,806, 50 )); // FJ libellé
|
||||
$adrL2 = trim(substr($ligne,856, 50 )); // FJ libellé
|
||||
$adrL3 = trim(substr($ligne,906, 40 )); // FJ libellé
|
||||
$adrCP = trim(substr($ligne,946, 5 ))*1; // FJ libellé
|
||||
$adrVil = trim(substr($ligne,951, 45 )); // FJ libellé
|
||||
}
|
||||
$even=array();
|
||||
$even[7]= substr($ligne, 996 , 4 )*1; // Code Evènement Bodacc n°1 Cf. Table EVEN
|
||||
$even[6]= substr($ligne, 1000, 4 )*1; // Code Evènement Bodacc n°2 Cf. Table EVEN
|
||||
$even[5]= substr($ligne, 1004, 4 )*1; // Code Evènement Bodacc n°3 Cf. Table EVEN
|
||||
$even[4]= substr($ligne, 1008, 4 )*1; // Code Evènement Bodacc n°4 Cf. Table EVEN
|
||||
$even[3]= substr($ligne, 1012, 4 )*1; // Code Evènement Bodacc n°5 Cf. Table EVEN
|
||||
$even[2]= substr($ligne, 1016, 4 )*1; // Code Evènement Bodacc n°6 Cf. Table EVEN
|
||||
$even[1]= substr($ligne, 1020, 4 )*1; // Code Evènement Bodacc n°7 Cf. Table EVEN
|
||||
$even[0]= substr($ligne, 1024, 4 )*1; // Code Evènement Bodacc n°8 Cf. Table EVEN
|
||||
$txtEven='';
|
||||
foreach ($even as $codeEven)
|
||||
if ($codeEven<>0) {
|
||||
if (@$codeEve=='') $codeEve=$tabEven2SO[$codeEven];
|
||||
if (@$codeRol=='') $codeRol=$tabEven2RO[$codeEven];
|
||||
$txtEven.=$iBodacc->getEvenement($codeEven).', ';
|
||||
$catEven=$iBodacc->getChapitreEvenement($codeEven);
|
||||
}
|
||||
else
|
||||
$txtEven.='';
|
||||
$txtEven=substr($txtEven,0,strlen($txtEven)-2);
|
||||
$dateCess= substr($ligne, 1136, 8 )*1; // Date de cessat° des paiements
|
||||
$dateJuge= substr($ligne, 1144, 8 )*1; // Date de jugement
|
||||
$dateEffet=substr($ligne, 1161, 8 )*1; // Date d'effet
|
||||
if ($dateEffet*1==0) $dateEffet=$dateJuge;
|
||||
|
||||
$vteMnt=trim(substr($ligne, 1169, 15 ))*1; // Montant de la vente
|
||||
$vteDev=substr($ligne, 1184, 3 ); // Devise de la vente
|
||||
|
||||
|
||||
if ($nic*1==0) $nic=$tabIdentite['Nic'];
|
||||
|
||||
$SONABO=$numeroAbonneBil;
|
||||
if ($tabIdentite['Actif']==1) $SOORIG=1;
|
||||
elseif (!isset($tabIdentite['Actif'])) $SOORIG=3;
|
||||
elseif ($tabIdentite['Actif']==0 && ($tabIdentite['EntActiveRCS']==1||$tabIdentite['EtabActifRCS']==1)) $SOORIG=7;
|
||||
elseif ($tabIdentite['Actif']==0 && $tabIdentite['EntActiveRCS']==0 && $tabIdentite['EtabActifRCS']==0) $SOORIG=9;
|
||||
else $SOORIG=8;
|
||||
|
||||
if ($tabIdentite['Civilite']==1) $SOTSEX='M';
|
||||
elseif ($tabIdentite['Civilite']==2) $SOTSEX='F';
|
||||
else $SOTSEX='';
|
||||
$SONUME=''.preg_replace('/^0+/','', $tabIdentite['Source']).$tabIdentite['SourceId'];
|
||||
$SONUS='000000000';
|
||||
$SOSEQ=1;
|
||||
if ($adrCP==0) {
|
||||
$adrNum = $tabIdentite['AdresseNum'];
|
||||
$adrBtq = $tabIdentite['AdresseBtq'];
|
||||
$adrVoi = $tabIdentite['AdresseVoie'];
|
||||
$adrLib = $tabIdentite['AdresseRue'];
|
||||
$adrL2 = $tabIdentite['Adresse2'];
|
||||
$adrL3 = '';
|
||||
$adrCP = $tabIdentite['CP'];
|
||||
$adrVil = $tabIdentite['Ville'];
|
||||
}
|
||||
$typEnr=1;
|
||||
$DBILS2 =initstr($SONABO, 9, '0', ALIGN_RIGHT); // Numéro d'abonné BIL ?
|
||||
$DBILS2.=initstr($SONUME, 9, '0', ALIGN_RIGHT); // Numéro d'entreprise BIL ?
|
||||
$DBILS2.=initstr($SONUS, 9, '0', ALIGN_RIGHT); // Numéro d'UFS BIL ?
|
||||
$DBILS2.=initstr($nann, 9, '0', ALIGN_RIGHT); // Numéro d'annonce BIL ?
|
||||
$DBILS2.=initstr($siren, 9, '0', ALIGN_RIGHT); // Siren
|
||||
$DBILS2.=initstr($nic, 5, '0', ALIGN_RIGHT); // Nic
|
||||
$DBILS2.=exporte('SE', 2); // Code produit BIL ? SE, DE, DI, SJ
|
||||
$DBILS2.=initstr($SOSEQ, 5, '0', ALIGN_RIGHT); // Numéro dans la séquence dans le groupe
|
||||
$DBILS2.=initstr($dateJ, 8, '0', ALIGN_RIGHT); // Date d'envoi de l'info
|
||||
$DBILS2.=exporte($typEnr, 1); // Type d'enregistrement 1=EntConf, 2=Rejet, 4=Multipropo, 5=Suivi MAJ Entrep, 7=Infos, 8=Envoi documen, 9=Annonce
|
||||
$DBILS2.=exporte('ID', 3); // Structure identité
|
||||
$DBILS2.=exporte('A', 1); // Confirmation 'A'uto ou 'C' pour manuelle
|
||||
$DBILS2.=exporte($ref, 30); // Réf. Client
|
||||
//($annonce['codePostalSiege'], 5, '0', ALIGN_RIGHT)
|
||||
$DBILS2.=exporte($SOORIG, 1); // 1:Insee actif, 2=Ufs, 3=Annonce, 4=Manuelle, 5=Asso, 7=RCS actif, 8=Insee cessa eco, 9=Insee/RCS radié
|
||||
$DBILS2.=exporte('', 1); // D=Siren douteux
|
||||
$DBILS2.=exporte('', 9); // Témoin de MAJ
|
||||
$DBILS2.=exporte($rs, 60); //
|
||||
$DBILS2.=exporte(substr($rs,60),30); //
|
||||
$DBILS2.=exporte($tabIdentite['Sigle'], 30); // Vide !
|
||||
$DBILS2.=exporte($ens, 60); //
|
||||
$DBILS2.=initstr($adrNum, 4, '0', ALIGN_RIGHT); //
|
||||
$DBILS2.=exporte($adrBtq, 1); //
|
||||
$DBILS2.=exporte(preg_replace('/ +/',' ',$adrVoi.' '.$adrLib), 33); //
|
||||
$DBILS2.=exporte($adrVil, 32); //
|
||||
$DBILS2.=initstr($adrCP, 5, '0', ALIGN_RIGHT); //
|
||||
$DBILS2.=exporte(preg_replace('/ +/',' ',$adrL2.' '.$adrL3), 30); //
|
||||
$DBILS2.=initstr($tabIdentite['DateCreaEn'], 8, '0', ALIGN_RIGHT); // Date créa ENT
|
||||
$DBILS2.=exporte($tabIdentite['Siege'], 1); // Statut de l'établissement
|
||||
$DBILS2.=initstr($tabIdentite['FJ'], 4, 0, ALIGN_RIGHT);
|
||||
$DBILS2.=exporte($SOTSEX, 1); // Sexe M/F
|
||||
|
||||
$DBILS2.=initstr($tabIdentite['NbEtab']*1, 4, 0, ALIGN_RIGHT);
|
||||
$DBILS2.=exporte($SOSTAE, 4); // NAF4 ENT
|
||||
$DBILS2.=exporte('', 4); // Famille ENT
|
||||
$DBILS2.=exporte($SOSTAE, 4); // NAF4 ETAB
|
||||
$DBILS2.=exporte('', 4); // Famille ETAB
|
||||
$DBILS2.=exporte('', 1); // Indicateur Procol
|
||||
$DBILS2.=exporte('', 2); // Code monnaie
|
||||
$DBILS2.=initstr(0, 13, '0', ALIGN_RIGHT); // Montant du capital
|
||||
$DBILS2.=exporte('', 7); // Effectif
|
||||
$DBILS2.=exporte('', 9); // Num RC
|
||||
$DBILS2.=initstr(strtr($tabIdentite['Tel'],array('.'=>'','+'=>'00',' '=>'','-'=>'','/'=>'')), 10, '0', ALIGN_RIGHT);
|
||||
$DBILS2.=initstr(strtr($tabIdentite['Fax'],array('.'=>'','+'=>'00',' '=>'','-'=>'','/'=>'')), 10, '0', ALIGN_RIGHT);
|
||||
//5630Z5630Z RUE 00000000 00000000 2901929019
|
||||
$DBILS2.=exporte($tabIdentite['Web'], 40);
|
||||
$DBILS2.=exporte('', 3); // Qualité du dirigeant
|
||||
$DBILS2.=exporte('', 60); // NOM, Prénom du dirigeant
|
||||
$DBILS2.=initstr(0, 8, '0', ALIGN_RIGHT); // Date Naiss Diri
|
||||
// $DBILS2.=exporte('', 79);
|
||||
$DBILS2.=exporte('', 35); // Lieu de Naissance
|
||||
if ($optScore) {
|
||||
$tabTmp=$iDb->select('scores_surveillance',
|
||||
'siren, actif, procol, indiScore, indiScore20, encours, indiScoreDate, dateBilan, indiScorePre, indiScore20Pre, encoursPre, indiScoreDatePre, sourceModif, nbModifs, dateUpdate',
|
||||
"siren=$siren AND indiScoreDate>0", false, MYSQL_ASSOC);
|
||||
if (@$tabTmp[0]['siren']*1==$siren) {
|
||||
echo "$siren, parution Annonce le $datePar, calcul le ".@$tabTmp[0]['dateUpdate'].EOL;
|
||||
$tabScore=$tabTmp[0];
|
||||
$note=$tabScore['indiScore20'];
|
||||
$encours=round($tabScore['encours']/1000);
|
||||
} else {
|
||||
echo "$siren, parution Annonce le $datePar, pas de calcul !".EOL;
|
||||
$tabScore=@calculIndiScore($siren, $nic, false, 0, false);
|
||||
$note=$tabScore['Indiscore20'];
|
||||
$encours=round($tabScore['encours']/1000);
|
||||
}
|
||||
$encoursDev='EUR';
|
||||
} else
|
||||
$note=$encours=$encoursDev='';
|
||||
$DBILS2.=initstr($note, 2, '0', ALIGN_RIGHT); //37 Note sur 20
|
||||
$DBILS2.=initstr($encours, 7, '0', ALIGN_RIGHT); //44 Encours KE KF
|
||||
$DBILS2.=exporte('', 1); //45 Code paiement
|
||||
$DBILS2.=exporte('', 1); //46 Code situfi
|
||||
$DBILS2.=exporte('', 1); //47 Code Avis
|
||||
$DBILS2.=exporte($encoursDev,3); //47 Encours de la devise
|
||||
$DBILS2.=exporte('', 6); // Code Sicovam
|
||||
$DBILS2.=exporte('', 2); // Type de marché RM, CT, SM, HC, MO, NM, ML, AL, MR
|
||||
$DBILS2.=exporte('', 12); // Code ISIN
|
||||
$DBILS2.=exporte('', 9); // Filler Bil anciennement sur 83, 32 puis 9
|
||||
$DBILS2.=exporte($tabIdentite['NafEnt'], 5);
|
||||
$DBILS2.=exporte($tabIdentite['NafEtab'], 5);//
|
||||
$DBILS2.=exporte('', 18); //60 Filler
|
||||
$DBILS2.=exporte('', 4); // Filler RUE ?
|
||||
$DBILS2.=exporte('', 5); // Nic source cible de l'étab
|
||||
$DBILS2.=initstr(0, 8, '0', ALIGN_RIGHT); // Date de MAJ du capital
|
||||
$DBILS2.=exporte('', 3); // Monnaie d'origine du capital
|
||||
$DBILS2.=exporte('', 3); // Monnaie de livraison du capital (fin de l'ancien filler)
|
||||
$DBILS2.=initstr(0, 8, '0', ALIGN_RIGHT); // Date de création de l'établissement
|
||||
$DBILS2.=exporte('', 1); // Origine création
|
||||
$DBILS2.=exporte('', 2); // Tr Eff Ent
|
||||
$DBILS2.=exporte('', 2); // Tr Eff Etab
|
||||
$DBILS2.=exporte('', 2); // NAP 40 Entrep
|
||||
$DBILS2.=exporte('', 2); // NAP 40 Etab
|
||||
$DBILS2.=exporte('', 5); // Act Artisanale Etab
|
||||
$DBILS2.=exporte('', 1); // Modalité activité entrep
|
||||
$DBILS2.=exporte('', 1); // Modalité activité etab
|
||||
$DBILS2.=exporte('', 2); // Code Région Entrep
|
||||
$DBILS2.=exporte('', 2); // Code Région Etab
|
||||
$DBILS2.=exporte($tabIdentite['Dept'], 2); // Département du siège
|
||||
$DBILS2.=exporte($tabIdentite['codeCommune'], 3); // Localité
|
||||
$DBILS2.=exporte($tabIdentite['Dept'], 2); // Département de l'étab
|
||||
$DBILS2.=exporte($tabIdentite['codeCommune'], 3); // Localité
|
||||
$DBILS2.=exporte('', 1); // Dept Outre Mer
|
||||
$DBILS2.=exporte('', 1); // Arrondissement
|
||||
$DBILS2.=exporte('', 1); // Canton Dom ?
|
||||
$DBILS2.=exporte('', 2); // Canton
|
||||
$DBILS2.=exporte('', 8); // Code Ilot
|
||||
$DBILS2.=exporte('', 2); // ZEMET
|
||||
$DBILS2.=exporte('', 2); // Tranche Comm Etab
|
||||
$DBILS2.=exporte('', 2); // Dept Unite urbaine
|
||||
$DBILS2.=exporte('', 1); // Taille UU
|
||||
$DBILS2.=exporte('', 2); // UU etab
|
||||
$DBILS2.=exporte('', 5); // Code rivoli
|
||||
$DBILS2.=exporte('', 2); // PPale région entrep
|
||||
$DBILS2.=exporte('', 1); // Code monoreg
|
||||
$DBILS2.=exporte('', 1); // Code monoact
|
||||
$DBILS2.=exporte('', 1); // Code tranche CA
|
||||
$DBILS2.=exporte('', 1); // Tranche part CA export
|
||||
$DBILS2.=exporte('', 1); // RECME
|
||||
$DBILS2.=exporte('', 1); // Ordinarité
|
||||
$DBILS2.=exporte('', 2); // Code nature étab
|
||||
$DBILS2.=exporte('', 2); // Sigularité étab
|
||||
|
||||
$ligneID=$DBILS2;
|
||||
$ligne100++;
|
||||
$cor='';
|
||||
if ($typeAnn<>'I')
|
||||
$cor=" - Annonce n°$corNumA $corNumP, page $corPage, du ".WDate::dateT('Ymd','d/M/Y',$corDate);
|
||||
switch($typeAnn) {
|
||||
case 'I': $cor='Insertion'.$cor; break;
|
||||
case 'A': $cor='Additif'.$cor; break;
|
||||
case 'R': $cor='Rectificatif'.$cor; break;
|
||||
case 'S': $cor='Suppression'.$cor; break;
|
||||
default: break;
|
||||
}
|
||||
$codeTri= substr($ligne, 89 , 6 ); // Code Tribunal Codification interne utilisée par le Bodacc
|
||||
$libTri=$iBodacc->getTribunalNom($codeTri);
|
||||
|
||||
$SOSEQ++;
|
||||
if ($bodacc=='A') $SOJAL='001';
|
||||
elseif ($bodacc=='B') $SOJAL='200';
|
||||
elseif ($bodacc=='C') $SOJAL='300';
|
||||
else $SOJAL='999';
|
||||
$DBILS2 =initstr($SONABO, 9, '0', ALIGN_RIGHT); // Numéro d'abonné BIL ?
|
||||
$DBILS2.=initstr($SONUME, 9, '0', ALIGN_RIGHT); // Numéro d'entreprise BIL ?
|
||||
$DBILS2.=initstr($SONUS, 9, '0', ALIGN_RIGHT); // Numéro d'UFS BIL ?
|
||||
$DBILS2.=initstr($nann, 9, '0', ALIGN_RIGHT); // Numéro d'annonce BIL ?
|
||||
$DBILS2.=initstr($siren, 9, '0', ALIGN_RIGHT); // Siren
|
||||
$DBILS2.=initstr($nic, 5, '0', ALIGN_RIGHT); // Nic
|
||||
$DBILS2.=exporte('SE', 2); // Code produit BIL ? SE, DE, DI, SJ
|
||||
$DBILS2.=initstr($SOSEQ, 5, '0', ALIGN_RIGHT); // Numéro dans la séquence
|
||||
$DBILS2.=initstr($dateJ, 8, '0', ALIGN_RIGHT); // Numéro dans la séquence
|
||||
$DBILS2.=exporte('9', 1); // Type d'enregistrement 1=EntConf, 2=Rejet, 4=Multipropo, 5=Suivi MAJ Entrep, 7=Infos, 8=Envoi documen, 9=Annonce
|
||||
$DBILS2.=exporte('ANN', 3); // Structure identité
|
||||
$DBILS2.=exporte('A', 1); // Confirmation 'A'uto ou 'C' pour manuelle
|
||||
$DBILS2.=exporte($ref, 30); // Réf. Client
|
||||
//($annonce['codePostalSiege'], 5, '0', ALIGN_RIGHT)
|
||||
$DBILS2.=exporte($SOORIG, 1); // 1:Insee actif, 2=Ufs, 3=Annonce, 4=Manuelle, 5=Asso, 7=RCS actif, 8=Insee cessa eco, 9=Insee/RCS radié
|
||||
$DBILS2.=exporte($SOJAL, 3); // 001=Bodacc A, 200=Bodacc B, 300=Bodacc C
|
||||
$DBILS2.=initstr($datePar, 8, '0', ALIGN_RIGHT); // Date de parution
|
||||
$DBILS2.=initstr(0, 5, '0', ALIGN_RIGHT); // Page
|
||||
if ($codeEve=='') {
|
||||
$message.="Siren : $siren, Bodacc $bodacc, code évènement non géré : '$codeEven'".EOL;
|
||||
/*$nann = trim(substr($ligne, 3 , 10 ))*1; // N° d'annonce
|
||||
$siren = substr($ligne, 13 , 9 ); // Siren de l'entreprise concernée par l'annonce
|
||||
$tabIdentite=@$iInsee->getIdentiteEntreprise($siren);
|
||||
$nic = trim(substr($ligne, 22, 5 ))*1; // Nic
|
||||
$ref = trim(substr($ligne, 71, 18 )); // Référence Client
|
||||
$numPar = substr($ligne, 27 , 3 ); // Numéro de parution du Bodacc dans l'année
|
||||
= substr($ligne, 30 , 1 ); // Code Bodacc (A, B ou C) A, B ou C
|
||||
$datePar= substr($ligne, 31 , 8 )*1; // Date de parution du Bodacc Format AAAAMMJJ
|
||||
$numAnn*/
|
||||
sendMail('infoslegales@scores-decisions.com', 'ylenaour@scores-decisions.com', "Surveillance Annonces Legales SOFID (ERREUR)", $message);
|
||||
return $message;
|
||||
}
|
||||
$DBILS2.=exporte($codeEve, 2); //
|
||||
$DBILS2.=initstr($depPar, 2, '0', ALIGN_RIGHT);
|
||||
$DBILS2.=initstr($numAnn, 6, '0', ALIGN_RIGHT);
|
||||
$DBILS2.=exporte($codeRol, 1); //
|
||||
$DBILS2.=exporte($tabEvenSolib[$codeEve], 5);
|
||||
$DBILS2.=exporte($codeTri, 6); //
|
||||
$DBILS2.=exporte($numPar, 3); //
|
||||
$DBILS2.=initstr($dateJuge, 8, '0', ALIGN_RIGHT); // Date de jugement
|
||||
$DBILS2.=initstr($dateEffet, 8, '0', ALIGN_RIGHT); // Date d'effet
|
||||
$DBILS2.=initstr($dateCess, 8, '0', ALIGN_RIGHT); // Date de cessat° des paiements
|
||||
$DBILS2.=exporte($vteDev, 2); // Devise de la vente
|
||||
$DBILS2.=initstr($vteMnt, 11, '0', ALIGN_RIGHT); // Montant de la vente
|
||||
$DBILS2.=exporte('', 33); // Particularité
|
||||
$DBILS2.=exporte('', 4); // Code rubrique du Bodacc A1xx
|
||||
$DBILS2.=exporte('', 6); // Code lib injecté
|
||||
|
||||
$tabJuge=$iRncs->getIntervenants($siren);
|
||||
foreach ($tabJuge as $iDepot=>$depot) {
|
||||
$DBILS2.=exporte($depot['admid'], 5); // Mot clé Nom
|
||||
$DBILS2.=exporte($depot['admtype'], 1); // Type officier ministeriel
|
||||
$DBILS2.=initstr($depot['admid'], 7, '0', ALIGN_RIGHT); // Code Bil
|
||||
$DBILS2.=exporte($depot['admnom'], 30); // Nom syndic
|
||||
$DBILS2.=initstr($depot['admadrNum'], 4, '0', ALIGN_RIGHT); // N° rue
|
||||
$DBILS2.=exporte($depot['admadrInd'], 1); // Bis
|
||||
$DBILS2.=exporte($depot['admadrType'], 3); // Type Voie
|
||||
$DBILS2.=exporte($depot['admadrVoie'], 33); // Lib Voie
|
||||
$DBILS2.=exporte($depot['admadr2'], 32); // Lieu
|
||||
$DBILS2.=exporte($depot['admadrCP'], 5); // CP
|
||||
$DBILS2.=exporte($depot['admadrVille'], 32); // Ville
|
||||
$DBILS2.=exporte('', 10); // Tel
|
||||
if ($iDepot==1) break;
|
||||
}
|
||||
|
||||
$ligneANN=$DBILS2;
|
||||
$txtAnn='';
|
||||
//if ($ligne100>1) $ecrireLignePre=true;
|
||||
break;
|
||||
case 104: // Annonce
|
||||
$ligne104++;
|
||||
$txtAnn=trim($txtAnn.' '.trim(substr($ligne, 89 , 1910))); // Texte Annonce
|
||||
break;
|
||||
default: // Ligne non gérée
|
||||
break;
|
||||
}
|
||||
if ($ecrireLignePre) {
|
||||
fwrite($fp, $ligneOut.EOL);
|
||||
$ecrireLignePre=false;
|
||||
}
|
||||
}
|
||||
fclose($fp);
|
||||
return true;
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user