Compare commits
37 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
22e92d676a | ||
|
ca628690ca | ||
|
67ecccb832 | ||
|
f7a07d0882 | ||
|
273f6c1976 | ||
|
1e2182d34e | ||
|
e5e0b7baa7 | ||
|
5214ba03d1 | ||
|
aebe1ddaca | ||
|
e1f5fe03bd | ||
|
9aca193415 | ||
|
3d565b7d96 | ||
|
645ce94332 | ||
|
92db1b7c0d | ||
|
7d5cb9bbdb | ||
|
0a57a8300b | ||
|
b2391e9cca | ||
|
874c7428b2 | ||
|
3b08476a4f | ||
|
1a538ed012 | ||
|
61a3878b5b | ||
|
81cbe98dfc | ||
|
75ff12b7b6 | ||
|
91417dbf5a | ||
|
076a59c5bf | ||
|
591958dee8 | ||
|
56da5829b7 | ||
|
99b461b292 | ||
|
9576cb16d6 | ||
|
03d7564a11 | ||
|
ed8e991677 | ||
|
397fb4ec63 | ||
|
52d0b4d577 | ||
|
202b37c801 | ||
|
996423d7ca | ||
|
52bf3a4d45 | ||
|
d431b01981 |
@ -27,7 +27,9 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
|
||||
'default' => __DIR__ . '/modules/default/controllers',
|
||||
'admin' => __DIR__ . '/modules/admin/controllers',
|
||||
'file' => __DIR__ . '/modules/file/controllers',
|
||||
));
|
||||
'achatclient' => __DIR__ . '/modules/achatclient/controllers',
|
||||
'compteclient' => __DIR__ . '/modules/compteclient/controllers',
|
||||
));
|
||||
|
||||
return $front;
|
||||
}
|
||||
|
437
application/modules/achatclient/controllers/IndexController.php
Normal file
437
application/modules/achatclient/controllers/IndexController.php
Normal file
@ -0,0 +1,437 @@
|
||||
<?php
|
||||
|
||||
class Achatclient_IndexController extends Zend_Controller_Action
|
||||
{
|
||||
protected $theme;
|
||||
|
||||
/**
|
||||
* Logger
|
||||
* @var \Monolog\Logger
|
||||
*/
|
||||
protected $logger;
|
||||
|
||||
protected $tranches=array(
|
||||
'1' => array(
|
||||
'200' => array('montant' => 2400,'montantht' => 2000, 'tva' => 400, ),
|
||||
'500' => array('montant' => 6000,'montantht' => 5000, 'tva' => 1000, ),
|
||||
'1000' => array('montant' => 12000,'montantht' => 10000, 'tva' => 2000, ),
|
||||
),
|
||||
'195' => array(
|
||||
'200' => array('montant' => 2400,'montantht' => 2000, 'tva' => 400, ),
|
||||
'500' => array('montant' => 6000,'montantht' => 5000, 'tva' => 1000, ),
|
||||
'1000' => array('montant' => 12000,'montantht' => 10000, 'tva' => 2000, ),
|
||||
),
|
||||
);
|
||||
|
||||
protected $maxcredit=2000;
|
||||
|
||||
protected $libdroits = 'portemonnaie';
|
||||
|
||||
public function init()
|
||||
{
|
||||
if (Zend_Registry::isRegistered('logger')) {
|
||||
$this->logger = Zend_Registry::get('logger');
|
||||
}
|
||||
$autoloader = Zend_Loader_Autoloader::getInstance();
|
||||
// --- Theme
|
||||
$this->theme = Zend_Registry::get('theme');
|
||||
$this->view->title='Votre compte crédits en ligne';
|
||||
require_once 'Scores/WsScores.php';
|
||||
}
|
||||
|
||||
/**
|
||||
* Page d'accueil et de redirection
|
||||
*/
|
||||
public function indexAction()
|
||||
{
|
||||
//Validation des droits
|
||||
$request = $this->getRequest();
|
||||
if(!$this->verifHttps()){
|
||||
$this->error('index','Connexion imposible');
|
||||
}
|
||||
$this->view->msg=$request->getParam('message');
|
||||
$user = new Scores_Utilisateur();
|
||||
$ok=$user->checkperm($this->libdroits);
|
||||
if(!$ok){
|
||||
$this->error('index','Fonction indisponible');
|
||||
}
|
||||
$ws = new Scores_Ws_Client('credit', '0.1');
|
||||
$infocredit = $ws->infoCredit();
|
||||
//var_dump($infocredit);die;
|
||||
try {
|
||||
} catch(Exception $e) {
|
||||
$this->error('index','Pas de crédit');
|
||||
}
|
||||
|
||||
if($infocredit===false){
|
||||
$this->error('index','Service indisponible');
|
||||
}
|
||||
if ($infocredit === false || empty($infocredit)) {
|
||||
$this->error('index','Accès au Service indisponible');
|
||||
}
|
||||
if(!isset($this->tranches[$user->getIdClient()])){
|
||||
$this->error('index','Fonction indisponible pour ce client');
|
||||
}
|
||||
$infos=array('user' => $user,'tranches' => $this->tranches[$user->getIdClient()]);
|
||||
//$infos['balance']=array('balance'=>0);
|
||||
if(!isset($infocredit->balance)){
|
||||
$infos['balance']['balance']=0;
|
||||
}else{
|
||||
foreach($infocredit->balance as $k => $v){
|
||||
$infos['balance'][$v->key]=$v->value;
|
||||
}
|
||||
}
|
||||
if(intval($infos['balance']['balance'])>$this->maxcredit){
|
||||
$this->view->msg='Vous détenez le plafond de crédits autorisé.';
|
||||
unset($infos['tranches']);
|
||||
}
|
||||
$infos['paid']=array();
|
||||
foreach($infocredit->paid as $no => $r){
|
||||
$infos['paid'][$no]=array();
|
||||
foreach($r as $o){foreach($o as $k => $v){
|
||||
$infos['paid'][$no][$v->key]=$v->value;
|
||||
}}
|
||||
}
|
||||
$infos['used']=array();
|
||||
foreach($infocredit->used as $no => $r){
|
||||
$infos['used'][$no]=array();
|
||||
foreach($r as $o){foreach($o as $k => $v){
|
||||
$infos['used'][$no][$v->key]=$v->value;
|
||||
}}
|
||||
}
|
||||
$infos['libelle']=array();
|
||||
foreach($infocredit->libelle as $no => $o){
|
||||
$infos['libelle'][$o->key]=$o->value;
|
||||
}
|
||||
$this->logger->info(print_r($user,1));
|
||||
$this->view->infos=$infos;
|
||||
//echo __LINE__;var_dump($this->view->infos);die;
|
||||
$this->view->submitValue='Commander';
|
||||
|
||||
}
|
||||
public function paiementAction()
|
||||
{
|
||||
//Validation
|
||||
$request = $this->getRequest();
|
||||
if(!$this->verifHttps()){
|
||||
$this->error('index','Connexion imposible');
|
||||
}
|
||||
$user = new Scores_Utilisateur();
|
||||
$ok=$user->checkperm($this->libdroits);
|
||||
if(!$ok){
|
||||
$this->error('paiement', __LINE__);
|
||||
}
|
||||
$nb_credit=$request->getParam('nb_credit');
|
||||
if(intval($nb_credit)==0){
|
||||
$this->error('paiement','Vous devez définir le nombre de crédits');
|
||||
}
|
||||
$idClient=$user->getIdClient();
|
||||
if(intval($idClient)==0){
|
||||
$this->error('paiement', 'Problème d\'identification du client');
|
||||
}
|
||||
if(!isset($this->tranches[$idClient]) || !isset($this->tranches[$idClient][$nb_credit])){
|
||||
$this->error('paiement', 'Pas de tarification pour ce client');
|
||||
}
|
||||
// Recuperation des infos societe
|
||||
$ws = new Scores_Ws_Client('credit', '0.1');
|
||||
$params = new stdClass();
|
||||
$params->id = 0;
|
||||
$infocredit = $ws->getfactinfosCredit($params);
|
||||
foreach($infocredit->result as $item){
|
||||
$infos[$item->key]=array();
|
||||
foreach($item->value->item as $obj){
|
||||
$infos[$item->key][$obj->key]=$obj->value;
|
||||
}
|
||||
}
|
||||
if(empty($infos['societe'])){
|
||||
$infos['commande']['nb_credit']=$nb_credit;
|
||||
if(intval($infos['commande']['siret'])==0){
|
||||
$this->view->message='Merci d\'entrer votre numéro de siret';
|
||||
|
||||
}else{
|
||||
$this->view->message='Votre numero de siret : '.$infos['commande']['siret'].' n\'a pas été trouvé';
|
||||
}
|
||||
$this->view->inlineScript()->appendFile($this->theme->pathScript.'/recherche.js', 'text/javascript');
|
||||
$this->view->infosfact=$infos['commande'];
|
||||
$this->view->pbparams=null;
|
||||
$this->view->info='siret';
|
||||
return;
|
||||
}
|
||||
//Calcul de la TVA
|
||||
// N° de TVA obligatoire pour la France sauf les dom
|
||||
if(strtoupper($infos['entrep']['Pays'])=="FRANCE" && empty($infos['entrep']['TvaNumero'])){
|
||||
if(substr($infos['entrep']['CP'],0,3)=='971' || substr($infos['entrep']['CP'],0,3)=='972' ||substr($infos['entrep']['CP'],0,3)=='974'){
|
||||
$tva=0.085;
|
||||
}else{
|
||||
$infos['commande']['nb_credit']=$nb_credit;
|
||||
$this->view->message='Merci d\'entrer votre numéro de TVA intracommunautaire';
|
||||
$this->view->inlineScript()->appendFile($this->theme->pathScript.'/recherche.js', 'text/javascript');
|
||||
$this->view->infosfact=$infos['commande'];
|
||||
$this->view->pbparams=null;
|
||||
$this->view->info='tva';
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
//Si pays France > TVA = 20,00 %
|
||||
$tva=0.2;
|
||||
//var_dump($infos['entrep']);die;
|
||||
if(!empty($infos['entrep']['Pays']) && strtoupper($infos['entrep']['Pays'])!="FRANCE"){
|
||||
//Si étranger > TVA = Export exonération 0 %
|
||||
$tva=0;
|
||||
//si le client renseigne son N° de TVA intracommunautaire appliquer la TVA à 0 Auto liquidation ,
|
||||
if(!empty($infos['entrep']['TvaNumero']) && substr($infos['entrep']['TvaNumero'],0,2!="FR")){
|
||||
$tva=0;
|
||||
}else{
|
||||
//si au contraire le N° de TVA intracommunautaire n’est pas renseigné il faut appliquer le taux normal de TVA actuellement 20.00 %
|
||||
$tva=0.2;
|
||||
}
|
||||
}
|
||||
//Si Guadeloupe (971), Martinique (972), La Réunion (974) > TVA = 8,50 %
|
||||
if(substr($infos['entrep']['CP'],0,3)=='971' || substr($infos['entrep']['CP'],0,3)=='972' ||substr($infos['entrep']['CP'],0,3)=='974'){
|
||||
$tva=0.085;
|
||||
}
|
||||
|
||||
//Calcul des montants
|
||||
$this->tranches[$idClient][$nb_credit]['tva']=$this->tranches[$idClient][$nb_credit]['montantht']*$tva;
|
||||
$this->tranches[$idClient][$nb_credit]['montant']=$this->tranches[$idClient][$nb_credit]['montantht']+$this->tranches[$idClient][$nb_credit]['tva'];
|
||||
|
||||
//Parametrage
|
||||
|
||||
$pbparam=array();
|
||||
$pbparams['cmdId']=implode('ww',array($user->identity->id,time()));
|
||||
$pbparams['email']=$user->identity->email;
|
||||
$pbparams['montant']=$this->tranches[$idClient][$nb_credit]['montant'];
|
||||
$pbparams['montantht']=$this->tranches[$idClient][$nb_credit]['montantht'];
|
||||
$pbparams['tva']=$this->tranches[$idClient][$nb_credit]['tva'];
|
||||
$pbparams['login']=$user->identity->username;
|
||||
$pbparams['nb_credit']=$nb_credit;
|
||||
$ligneCredit=array(
|
||||
'idUser' =>$user->identity->id,
|
||||
'idCmd' => $pbparams['cmdId'],
|
||||
'login' => $user->identity->username,
|
||||
'nbCredit' => $nb_credit,
|
||||
'amount' => $this->tranches[$idClient][$nb_credit]['montant'],
|
||||
'amount_ht' => $this->tranches[$idClient][$nb_credit]['montantht'],
|
||||
'amount_tva' => $this->tranches[$idClient][$nb_credit]['tva'],
|
||||
'currency' => 'EUR',
|
||||
'valid' => 0,
|
||||
'date_sent' => Date('Y-m-d H:i:s'),
|
||||
'date_received' => null,
|
||||
'paybox_answer' => null,
|
||||
'transaction' => json_encode(array('level' => 'Not confirmed', 'date' => Date('Y-m-d H:i:s'),'user' => $user->identity->id,'infosfact'=>$paidResult)),
|
||||
'comment' => null,
|
||||
);
|
||||
//Stockage des informations de facturation
|
||||
$paidResult=new stdClass();
|
||||
$paidResult->UserId= $user->identity->id;
|
||||
$paidResult->UserName = $user->identity->nom.' '.$user->identity->prenom;
|
||||
$paidResult->ClientName = $infos['societe']['NOM'];
|
||||
$paidResult->siret=$infos['societe']['SIREN'].$info['societe']['NIC'];
|
||||
$paidResult->Clienttvanbr=$infos['entrep']['TvaNumero'];
|
||||
$paidResult->ClientFacDest = $user->identity->email;
|
||||
$paidResult->ClientFacAdr1 = $infos['societe']['ADR_NUMVOIE'].' '.$infos['societe']['ADR_TYPVOIE'].' '.$infos['societe']['ADR_LIBVOIE'];
|
||||
$paidResult->ClientFacAdr2 = $infos['societe']['ADR_CP'].' '.$infos['societe']['ADR_LIBCOM'];
|
||||
$paidResult->ClientFacAdr3 = $infos['societe']['PAYS'];
|
||||
$paidResult->idCmd = $ligneCredit['idCmd'];
|
||||
$paidResult->numRC=$infos['societe']['NUMRC'];
|
||||
$ws = new Scores_Ws_Client('credit', '0.1');
|
||||
try {
|
||||
$params = new stdClass();
|
||||
$params->ligneCredit = json_encode($ligneCredit);
|
||||
$stage = $ws->payCredit($params);
|
||||
} catch(Exception $e) {
|
||||
$this->error('paiement', 'Impossible d\'enregistrer la commande');
|
||||
}
|
||||
//Paybox
|
||||
Zend_Loader::loadClass('Paybox_Config');
|
||||
Zend_Loader::loadClass('Paybox_System');
|
||||
$paybox = new Paybox_System(true);
|
||||
$paybox->setUrlPaiement();
|
||||
$paybox->setEmail($pbparams['email']);
|
||||
$paybox->setReference($pbparams['cmdId']);
|
||||
$paybox->setMontant($pbparams['montant']/100);
|
||||
//echo "http://".$request->getHttpHost()."/achatclient/pbanswer";die;
|
||||
//$paybox->setUrlRepondreA("http://".$request->getHttpHost()."/achatclient/checkpmt");
|
||||
$paybox->setUrlParameters("http://".$request->getHttpHost()."/achatclient/pbanswer");
|
||||
$paybox->calculateHMAC();
|
||||
//$_POST=$paybox->getFormParameters();
|
||||
//$this->redirect($paybox->getFormUrl());
|
||||
$this->view->pbparams = $pbparams;
|
||||
$this->view->infosfact=$paidResult;
|
||||
$this->view->PayboxUrl = $paybox->getFormUrl();
|
||||
$this->view->PayboxValues = $paybox->getFormParameters();
|
||||
|
||||
}
|
||||
public function errorAction(){
|
||||
$request = $this->getRequest();
|
||||
|
||||
$this->view->msg=$request->getParam('message');
|
||||
|
||||
}
|
||||
public function contactAction(){
|
||||
$request = $this->getRequest();
|
||||
$user = new Scores_Utilisateur();
|
||||
$ok=$user->checkperm($this->libdroits);
|
||||
|
||||
$message=$request->getParam('message');
|
||||
$categorie=$request->getParam('categorie');
|
||||
$objet=$request->getParam('objet');
|
||||
$histo=$this->getHistoContacts();
|
||||
$this->view->histocontact=$histo;
|
||||
if(empty($message) && empty($objet)){
|
||||
$this->view->msg="Entrez l'objet et votre message";
|
||||
return;
|
||||
}
|
||||
if((empty($message) || empty($objet)) && !empty($categorie)){
|
||||
$this->view->msg="Entrez l'objet et votre message";
|
||||
}else{
|
||||
$data=array(
|
||||
'idUser' => $user->identity->id,
|
||||
'begin' => Date('Y-m-d H:i:s'),
|
||||
'subject' => '['.$categorie.']'.$objet,
|
||||
'message' => 'From : '.$user->identity->username.' Message : '.$message,
|
||||
'stage' => 1,
|
||||
'answer' => '[Date : '.Date('Y-m-d H:i:s').'] Message enregistré'
|
||||
);
|
||||
$ok=$this->sendContact($data,$user);
|
||||
$this->view->msg="Votre message a bien été pris en compte";
|
||||
}
|
||||
$this->redirect('/achatclient/index/contact');
|
||||
}
|
||||
|
||||
public function setsiretAction(){
|
||||
//Validation
|
||||
$request = $this->getRequest();
|
||||
$user = new Scores_Utilisateur();
|
||||
$ok=$user->checkperm($this->libdroits);
|
||||
if(!$ok){
|
||||
$this->error('paiement', __LINE__);
|
||||
}
|
||||
$siret=$request->getParam('siret');
|
||||
$nb_credit=$request->getParam('nb_credit');
|
||||
$ws = new Scores_Ws_Client('account', '0.1');
|
||||
$parameters = new stdClass();
|
||||
$parameters->siret = $siret;
|
||||
$created = $ws->setUserSiret($parameters);
|
||||
$this->redirect('/achatclient/index/paiement?nb_credit='.$nb_credit);
|
||||
}
|
||||
public function consocsvAction(){
|
||||
//Validation
|
||||
$request = $this->getRequest();
|
||||
$user = new Scores_Utilisateur();
|
||||
$ok=$user->checkperm($this->libdroits);
|
||||
if(!$ok){
|
||||
$this->error('paiement', __LINE__);
|
||||
}
|
||||
$ws = new Scores_Ws_Client('credit', '0.1');
|
||||
$infocredit = $ws->mensuelconsoCredit();
|
||||
$infos->libelle=array();
|
||||
foreach($infocredit->libelle as $no => $o){
|
||||
$infos->libelle[$o->key]=$o->value;
|
||||
}
|
||||
$infos->used=$infocredit->used;
|
||||
header('X-Sendfile: consommation.tsv');
|
||||
header('Content-Type: application/csv-tab-delimited-table');
|
||||
header('Content-Disposition: attachment; filename="consommation.tsv"');
|
||||
echo $this->view->partial('index/consocsv.phtml',$infos);
|
||||
die;
|
||||
}
|
||||
private function sendContact($data,$user){
|
||||
|
||||
$ws = new Scores_Ws_Client('credit', '0.1');
|
||||
$params = new stdClass();
|
||||
$params->contactdata = (string)json_encode($data);
|
||||
$infocredit = $ws->contactCredit($params);
|
||||
//@todo: envoyer le mail
|
||||
$c = Zend_Registry::get('config');
|
||||
$mail = new Scores_Mail_Method();
|
||||
$mail->setSubject($data['subject']. ' - '.$user->identity->name.' -'.date('Y-m-d'));
|
||||
$mail->setBodyTextC($data['message']);
|
||||
$mail->setFromKey('support');
|
||||
$mail->addToKey('supportdev');
|
||||
//var_dump($mail);die;
|
||||
//$mail->execute();
|
||||
return true;
|
||||
}
|
||||
private function getHistoContacts(){
|
||||
$libelles=array(
|
||||
'id' => 'Reference enregistrement',
|
||||
'idUSer' => 'Reference utilisateur',
|
||||
'begin' => 'Message du',
|
||||
'subject' => 'Objet',
|
||||
'message' => 'Votre message',
|
||||
'stage' => 'Etape',
|
||||
'answer' => 'Suivi');
|
||||
$etapes=array(
|
||||
'1' => 'En attente de reponse',
|
||||
'2' => 'En cours de traitement',
|
||||
'3' => 'Resolu'
|
||||
);
|
||||
$ws = new Scores_Ws_Client('credit', '0.1');
|
||||
$infocredit = $ws->getcontactsCredit();
|
||||
if(count($infocredit->result)>0){
|
||||
$infos=array();
|
||||
foreach($infocredit->result as $n => $item){
|
||||
$infos[$n]=array();
|
||||
foreach($item as $obj){
|
||||
foreach($obj as $field){
|
||||
if($field->key=='begin'){
|
||||
$infos[$n][$libelles[$field->key]]=Date('d/m/Y à H:i',strtotime($field->value));
|
||||
}
|
||||
if($field->key=='message'){
|
||||
$infos[$n][$libelles[$field->key]]=substr($field->value,strpos($field->value,'Message :')+9);
|
||||
}
|
||||
if($field->key=='stage'){
|
||||
$infos[$n][$libelles[$field->key]]='<b>'.$etapes[$field->value].'</b>';
|
||||
}
|
||||
if($field->key=='answer'){
|
||||
$infos[$n][$libelles[$field->key]]=str_replace('[DE','<br>[DE',$field->value);
|
||||
}
|
||||
if($field->key=='subject'){
|
||||
$infos[$n][$libelles[$field->key]]=str_replace(']','</b> : ',str_replace('[','<b>',$field->value));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return $infos;
|
||||
}
|
||||
return array();
|
||||
}
|
||||
private function verifHttps(){
|
||||
if (
|
||||
( ! empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off')
|
||||
|| ( ! empty($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')
|
||||
|| ( ! empty($_SERVER['HTTP_X_FORWARDED_SSL']) && $_SERVER['HTTP_X_FORWARDED_SSL'] == 'on')
|
||||
|| (isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == 443)
|
||||
|| (isset($_SERVER['HTTP_X_FORWARDED_PORT']) && $_SERVER['HTTP_X_FORWARDED_PORT'] == 443)
|
||||
|| (isset($_SERVER['REQUEST_SCHEME']) && $_SERVER['REQUEST_SCHEME'] == 'https')
|
||||
) {
|
||||
return true;
|
||||
} else {
|
||||
if(getenv('APPLICATION_ENV')=='development'){return true;}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private function error($ligne=0,$message=""){
|
||||
$request = $this->getRequest();
|
||||
switch($ligne){
|
||||
case "index":
|
||||
$this->redirect("/achatclient/index/error?message=".$message);
|
||||
break;
|
||||
case "paiement":
|
||||
$this->redirect("/achatclient/?message=".$message);
|
||||
break;
|
||||
case "siret":
|
||||
$this->redirect("/achatclient/index/error?message=".$message);
|
||||
break;
|
||||
default:
|
||||
echo $ligne.' : '.$message;die;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
@ -0,0 +1,282 @@
|
||||
<?php
|
||||
class Achatclient_InextensoController extends Zend_Controller_Action
|
||||
{
|
||||
protected $theme;
|
||||
|
||||
/**
|
||||
* Logger
|
||||
* @var \Monolog\Logger
|
||||
*/
|
||||
protected $logger;
|
||||
|
||||
protected $libdroits = 'portemonnaie';
|
||||
|
||||
protected $maxcredit=2000;
|
||||
|
||||
|
||||
public function init()
|
||||
{
|
||||
if (Zend_Registry::isRegistered('logger')) {
|
||||
$this->logger = Zend_Registry::get('logger');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Page d'accueil et de redirection
|
||||
*/
|
||||
public function indexAction()
|
||||
{
|
||||
$user = new Scores_Utilisateur();
|
||||
$idUser=$user->identity->id;
|
||||
//var_dump($user);die;
|
||||
$ok=$user->checkperm($this->libdroits);
|
||||
if(!$ok){
|
||||
$this->msg = 'Fonction indisponible';
|
||||
}
|
||||
$request = $this->getRequest();
|
||||
$id=intval($request->getParam('id'));
|
||||
if($id==0){
|
||||
$this->view->message=__LINE__;
|
||||
return false;
|
||||
}
|
||||
$ws = new Scores_Ws_Client('credit', '0.1');
|
||||
$params = new stdClass();
|
||||
$params->id = $id;
|
||||
$infocredit = $ws->getfactinfosCredit($params);
|
||||
foreach($infocredit->result as $item){
|
||||
$infos[$item->key]=array();
|
||||
foreach($item->value->item as $obj){
|
||||
$infos[$item->key][$obj->key]=$obj->value;
|
||||
}
|
||||
}
|
||||
//var_dump($infos);die;
|
||||
// create new PDF document
|
||||
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
|
||||
|
||||
// set document information
|
||||
$pdf->SetCreator(PDF_CREATOR);
|
||||
$pdf->SetAuthor('Intescia');
|
||||
$pdf->SetTitle('bill');
|
||||
$pdf->SetSubject('Bill');
|
||||
$pdf->SetKeywords('Bill, PDF, facture');
|
||||
|
||||
// set default header data
|
||||
$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE. ' ' . date('d/m/Y'), PDF_HEADER_STRING, array(0,64,255), array(0,64,128));
|
||||
$pdf->setFooterData(array(0,64,0), array(0,64,128));
|
||||
|
||||
// set header and footer fonts
|
||||
$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
|
||||
$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
|
||||
|
||||
// set default monospaced font
|
||||
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
||||
|
||||
// set margins
|
||||
$pdf->SetMargins(20, 20, 20);
|
||||
// $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
|
||||
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
|
||||
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
|
||||
|
||||
// set auto page breaks
|
||||
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
||||
|
||||
// set image scale factor
|
||||
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
|
||||
|
||||
// ---------------------------------------------------------
|
||||
|
||||
// set default font subsetting mode
|
||||
$pdf->setFontSubsetting(true);
|
||||
|
||||
// Set font
|
||||
// dejavusans is a UTF-8 Unicode font, if you only need to
|
||||
// print standard ASCII chars, you can use core fonts like
|
||||
// helvetica or times to reduce file size.
|
||||
$pdf->SetFont('dejavusans', '', 11, '', true);
|
||||
|
||||
// Add a page
|
||||
// This method has several options, check the source code documentation for more information.
|
||||
$pdf->AddPage();
|
||||
|
||||
// Vendeur
|
||||
$pdf->SetLineStyle(['color' => [255, 255, 255]]);
|
||||
|
||||
//$pdf->Cell(80, 0, 'Intescia', 1, 1, 'L', 0, '', 1);
|
||||
//$pdf->Cell(80, 0, 'Scores & Decisions', 1, 1, 'L', 0, '', 2);
|
||||
//$pdf->Cell(80, 0, '8, rue Rouget de Lisle', 1, 1, 'L', 0, '', 3);
|
||||
//$pdf->Cell(80, 0, '92442 – Issy les Moulineaux Cedex', 1, 1, 'L', 0, '', 4);
|
||||
|
||||
//$pdf->Ln(5);
|
||||
|
||||
// Acheteur
|
||||
$pdf->SetXY(120, 60);
|
||||
$transaction=json_decode($infos['commande']['transaction']);
|
||||
if(isset($transaction->infosfact) && !empty($transaction->infosfact)){
|
||||
$paidResult=$transaction->infosfact;
|
||||
}else{
|
||||
$paidResult=new stdClass();
|
||||
$paidResult->UserId= $infos['commande']['idUser'];
|
||||
$paidResult->UserName = $infos['commande']['nom'].' '.$infos['commande']['prenom'];
|
||||
$paidResult->ClientName = $infos['societe']['NOM'];
|
||||
$paidResult->siret=$infos['societe']['SIREN'].$info['societe']['NIC'];
|
||||
$paidResult->Clienttvanbr=$infos['entrep']['TvaNumero'];
|
||||
$paidResult->ClientFacDest = $infos['commande']['email'];
|
||||
$paidResult->ClientFacAdr1 = $infos['societe']['ADR_NUMVOIE'].' '.$infos['societe']['ADR_TYPVOIE'].' '.$infos['societe']['ADR_LIBVOIE'];
|
||||
$paidResult->ClientFacAdr2 = $infos['societe']['ADR_CP'].' '.$infos['societe']['ADR_LIBCOM'];
|
||||
$paidResult->ClientFacAdr3 = $infos['societe']['PAYS'];
|
||||
$paidResult->idCmd = $infos['commande']['idCmd'];
|
||||
$paidResult->numRC=$infos['societe']['NUMRC'];
|
||||
}
|
||||
if($paidResult->UserId!=$idUser){
|
||||
$this->view->message=__LINE__;
|
||||
return false;
|
||||
}
|
||||
$paidResult->idFact= 'CB.'.Date('y',strtotime($infos['commande']['date_sent'])).sprintf("%1$06d",$infos['commande']['id']);
|
||||
$paidResult->nbCredit = $infos['commande']['nbCredit']*$infos['commande']['valid'];
|
||||
$paidResult->amount = number_format($infos['commande']['amount']*$infos['commande']['valid']/100,2,","," ");
|
||||
$paidResult->amount_ht = number_format($infos['commande']['amount_ht']*$infos['commande']['valid']/100,2,","," ");
|
||||
$paidResult->amount_tva = number_format($infos['commande']['amount_tva']*$infos['commande']['valid']/100,2,","," ");
|
||||
$paidResult->taux_tva = number_format(($infos['commande']['amount_tva']/$infos['commande']['amount_ht'])*100,2,","," ");
|
||||
$paidResult->dateCmd = Date('d/m/Y',strtotime($infos['commande']['date_sent']));
|
||||
$paidResult->dateExpir = Date('d/m/Y',strtotime($infos['commande']['date_sent'])+365*24*3600);
|
||||
$paidResult->hmCmd = Date('H\hi',strtotime($infos['commande']['date_sent']));
|
||||
|
||||
$logotbl = <<<EOD
|
||||
<img src="https://extranet.scores-decisions.com/themes/default/images/logos/logo-scores-et-decisions.png" width="200">
|
||||
<br />
|
||||
<br />
|
||||
EOD;
|
||||
$pdf->SetXY(20, 25);
|
||||
$pdf->writeHTML($logotbl, true, false, false, false, '');
|
||||
$facttbl = <<<EOD
|
||||
<table cellspacing="0" cellpadding="1" border="1" width="220px">
|
||||
<tr>
|
||||
<th style="text-align: center;background-color:#E6E6FF" colspan="3">Facture</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="text-align: center;background-color:#E6E6FF" width="80px">N° Facture</th>
|
||||
<th style="text-align: center;background-color:#E6E6FF" width="70px">Date</th>
|
||||
<th style="text-align: center;background-color:#E6E6FF" width="70px">N° Client</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align: right;font-size:8px;" width="80px">$paidResult->idFact</td>
|
||||
<td style="text-align: right;font-size:8px;" width="70px">$paidResult->dateCmd</td>
|
||||
<td style="text-align: right;font-size:8px;" width="70px">CB$paidResult->UserId</td>
|
||||
</tr>
|
||||
</table>
|
||||
<br />
|
||||
<br />
|
||||
EOD;
|
||||
$pdf->SetXY(110, 25);
|
||||
$pdf->writeHTML($facttbl, true, false, false, false, '');
|
||||
$prestattbl = <<<EOD
|
||||
<table border="1" width="220px"><tr><td> <table cellspacing="1" cellpadding="1" width="210px" style="font-size:10px;">
|
||||
<tr><td> </td></tr>
|
||||
<tr><td>Numero siret : $paidResult->siret</td></tr>
|
||||
<tr><td> </td></tr>
|
||||
<tr><td>Numéro TVA : $paidResult->Clienttvanbr</td></tr>
|
||||
<tr><td> </td></tr>
|
||||
</table></td></tr></table>
|
||||
<br />
|
||||
<br />
|
||||
EOD;
|
||||
$pdf->SetXY(20, 65);
|
||||
$pdf->writeHTML($prestattbl, true, false, false, false, '');
|
||||
$clienttbl = <<<EOD
|
||||
<table cellspacing="0" cellpadding="1" border="1" width="220px" style="font-size:10px;">
|
||||
<tr>
|
||||
<th style="text-align: center;background-color:#E6E6FF">Destinataire</th>
|
||||
</tr>
|
||||
<tr><td>$paidResult->ClientName</td></tr>
|
||||
<tr><td>$paidResult->ClientFacAdr1</td></tr>
|
||||
<tr><td>$paidResult->ClientFacAdr2</td></tr>
|
||||
<tr><td>$paidResult->ClientFacAdr22</td></tr>
|
||||
<tr><td>$paidResult->ClientFacAdr3</td></tr>
|
||||
<tr><td>$paidResult->ClientFacDest</td></tr>
|
||||
</table>
|
||||
<br />
|
||||
<br />
|
||||
EOD;
|
||||
$pdf->SetXY(110, 65);
|
||||
$pdf->writeHTML($clienttbl, true, false, false, false, '');
|
||||
$detailtbl = <<<EOD
|
||||
<table cellspacing="0" cellpadding="1" border="1" width="475" style="font-size:8px;">
|
||||
<tr>
|
||||
<td style="text-align: center;background-color:#E6E6FF;width:50;">Date Commande</td>
|
||||
<td style="text-align: center;background-color:#E6E6FF;width:100;">Référence Commande</td>
|
||||
<td style="text-align: center;background-color:#E6E6FF;width:100;">Description Commande</td>
|
||||
<td style="text-align: center;background-color:#E6E6FF;width:50;">Date d'expiration</td>
|
||||
<td style="text-align: center;background-color:#E6E6FF;width:50;">Quantite</td>
|
||||
<td style="text-align: center;background-color:#E6E6FF;width:50;">Prix H.T.</td>
|
||||
<td style="text-align: center;background-color:#E6E6FF;width:75;">Total H.T.</td>
|
||||
</tr>
|
||||
<tr><td style="width:50;">$paidResult->dateCmd</td>
|
||||
<td style="width:100;">$paidResult->idCmd</td>
|
||||
<td style="width:100;">Crédits à consommer<br>Stock minimum</td>
|
||||
<td style="text-align: right;width:50;">$paidResult->dateExpir</td>
|
||||
<td style="text-align: center;width:50;">$paidResult->nbCredit</td>
|
||||
<td style="text-align: right;width:50;">$paidResult->amount_ht €</td>
|
||||
<td style="text-align: right;width:75;">$paidResult->amount_ht €</td></tr>
|
||||
</table>
|
||||
<br />
|
||||
<br />
|
||||
EOD;
|
||||
$pdf->SetXY(20, 140);
|
||||
$pdf->writeHTML($detailtbl, true, false, false, false, '');
|
||||
|
||||
$totaltbl = <<<EOD
|
||||
<span style="text-align:right;font-size:8px;">
|
||||
TVA acquittée sur les encaissements</span><br><br><br><br>
|
||||
<table cellspacing="0" cellpadding="1" border="1" width="475" style="font-size:10px;">
|
||||
<tr>
|
||||
<th style="text-align: center;background-color:#E6E6FF">Total H.T.</th>
|
||||
<th style="text-align: center;background-color:#E6E6FF">Taux T.V.A.</th>
|
||||
<th style="text-align: center;background-color:#E6E6FF">Montant T.V.A.</th>
|
||||
<th style="text-align: center;background-color:#E6E6FF">Total T.T.C.</th>
|
||||
<th style="text-align: center;background-color:#E6E6FF">Net à payer</th>
|
||||
</tr>
|
||||
<tr><td style="text-align: right;">$paidResult->amount_ht €</td>
|
||||
<td style="text-align: right;">$paidResult->taux_tva %</td>
|
||||
<td style="text-align: right;">$paidResult->amount_tva €</td>
|
||||
<td style="text-align: right;">$paidResult->amount €</td>
|
||||
<td style="text-align: right;">$paidResult->amount €</td></tr>
|
||||
</table>
|
||||
EOD;
|
||||
$pdf->SetXY(20, 180);
|
||||
$pdf->writeHTML($totaltbl, true, false, false, false, '');
|
||||
|
||||
$footertbl = <<<EOD
|
||||
<table cellspacing="0" cellpadding="1" border="1" width="475" style="font-size:10px;">
|
||||
<tr>
|
||||
<th style="text-align: center;background-color:#E6E6FF;">Mode de paiement</th>
|
||||
<th style="text-align: center;background-color:#E6E6FF;">Date de paiement</th>
|
||||
</tr>
|
||||
<tr><td style="text-align: center;">Paiement en ligne - carte bancaire</td>
|
||||
<td style="text-align: center;">$paidResult->dateCmd à $paidResult->hmCmd</td>
|
||||
</tr>
|
||||
</table>
|
||||
EOD;
|
||||
$pdf->SetXY(20, 230);
|
||||
$pdf->writeHTML($footertbl, true, false, false, false, '');
|
||||
$footer = <<<EOD
|
||||
<span style="font-size:8px;text-align:center;" align="center">
|
||||
Scores & Decisions – 8 Rue Rouget de l’Isle – Axe Seine Immeuble A - 92130 ISSY LES MOULINEAUX
|
||||
<br>Tél 01.75.43.61.02 – Contact : compta@scores-decisions.com – SAS au capital de 618 450,00 €
|
||||
<br>R.C.S. : 2012B01581 RCS NANTERRE - - SIRET : 494 967 938 00072 – TVA intra. : FR84 494967938
|
||||
</span>
|
||||
EOD;
|
||||
$pdf->SetXY(20, 280);
|
||||
$pdf->writeHTML($footer, true, false, false, false, '');
|
||||
|
||||
|
||||
// Close and output PDF document
|
||||
$pdf->Output('bill_'.date('YmdHis').'.pdf', 'I');
|
||||
echo 'inex'.__LINE__;die;
|
||||
$this->_helper->layout()->disableLayout();
|
||||
//}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
@ -0,0 +1,98 @@
|
||||
<?php
|
||||
|
||||
class Achatclient_PbanswerController extends Zend_Controller_Action
|
||||
{
|
||||
protected $theme;
|
||||
|
||||
/**
|
||||
* Logger
|
||||
* @var \Monolog\Logger
|
||||
*/
|
||||
protected $logger;
|
||||
|
||||
protected $libdroits = 'searchent';
|
||||
|
||||
public function init()
|
||||
{
|
||||
if (Zend_Registry::isRegistered('logger')) {
|
||||
$this->logger = Zend_Registry::get('logger');
|
||||
}
|
||||
$autoloader = Zend_Loader_Autoloader::getInstance();
|
||||
// --- Theme
|
||||
$this->theme = Zend_Registry::get('theme');
|
||||
$this->view->title='Votre achat crédits en ligne';
|
||||
require_once 'Scores/WsScores.php';
|
||||
}
|
||||
|
||||
/**
|
||||
* Page d'accueil et de redirection
|
||||
*/
|
||||
public function indexAction()
|
||||
{
|
||||
//Validation des droits
|
||||
$user = new Scores_Utilisateur();
|
||||
$ok=$user->checkperm($this->libdroits);
|
||||
if(!$ok){
|
||||
$this->msg = 'Fonction indisponible';
|
||||
}
|
||||
$request = $this->getRequest();
|
||||
$idCmd=$request->getParam('id');
|
||||
$infos=$request->getParams();
|
||||
if($infos['eta']=="00000"){
|
||||
$valid=1;
|
||||
$this->msg = 'Transaction enregistrée';
|
||||
}else{
|
||||
$valid=0;
|
||||
$this->msg = 'Transaction annulée';
|
||||
}
|
||||
$ligneCredit=array(
|
||||
'idUser' =>$user->identity->id,
|
||||
'idCmd' => $idCmd,
|
||||
'login' => $user->identity->username,
|
||||
'valid' => $valid,
|
||||
'date_received' => Date('Y-m-d H:i:s'),
|
||||
'paybox_answer' => json_encode($infos),
|
||||
'transaction' => json_encode(array('level' => $this->msg, 'date' => Date('Y-m-d H:i:s'),'user' => $user->identity->id)),
|
||||
'comment' => null,
|
||||
);
|
||||
$ws = new Scores_Ws_Client('credit', '0.1');
|
||||
try {
|
||||
$params = new stdClass();
|
||||
$params->ligneCredit = json_encode($ligneCredit);
|
||||
$stage = $ws->payCredit($params);
|
||||
} catch(Exception $e) {
|
||||
echo $e->getMessage();
|
||||
}
|
||||
$this->redirect("http://".$request->getHttpHost()."/achatclient/?message=".$this->msg);
|
||||
}
|
||||
public function wspoloAction(){
|
||||
$json='[{"nomPartie":"BANQUE POPULAIRE DU MASSIF CENTRAL (BPMC)","qualite":"DE","numero":0,"adresse":{"lignes":["18 BOULEVARD JEAN MOULIN"],"codePostal":"63000","bureauDistributeur":"CLERMONT FERRAND"},"entreprise":{"idDossier":{"codeGreffe":"6303","dossierMillesime":null,"dossierStatut":null,"dossierChrono":"00000"},"nomGreffeImmat":null,"siren":0,"denomination":null,"etatposeSurveillance":null},"nomGreffeImmat":"CLERMONT-FERRAND","representants":[{"qualite":"DE","nom":"ME FRANCOIS-XAVIER DOS SANTOS","numeroPartie":1,"numeroRepresentant":1}]},{"nomPartie":"SARLh DELTA 2 I (SARL)","qualite":"DF","numero":0,"adresse":{"lignes":["18 RUE JEAN CLARET","PARC TECHNOLOGIQUE LA PARDIEU"],"codePostal":"63000","bureauDistributeur":"CLERMONT FERRAND"},"entreprise":{"idDossier":{"codeGreffe":"6303","dossierMillesime":"89","dossierStatut":"B","dossierChrono":"00507"},"nomGreffeImmat":null,"siren":950372318,"denomination":null,"etatposeSurveillance":null},"nomGreffeImmat":"CLERMONT-FERRAND","representants":[{"qualite":"DF","nom":"ME STEPHANE DEBERLE","numeroPartie":1,"numeroRepresentant":1}]},{"nomPartie":"EL MOUDNI SI Mohamed","qualite":"DF","numero":0,"adresse":{"lignes":["7 RUE DU CONSUL"],"codePostal":"63670","bureauDistributeur":"ORCET"},"entreprise":{"idDossier":{"codeGreffe":"6303","dossierMillesime":null,"dossierStatut":null,"dossierChrono":"00000"},"nomGreffeImmat":null,"siren":0,"denomination":null,"etatposeSurveillance":null},"nomGreffeImmat":"CLERMONT-FERRAND","representants":[{"qualite":"DF","nom":"ME STEPHANE DEBERLE","numeroPartie":2,"numeroRepresentant":1}]},{"nomPartie":"SELARL MANDATUM, repr\u00e9sent\u00e9e par Me Rapha\u00ebl PETAVY (INTERVENANTE VOLONTAIRE)","qualite":"DF","numero":0,"adresse":{"lignes":["29 BOULEVARD BERTHELOT"],"codePostal":"63400","bureauDistributeur":"CHAMALIERES"},"entreprise":{"idDossier":{"codeGreffe":"6303","dossierMillesime":null,"dossierStatut":null,"dossierChrono":"00000"},"nomGreffeImmat":null,"siren":0,"denomination":null,"etatposeSurveillance":null},"nomGreffeImmat":"CLERMONT-FERRAND","representants":[{"qualite":"DF","nom":"ME STEPHANE DEBERLE","numeroPartie":3,"numeroRepresentant":1}]}]';
|
||||
$val=json_decode($json);
|
||||
var_dump($val);die;
|
||||
$ws = new Scores_Ws_Client('entreprise', '0.9');
|
||||
$params = new stdClass();
|
||||
$params->companyId = 552144503;
|
||||
$params->tiers = 'DE';
|
||||
$params->p = 0;
|
||||
$params->limit = 10;
|
||||
$params = new stdClass();
|
||||
$params->companyId = 552144503;//siren
|
||||
$infocredit = $ws->getGreffeAffaireList($params);
|
||||
|
||||
var_dump($infocredit);die;
|
||||
}
|
||||
private function error($ligne=0,$message=""){
|
||||
switch($ligne){
|
||||
case "index":
|
||||
case "paiement":
|
||||
$this->view->msg=$message;
|
||||
$this->redirect("http://".$request->getHttpHost()."/achatclient/pbanswer?answer=error");
|
||||
throw new Exception($message);
|
||||
break;
|
||||
default:
|
||||
echo $ligne.' : '.$message;die;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
@ -0,0 +1,29 @@
|
||||
fonction<?php echo chr(9); ?>login<?php echo chr(9); ?>nb_credit<?php echo chr(9); ?>siren<?php echo chr(9); ?>date<?php echo chr(10); ?>
|
||||
<?php foreach($this->used as $row):
|
||||
foreach($row->item as $obj):
|
||||
?><?php
|
||||
//var_dump($this->libelle);
|
||||
if($obj->key=='idLog'){
|
||||
if(isset($this->libelle[$obj->value]))
|
||||
{echo $this->libelle[$obj->value];}
|
||||
else{echo $obj->value;}
|
||||
echo chr(9);
|
||||
}
|
||||
if($obj->key=='login'){
|
||||
echo $obj->value;
|
||||
echo chr(9);
|
||||
}
|
||||
if($obj->key=='consumption'){
|
||||
echo $obj->value;
|
||||
echo chr(9);
|
||||
}
|
||||
if($obj->key=='created'){
|
||||
echo Date('d/m/Y H:i:s',strtotime($obj->value));
|
||||
echo chr(10);
|
||||
}
|
||||
if($obj->key=='siret'){
|
||||
echo substr($obj->value,0,9);
|
||||
echo chr(9);
|
||||
}
|
||||
?>
|
||||
<?php endforeach;endforeach;?>
|
@ -0,0 +1,70 @@
|
||||
<style>
|
||||
div .credit{
|
||||
margin:25px;
|
||||
padding:50px;
|
||||
background-color:#bebebe;
|
||||
|
||||
}
|
||||
td.nbr{
|
||||
text-align:right;
|
||||
}
|
||||
#message{
|
||||
color:red;
|
||||
font-size:14px;
|
||||
}
|
||||
.spacer{
|
||||
min-height=20px;
|
||||
}
|
||||
.top{
|
||||
text-align:top;
|
||||
}
|
||||
</style>
|
||||
<div id="center">
|
||||
|
||||
<h1>Votre compte crédits en ligne</h1>
|
||||
|
||||
<h2>Demande de contact</h2>
|
||||
<div id="credit">
|
||||
<div id="message"><?=$this->msg?></div>
|
||||
<form action="<?=$this->url(array('controller'=>'index', 'action'=>'contact'))?>" method="POST" id="contactform">
|
||||
<div class="credit">
|
||||
<div class="form-group">
|
||||
<label for="objet" class="required">Demande concernant :</label>
|
||||
<select name="categorie" style="min-width:180px;"><option value="facturation">La facturation</option>
|
||||
<option value="commercial">Une demande commerciale</option>
|
||||
<option value="autre">Un autre sujet</option></select>
|
||||
</div>
|
||||
<div class="spacer"> </div>
|
||||
<div class="form-group">
|
||||
<label for="objet">Objet :</label>
|
||||
<input name="objet" placeholder="Objet de votre message" style="min-width:275px;">
|
||||
</div>
|
||||
<div class="spacer"> </div>
|
||||
<div class="form-group">
|
||||
<textarea name="message" ROWS=5 COLS=50 placeholder="Entrez votre message"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="submit">
|
||||
<p class="submit-button">
|
||||
<input type="submit" class="button" value="Envoyer" />
|
||||
<a href="<?=$this->url(array('controller'=>'index', 'action'=>'index'))?>" class="button ui-button ui-corner-all ui-widget" >
|
||||
Retour</a>
|
||||
</p>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<?php if(count($this->histocontact)>0):?>
|
||||
<h2>Vos précédentes demandes</h2>
|
||||
<?php foreach($this->histocontact as $item):?>
|
||||
<div class="data"><hr>
|
||||
<ul>
|
||||
<li><i>Message du</i> : <?=$item['Message du']?>
|
||||
<li><i>Etat du suivi</i> : <?=$item['Etape']?>
|
||||
<li><i>Objet</i> : <?=$item['Objet']?>
|
||||
<li><i>Demande</i> : <?=$item['Votre message']?>
|
||||
<li><i>Suivi</i> : <?=$item['Suivi']?>
|
||||
</ul>
|
||||
</div>
|
||||
<?php endforeach;?>
|
||||
<?php endif;?>
|
||||
</div>
|
@ -0,0 +1,23 @@
|
||||
<style>
|
||||
div .credit{
|
||||
margin-left:25px;
|
||||
}
|
||||
td.nbr{
|
||||
text-align:right;
|
||||
}
|
||||
#message{
|
||||
color:red;
|
||||
font-size:14px;
|
||||
}
|
||||
</style>
|
||||
<div id="center">
|
||||
|
||||
<h1>Votre compte crédits en ligne</h1>
|
||||
|
||||
<h2>Résumé de vos crédits</h2>
|
||||
<div class="credit">
|
||||
<div id="message"><?=$this->msg?></div>
|
||||
<a href="<?=$this->url(array('controller'=>'index', 'action'=>'index'))?>">Retour</a>
|
||||
</div>
|
||||
|
||||
</div>
|
@ -0,0 +1,92 @@
|
||||
<style>
|
||||
div .credit{
|
||||
margin-left:25px;
|
||||
}
|
||||
td.nbr{
|
||||
text-align:right;
|
||||
}
|
||||
#message{
|
||||
color:red;
|
||||
font-size:14px;
|
||||
}
|
||||
</style>
|
||||
<div id="center">
|
||||
|
||||
<h1>Votre compte crédits en ligne</h1>
|
||||
|
||||
<h2>Résumé de vos crédits</h2>
|
||||
<div class="credit">
|
||||
<p>
|
||||
Le compte <?=isset($this->infos['user']->identity->username)?$this->infos['user']->identity->username:""?>
|
||||
détient actuellement <?=intval($this->infos['balance']['balance'])?> crédits.<br>
|
||||
<?php if(isset($this->infos['balance']['created'])):?>
|
||||
Premier achat le <?=Date('d/m/Y',strtotime($this->infos['balance']['created']))?>.<br>
|
||||
<?php endif;?>
|
||||
<?php if(isset($this->infos['balance']['updated']) && !empty($this->infos['balance']['updated']) && $this->infos['balance']['updated']!="0000-00-00 00:00:00"):?>
|
||||
Dernière mise à jour le <?=Date('d/m/Y',strtotime($this->infos['balance']['updated']))?>.<br>
|
||||
<?php endif;?>
|
||||
</p>
|
||||
<div id="message" class="alert alert-info"><?=$this->msg?></div>
|
||||
<div class="col-sm-10">
|
||||
Une remarque ? <a href="<?=$this->url(array('controller'=>'index', 'action'=>'contact'))?>">
|
||||
<button name="contact" id="contact" class="button ui-button ui-corner-all ui-widget" role="button">Nous contacter</button></a>
|
||||
<?php if(isset($this->infos) && isset($this->infos['paid']) && count($this->infos['paid'])>3): ?>
|
||||
>> <a href="#achats">Achats</a>
|
||||
>> <a href="#consommations">Consommations</a><?php endif;?>
|
||||
</div></div>
|
||||
<?php if(isset($this->infos) && isset($this->infos['tranches'])):?>
|
||||
<h2>Commander des crédits</h2>
|
||||
<form action="<?=$this->url(array('controller'=>'index', 'action'=>'paiement'))?>" method="POST" id="creditform">
|
||||
<div class="credit">
|
||||
<?php $ok=true;foreach($this->infos['tranches'] as $credit => $item):?>
|
||||
<br><input type="radio" name="nb_credit" value="<?=$credit?>" <?php if($ok){?>checked="checked"<?php }$ok=false;?> /> <?=$credit?> Crédits (<?=$item['montantht']/100?> Euros H.T.)
|
||||
<?php endforeach;?>
|
||||
</div>
|
||||
<div class="submit">
|
||||
<p class="submit-button">
|
||||
<input type="submit" class="button" value="<?php echo $this->submitValue?>" />
|
||||
</p>
|
||||
</div>
|
||||
</form>
|
||||
<script>
|
||||
$('#creditform').submit(function($data){
|
||||
//@todo des vérifs si besoin
|
||||
});
|
||||
</script>
|
||||
<?php endif;?>
|
||||
<?php if(isset($this->infos) && isset($this->infos['paid'])):?>
|
||||
<h2 id="achats">Historique de vos achats</h2>
|
||||
<table class="data" style="max-width:90%;">
|
||||
<tr><th></th><th>Date d'achat</th><th>Montant de l'achat</th><th>Nb Crédits</th><th>Statut</th><th>Date de <br>validité des crédits</th><th></th></tr>
|
||||
<?php foreach($this->infos['paid'] as $row):?>
|
||||
<tr><td></td>
|
||||
<td><?=Date('d/m/Y H:i:s',strtotime($row['date_sent']))?></td>
|
||||
<td class="nbr"><?=$row['amount']/100?> Euros TTC</td>
|
||||
<td class="nbr"><?=$row['nbCredit']?> Credits</td>
|
||||
<td><?=($row['valid']==0?'Annulée':'Enregistrée')?></td>
|
||||
<td><?=($row['valid']==1?Date('d/m/Y',strtotime($row['date_sent'])+365*24*3600):'-')?></td>
|
||||
<td><a href="<?=$this->url(array('module' => 'achatclient','controller' => 'inextenso','action' => 'index', 'id' => $row['id']))?>" target="_blank">Facture</a></td>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
</table>
|
||||
<?php endif;?>
|
||||
<?php if(isset($this->infos) && isset($this->infos['used'])):?>
|
||||
<h2 id="consommations">Historique de vos consommations <a href="<?=$this->url(array('controller'=>'index', 'action'=>'consocsv'))?>" alt="Télécharger l'historique" title="Télécharger l'historique"><img src="/themes/default/images/menu/downloadcsv.jpg" width="20px" alt="Télécharger l'historique" title="Télécharger l'historique"></a></h2>
|
||||
<table class="data" style="max-width:90%;">
|
||||
<tr><th></th><th>Date d'utilisation</th><th>Nb Crédits</th><th>Fonctionnalité utilisée</th><th>Siren</th></tr>
|
||||
<?php foreach($this->infos['used'] as $row):?>
|
||||
<tr><td></td>
|
||||
<td><?=Date('d/m/Y H:i:s',strtotime($row['created']))?></td>
|
||||
<td class="nbr"><?=$row['consumption']?> Credit</td>
|
||||
<td><?php
|
||||
if(isset($this->infos['libelle'][$row['idLog']]))
|
||||
{echo $this->infos['libelle'][$row['idLog']];}
|
||||
else{echo $row['idLog'];}?>
|
||||
</td>
|
||||
<td class="nbr"><?=substr($row['siret'],0,9)?></td>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
</table>
|
||||
<?php endif;?>
|
||||
|
||||
</div>
|
@ -0,0 +1,101 @@
|
||||
<style>
|
||||
div .credit{
|
||||
margin-left:25px;
|
||||
}
|
||||
td.nbr{
|
||||
text-align:right;
|
||||
}
|
||||
alert{
|
||||
border:1px solid red;
|
||||
}
|
||||
</style>
|
||||
|
||||
<?php if(empty($this->pbparams)):?>
|
||||
<?php if($this->info=='siret'):?>
|
||||
<div id="center">
|
||||
<h1>ACHAT de CREDITS <small>Informations complémentaires</small></h1>
|
||||
<h2><?=$this->message ?></h2>
|
||||
<div class="credit">
|
||||
<form id="siretform" method="post" action="<?=$this->url(array('module' => 'achatclient','controller' => 'index', 'action' => 'setSiret'))?>" class="form-inline horizontal">
|
||||
<input type="hidden" name="nb_credit" value="<?=$this->infosfact['nb_credit'] ?>">
|
||||
<label for="siret">Siret :</label>
|
||||
<input type="text" name="siret">
|
||||
<input type="submit" name="submitsiret" value="Enregistrer" class="button ui-button ui-corner-all ui-widget">
|
||||
<a href="/achatclient/" class="button ui-button ui-corner-all ui-widget">Abandon</a>
|
||||
</form>
|
||||
</div>
|
||||
<div id="errors"></div>
|
||||
<script>
|
||||
$(function(){
|
||||
$('input[name=submitsiret').click(function(e){
|
||||
e.preventDefault();
|
||||
siret=$('input[name=siret]').val();
|
||||
|
||||
if(EstSiretValide(siret)){
|
||||
$('#siretform').submit();
|
||||
}else{
|
||||
$('input[name=siret]').addClass('alert alert-danger');
|
||||
$('#errors').addClass('alert alert-danger');
|
||||
$('#errors').html('Veuillez entrer un siret valide pour vous identifier');
|
||||
}
|
||||
//$('form[name=cgu]').submit();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<?php echo $this->inlineScript(); ?>
|
||||
<?php endif;?>
|
||||
<?php if($this->info=='tva'):?>
|
||||
<div id="center">
|
||||
<a href="<?=$this->url(array('controller'=>'index', 'action'=>'contact'))?>">
|
||||
Le numero de TVA intracommunautaire n'a pas été trouvé pour votre société.
|
||||
<br>Merci de contacter le service comptable.
|
||||
<br>
|
||||
<a href="<?=$this->url(array('controller'=>'index', 'action'=>'contact'))?>">
|
||||
<button name="contact" id="contact" class="button ui-button ui-corner-all ui-widget" role="button">Nous contacter</button>
|
||||
</a>
|
||||
<?php endif;?>
|
||||
<?php else:?>
|
||||
<div id="center">
|
||||
<h1>ACHAT de CREDITS <small>Confirmation</small></h1>
|
||||
|
||||
<?php //if ( $this->CmdID ):?>
|
||||
<h2>Informations de la commande</h2>
|
||||
<div class="credit"><table class="data" style="max-width:80%;">
|
||||
<tr><td>Identifiant de commande : </td><td><?=$this->pbparams['cmdId']?></td></tr>
|
||||
<tr><td>Utilisateur : </td><td><?=$this->pbparams['login']?></td></tr>
|
||||
<tr><td>Société : </td><td><?=$this->infosfact->siret?><br><b><?=$this->infosfact->ClientName?></b>
|
||||
<br><i><?=$this->infosfact->ClientFacAdr1?>-<?=$this->infosfact->ClientFacAdr2?> <?=$this->infosfact->ClientFacAdr3?></i>
|
||||
<br><?=$this->infosfact->Clienttvanbr?></td></tr>
|
||||
<tr><td>Nombre de crédits commandés : </td><td class="nbr"><?=$this->pbparams['nb_credit']?></td></tr>
|
||||
<tr><td>Montant HT : </td><td class="nbr"><?=number_format($this->pbparams['montantht']/100,2,","," ")?> euros</td></tr>
|
||||
<tr><td>Tva : </td><td class="nbr"><?=number_format($this->pbparams['tva']/100,2,","," ")?> euros</td></tr>
|
||||
<tr><td>Montant TTC : </td><td class="nbr"><?=number_format($this->pbparams['montant']/100,2,","," ")?> euros</td></tr>
|
||||
</table>
|
||||
<p>Une fois le paiement effectué cliquer sur le bouton "Retour boutique" afin de
|
||||
consulter vos documents, si la redirection automatique ne se fait pas.</p><p>Si vous constatez une anomalie dans les informations ci-dessus
|
||||
<a href="<?=$this->url(array('controller'=>'index', 'action'=>'contact'))?>">
|
||||
<button name="contact" id="contact" class="button ui-button ui-corner-all ui-widget" role="button">Nous contacter</button></a>
|
||||
</div>
|
||||
<h2>Démarrer le paiement</h2>
|
||||
<div class="credit">
|
||||
<?php if ($this->PayboxValues) {?>
|
||||
<?=$this->PayboxVerif?>
|
||||
<form method="post" action="<?=$this->PayboxUrl?>" class="form-inline horizontal">
|
||||
|
||||
<?php foreach ( $this->PayboxValues as $field) {?>
|
||||
<input type="hidden" name="<?=$field['name']?>" value="<?=$field['value']?>" />
|
||||
<?php }?>
|
||||
|
||||
<input type="submit" class="button ui-button ui-corner-all ui-widget" value="Paiement"/>
|
||||
<a href="/achatclient/" class="button ui-button ui-corner-all ui-widget">Abandon</a>
|
||||
</form>
|
||||
</div>
|
||||
<?php // }?>
|
||||
|
||||
<?php } else {?>
|
||||
|
||||
<div class="alert alert-danger"><strong>Erreur !</strong> </div>
|
||||
|
||||
<?php }?>
|
||||
</div>
|
||||
<?php endif;?>
|
@ -0,0 +1,23 @@
|
||||
<style>
|
||||
div .credit{
|
||||
margin-left:25px;
|
||||
}
|
||||
td.nbr{
|
||||
text-align:right;
|
||||
}
|
||||
#message{
|
||||
color:red;
|
||||
font-size:14px;
|
||||
}
|
||||
</style>
|
||||
<div id="center">
|
||||
|
||||
<h1>Votre compte crédits en ligne</h1>
|
||||
|
||||
<h2>Résumé de vos crédits</h2>
|
||||
<div class="credit">
|
||||
<div id="message">Votre demande ne peut aboutir.N'hésitez pas à nous contacter en mentionnant le code erreur : 12-<?=$this->message; ?></div>
|
||||
<a href="<?=$this->url(array('controller'=>'index', 'action'=>'index'))?>">Retour</a>
|
||||
</div>
|
||||
|
||||
</div>
|
@ -11,6 +11,7 @@ class AuthController extends Zend_Controller_Action
|
||||
'authType' => 'userSSO',
|
||||
'login' => 'mail',
|
||||
'token' => 'token',
|
||||
'css' => '/inexweb.css',
|
||||
)
|
||||
);
|
||||
|
||||
@ -40,7 +41,6 @@ class AuthController extends Zend_Controller_Action
|
||||
$this->_helper->layout()->disableLayout();
|
||||
|
||||
$this->view->headLink()
|
||||
->appendStylesheet($this->theme->pathStyle.'/inexweb.css', 'all')
|
||||
->appendStylesheet($this->theme->pathStyle.'/user.css', 'all');
|
||||
|
||||
$request = $this->getRequest();
|
||||
@ -84,10 +84,11 @@ class AuthController extends Zend_Controller_Action
|
||||
$urlParams = array('controller'=>'auth', 'action'=>'userssoform');
|
||||
$urlParams = array_merge($params, $urlParams);
|
||||
$this->view->FormUrlParams = $urlParams;
|
||||
}
|
||||
$this->view->headLink()
|
||||
->appendStylesheet($this->theme->pathStyle.'/inexweb.css', 'all');
|
||||
}
|
||||
// --- Redirection
|
||||
else {
|
||||
|
||||
$auth = Zend_Auth::getInstance();
|
||||
|
||||
// --- Set partial identity
|
||||
@ -114,7 +115,7 @@ class AuthController extends Zend_Controller_Action
|
||||
$identity = $user->updateProfil($InfosLogin);
|
||||
$auth->getStorage()->write($identity);
|
||||
// --- Redirect
|
||||
$this->redirect('/');
|
||||
$this->redirect('/recherche');
|
||||
}
|
||||
} catch ( Exception $e ) {
|
||||
switch ( $e->getCode() ) {
|
||||
@ -150,7 +151,12 @@ class AuthController extends Zend_Controller_Action
|
||||
{
|
||||
// --- Désactiver le layout
|
||||
$this->_helper->layout()->disableLayout();
|
||||
$this->view->headLink()->appendStylesheet($this->theme->pathStyle.'/user.css', 'all');
|
||||
$this->view->headLink()
|
||||
->appendStylesheet($this->theme->pathStyle.'/user.css', 'all')
|
||||
//->appendStylesheet($this->theme->pathStyle.$config['css'], 'all')
|
||||
;
|
||||
$this->view->inlineScript()->appendFile($this->theme->pathScript.'/recherche.js', 'text/javascript');
|
||||
|
||||
$request = $this->getRequest();
|
||||
|
||||
/**
|
||||
@ -159,6 +165,9 @@ class AuthController extends Zend_Controller_Action
|
||||
$partner = $request->getParam('partner');
|
||||
if ( array_key_exists($partner, $this->partnerConfig) ) {
|
||||
$config = $this->partnerConfig[$partner];
|
||||
$this->view->headLink()
|
||||
->appendStylesheet($this->theme->pathStyle.$config['css'], 'all')
|
||||
;
|
||||
$this->view->logo = $config['logo'];
|
||||
$params = $request->getParams();
|
||||
$objectParams = array();
|
||||
|
@ -37,13 +37,16 @@ class DirigeantController extends Zend_Controller_Action
|
||||
|
||||
$siren = substr($this->siret, 0, 9);
|
||||
|
||||
$ws = new WsScores();
|
||||
if (empty($autrePage)) {
|
||||
$this->view->headTitle()->prepend('Liste des dirigeants');
|
||||
$this->view->headTitle()->prepend('Siret '.$this->siret);
|
||||
}else{
|
||||
$ws->freeService=true;
|
||||
}
|
||||
|
||||
$ws = new WsScores();
|
||||
$infos = $ws->getDirigeants($siren);
|
||||
$ws->freeService=false;
|
||||
|
||||
if ($infos === false){
|
||||
$this->forward('soap', 'error');
|
||||
|
@ -88,7 +88,14 @@ class ErrorController extends Zend_Controller_Action
|
||||
}
|
||||
}
|
||||
|
||||
public function soapAction(){}
|
||||
public function soapAction($error_code=null){
|
||||
try{
|
||||
$user=new Scores_Utilisateur();
|
||||
}catch(Exception $e){$user=stdClass;}
|
||||
//var_dump($user);die;
|
||||
$ok=$ok=$user->checkperm('portemonnaie');
|
||||
$this->view->portemonnaie=$ok;
|
||||
}
|
||||
|
||||
public function permsAction(){}
|
||||
|
||||
|
@ -279,12 +279,15 @@ class EvaluationController extends Zend_Controller_Action
|
||||
$entreprise = new Scores_Session_Entreprise($this->siret, $this->id);
|
||||
//@todo : transformer le webservice pour ne faire qu'une seule requete
|
||||
$ws = new WsScores();
|
||||
$indiscore = $ws->getIndiScore($siren, 0, 1);
|
||||
if ($indiscore === false) {
|
||||
$indiscore = $ws->getIndiScore($siren, 0, 4);
|
||||
$ws->freeService=true;
|
||||
if ($indiscore === false) {
|
||||
$this->forward('soap', 'error');
|
||||
}
|
||||
$identite = $ws->getIdentite($siren);
|
||||
$identite = $ws->getIdentite($siren);
|
||||
$infos = $ws->getRatios($siren, 'indiscore2');
|
||||
if ($infos === false) $this->forward('soap', 'error');
|
||||
$ws->freeService=false;
|
||||
|
||||
$score = array();
|
||||
$tabRatio = array(
|
||||
@ -438,9 +441,9 @@ class EvaluationController extends Zend_Controller_Action
|
||||
$this->view->headTitle()->prepend("Siret ".$this->siret);
|
||||
|
||||
$user = new Scores_Utilisateur();
|
||||
if(!$user->checkPerm('INDISCORE3') && !$user->checkPerm('INDISCORE3P'))
|
||||
if(!$user->checkPerm('INDISCORE3') && !$user->checkPerm('INDISCORE3P')){
|
||||
$this->forward('perms', 'error');
|
||||
|
||||
}
|
||||
// Lien pour le rapport personnalisé
|
||||
if ($user->getIdClient() == '110' || $user->checkModeEdition()) {
|
||||
$this->view->assign('customRapport', $this->view->url(array(
|
||||
@ -465,6 +468,7 @@ class EvaluationController extends Zend_Controller_Action
|
||||
$email = $request->getParam('email', '');
|
||||
|
||||
$infos = $ws->getRapport($siren, 3, 0, $plus, $ref, $encours, $email);
|
||||
if(empty($infos)){$this->_forward('soap', 'error');}
|
||||
$this->logger->info(print_r($infos,1));
|
||||
if ($infos === false) {
|
||||
$this->forward('soap', 'error');
|
||||
@ -1045,7 +1049,9 @@ class EvaluationController extends Zend_Controller_Action
|
||||
$email = $request->getParam('email', '');
|
||||
|
||||
$infos = $ws->getEntrepriseValo($siren);
|
||||
|
||||
if(empty($infos)){
|
||||
$this->_forward('soap', 'error');
|
||||
}
|
||||
require_once 'Scores/RapportComment.php';
|
||||
$rapportComment = new RapportComment($siren, $this->id,
|
||||
$infos->Indiscore->tabCommentaires->item,
|
||||
|
@ -228,7 +228,7 @@ class FinanceController extends Zend_Controller_Action
|
||||
$this->view->headTitle()->prepend("Bilan, Compte de résultat");
|
||||
$this->view->headTitle()->prepend("Siret ".$this->siret);
|
||||
$ws = new WsScores();
|
||||
$infos = $ws->getRatios(substr($this->siret, 0, 9), 'ratios');
|
||||
$infos = $ws->getRatios(substr($this->siret, 0, 9), 'bilan');
|
||||
if ($infos === false) $this->_forward('soap', 'error');
|
||||
} else {
|
||||
$infos = $this->getRequest()->getParam('infos');
|
||||
@ -852,7 +852,6 @@ class FinanceController extends Zend_Controller_Action
|
||||
$this->view->assign('raisonSociale', $entreprise->getRaisonSociale());
|
||||
$this->view->assign('siren', substr($this->siret, 0, 9));
|
||||
$this->view->assign('siret', $this->siret);
|
||||
$this->view->assign('idClient', $user->identity->idClient);
|
||||
|
||||
$this->view->haveLiasse = ($bilanList->nbReponses > 0) ? true : false;
|
||||
|
||||
@ -1070,7 +1069,7 @@ class FinanceController extends Zend_Controller_Action
|
||||
|
||||
|
||||
$entreprise = new Scores_Session_Entreprise($this->siret, $this->id);
|
||||
$this->view->assign('banques', isset($infos->result->item)?$infos->result->item:array());
|
||||
$this->view->assign('banques', $infos->result->item);
|
||||
$this->view->assign('raisonSociale', $entreprise->getRaisonSociale());
|
||||
$this->view->assign('siren', substr($this->siret, 0, 9));
|
||||
$this->view->assign('exportObjet', $infos);
|
||||
@ -1097,7 +1096,10 @@ class FinanceController extends Zend_Controller_Action
|
||||
$entreprise = new Scores_Session_Entreprise($this->siret, $this->id);
|
||||
$this->view->assign('raisonSociale', $entreprise->getRaisonSociale());
|
||||
|
||||
$infos = $ws->getRatios($siren, 'ratios');
|
||||
$infos = $ws->getRatios($siren, 'flux');
|
||||
if ($infos === false) {
|
||||
$this->forward('soap', 'error');
|
||||
}
|
||||
|
||||
//Formattage des données
|
||||
$ratiosData = new Scores_Finance_Ratios_Data($infos);
|
||||
|
@ -407,8 +407,6 @@ class IdentiteController extends Zend_Controller_Action
|
||||
}
|
||||
} else {
|
||||
$pageTotal = $pageCurrent = 1;
|
||||
$pagePrev = 1;
|
||||
$pageNext = 1;
|
||||
}
|
||||
$this->view->assign('PageTotal', $pageTotal);
|
||||
$this->view->assign('PagePrev', $pagePrev);
|
||||
@ -680,6 +678,7 @@ class IdentiteController extends Zend_Controller_Action
|
||||
$this->view->assign('edition', $user->checkModeEdition());
|
||||
|
||||
$ws = new WsScores();
|
||||
if (!empty($autrePage)) {$ws->freeService=true;}
|
||||
|
||||
if ($lienRef) {
|
||||
|
||||
@ -687,6 +686,8 @@ class IdentiteController extends Zend_Controller_Action
|
||||
|
||||
if (empty($autrePage)) {
|
||||
$this->view->headTitle()->prepend('Liens inter-entreprises - Id '.$lienRef);
|
||||
}else{
|
||||
$ws->freeService=true;
|
||||
}
|
||||
|
||||
$identite = $ws->getLienRef($lienRef);
|
||||
@ -714,7 +715,7 @@ class IdentiteController extends Zend_Controller_Action
|
||||
}
|
||||
|
||||
//Get links
|
||||
$infos = $ws->getLiensById($lienRef);
|
||||
$infos = $ws->getLiensById($lienRef);
|
||||
|
||||
} else {
|
||||
$siren = substr($this->siret,0,9);
|
||||
@ -764,6 +765,7 @@ class IdentiteController extends Zend_Controller_Action
|
||||
$this->view->assign('civilite', $result->civilite);
|
||||
$this->view->assign('naissanceDate', $result->naissance_Date);
|
||||
}
|
||||
$ws->freeService=false;
|
||||
|
||||
if ( in_array($session->getFormeJuridique(), array(5488,5498,5720)) ) {
|
||||
$this->view->assign('FJ1', true);
|
||||
@ -1148,6 +1150,9 @@ class IdentiteController extends Zend_Controller_Action
|
||||
|
||||
$ws = new WsScores();
|
||||
$infos = $ws->getListeEvenements($siren, $nic, $position, $nbReponses);
|
||||
if ($infos === false) {
|
||||
$this->forward('soap', 'error');
|
||||
}
|
||||
$evens = $infos->result->item;
|
||||
|
||||
$this->view->assign('evens', $evens);
|
||||
@ -1173,8 +1178,6 @@ class IdentiteController extends Zend_Controller_Action
|
||||
}
|
||||
} else {
|
||||
$pageTotal = $pageCurrent = 1;
|
||||
$pagePrev = 1;
|
||||
$pageNext = 1;
|
||||
}
|
||||
$this->view->assign('PageTotal', $pageTotal);
|
||||
$this->view->assign('PagePrev', $pagePrev);
|
||||
@ -1630,6 +1633,9 @@ class IdentiteController extends Zend_Controller_Action
|
||||
|
||||
$ws = new WsScores();
|
||||
$result = $ws->getGroupeInfos($siren);
|
||||
if ($result === false) {
|
||||
$this->forward('soap', 'error');
|
||||
}
|
||||
|
||||
$this->view->assign('result', $result);
|
||||
$this->view->assign('siren', $siren);
|
||||
|
@ -74,6 +74,9 @@ class JuridiqueController extends Zend_Controller_Action
|
||||
$position = ($page - 1) * $nbAffichage;
|
||||
|
||||
$ws = new WsScores();
|
||||
if(!empty($autrePage)){
|
||||
$ws->freeService=true;
|
||||
}
|
||||
switch ($vue) {
|
||||
case 'balo':
|
||||
$infos = $ws->getAnnoncesBalo($siren, $idAnn, null, $position, $nbAffichage);
|
||||
@ -108,6 +111,7 @@ class JuridiqueController extends Zend_Controller_Action
|
||||
$infos = $ws->getAnnoncesLegales($siren, $idAnn, null, $position, $nbAffichage);
|
||||
break;
|
||||
}
|
||||
$ws->freeService=false;
|
||||
$this->logger->info(print_r($infos,1));
|
||||
if ($infos === false) {
|
||||
$this->forward('soap', 'error');
|
||||
@ -154,8 +158,6 @@ class JuridiqueController extends Zend_Controller_Action
|
||||
}
|
||||
} else {
|
||||
$pageTotal = $pageCurrent = 1;
|
||||
$pagePrev = 1;
|
||||
$pageNext = 1;
|
||||
}
|
||||
$this->view->assign('PageTotal', $pageTotal);
|
||||
$this->view->assign('PagePrev', $pagePrev);
|
||||
@ -219,6 +221,9 @@ class JuridiqueController extends Zend_Controller_Action
|
||||
} else {
|
||||
$this->view->assign('vue', $vue);
|
||||
$ws = new WsScores();
|
||||
if(!empty($autrePage)){
|
||||
$ws->freeService=true;
|
||||
}
|
||||
switch ($vue) {
|
||||
case 'balo':
|
||||
$infos = $ws->getAnnoncesBalo($siren, $idAnn, null, $position, $nbAffichage);
|
||||
@ -383,9 +388,12 @@ class JuridiqueController extends Zend_Controller_Action
|
||||
$this->view->msg = "Erreur";
|
||||
} else {
|
||||
|
||||
$this->view->List = isset($response->List->item)?$response->List->item:null;
|
||||
$this->view->List = $response->List->item;
|
||||
// --- Pagination
|
||||
$nbReponsesTotal = $response->Nb;
|
||||
$pageTotal = $pageCurrent = 1;
|
||||
$pagePrev = null;
|
||||
$pageNext = null;
|
||||
if ($nbReponses < $nbReponsesTotal) {
|
||||
$pageTotal = ceil( $nbReponsesTotal / $nbReponses );
|
||||
$pageCurrent = $page;
|
||||
@ -397,10 +405,6 @@ class JuridiqueController extends Zend_Controller_Action
|
||||
if( $pageNext > $pageTotal ) {
|
||||
$pageNext = $pageTotal;
|
||||
}
|
||||
} else {
|
||||
$pageTotal = $pageCurrent = 1;
|
||||
$pagePrev = 1;
|
||||
$pageNext = 1;
|
||||
}
|
||||
$this->view->assign('PageTotal', $pageTotal);
|
||||
$this->view->assign('PagePrev', $pagePrev);
|
||||
@ -562,6 +566,7 @@ class JuridiqueController extends Zend_Controller_Action
|
||||
$this->view->assign('raisonSociale', $session->getRaisonSociale());
|
||||
$ws = new WsScores();
|
||||
$infos = $ws->getListeConventions($siren);
|
||||
if ($infos === false) $this->_forward('soap', 'error');
|
||||
$conventions = $infos->result->item;
|
||||
$this->logger->info(print_r($conventions,1));
|
||||
$this->view->assign('conventions', $conventions);
|
||||
|
@ -806,8 +806,6 @@ class RechercheController extends Zend_Controller_Action
|
||||
//Calcul pagination
|
||||
$nbReponses = $reponse->nbReponses;
|
||||
$nbReponsesTotal = $reponse->nbReponsesTotal;
|
||||
$pagePrev=1;
|
||||
$pageNext=1;
|
||||
if ($nbReponses < $nbReponsesTotal) {
|
||||
$pageTotal = ceil( $nbReponsesTotal / $nbAffichage );
|
||||
$pageCurrent = $page;
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -118,7 +118,6 @@ class SurveillanceController extends Zend_Controller_Action
|
||||
|
||||
$page = $request->getParam('page');
|
||||
$from = $request->getParam('from');
|
||||
$q = $request->getParam('q');
|
||||
|
||||
$siret = $request->getParam('siret', '');
|
||||
$email = $request->getParam('email', '');
|
||||
@ -137,8 +136,6 @@ class SurveillanceController extends Zend_Controller_Action
|
||||
}
|
||||
} elseif (isset($page)) {
|
||||
$this->redirect('surveillance/liste/page/'.$page);
|
||||
} elseif (isset($q)) {
|
||||
$this->redirect('surveillance/liste/q/'.$q);
|
||||
} else {
|
||||
$this->redirect('surveillance/liste');
|
||||
}
|
||||
@ -383,7 +380,7 @@ class SurveillanceController extends Zend_Controller_Action
|
||||
$ws = new WsScores();
|
||||
$infos = $ws->getSurveillances($filtre, $position, $nbAffichage);
|
||||
|
||||
$surveillances = isset($infos->result->item)?$infos->result->item:null;
|
||||
$surveillances = $infos->result->item;
|
||||
|
||||
$listTrier = array();
|
||||
if ( count($surveillances)>0 ) {
|
||||
@ -425,12 +422,10 @@ class SurveillanceController extends Zend_Controller_Action
|
||||
}
|
||||
} else {
|
||||
$pageTotal = $pageCurrent = 1;
|
||||
$pagePrev = 1;
|
||||
$pageNext = 1;
|
||||
}
|
||||
$this->view->assign('PageTotal', $pageTotal);
|
||||
$this->view->assign('PagePrev', isset($pagePrev)?$pagePrev:1);
|
||||
$this->view->assign('PageNext', isset($pageNext)?$pageNext:1);
|
||||
$this->view->assign('PagePrev', $pagePrev);
|
||||
$this->view->assign('PageNext', $pageNext);
|
||||
$this->view->assign('PageCurrent', $pageCurrent);
|
||||
|
||||
$this->view->assign('nbReponses', empty($nbReponses) ? 0 : $nbReponses);
|
||||
@ -646,8 +641,6 @@ class SurveillanceController extends Zend_Controller_Action
|
||||
}
|
||||
} else {
|
||||
$pageTotal = $pageCurrent = 1;
|
||||
$pagePrev = 1;
|
||||
$pageNext = 1;
|
||||
}
|
||||
$this->view->assign('PageTotal', $pageTotal);
|
||||
$this->view->assign('PagePrev', $pagePrev);
|
||||
@ -1159,56 +1152,4 @@ class SurveillanceController extends Zend_Controller_Action
|
||||
$html2pdf->WriteHTML(utf8_decode($output));
|
||||
$html2pdf->Output(str_replace('.csv', '.pdf', $nomFic), 'D');
|
||||
}
|
||||
|
||||
/**
|
||||
* Import surveillance en fichier csv
|
||||
*/
|
||||
public function surveillanceserieAction(){
|
||||
//echo 'coucou';die;
|
||||
$request = $this->getRequest();
|
||||
if($request->getParam('ref')>""){
|
||||
$cs=new Scores_Import_FileCsv();
|
||||
$verif=$cs->verifandupload($_FILES,$request);
|
||||
if($verif['success']){
|
||||
$this->view->assign('msg', 'Nous avons enregistré votre fichier de '.$verif['message'].' lignes.<br><br>Les surveillances seront enregistrées durant la nuit.');
|
||||
$this->view->assign('step', 2);
|
||||
}else{
|
||||
$this->view->assign('msg', $verif['message']);
|
||||
$this->view->assign('step', 2);
|
||||
}
|
||||
return;
|
||||
}
|
||||
//Affichage formulaire demande ref et email
|
||||
$this->_helper->layout->disableLayout();
|
||||
$source = $request->getParam('source', '');
|
||||
$encours = $request->getParam('encours', 0);
|
||||
$this->view->pathScript=$this->theme->pathScript;
|
||||
$this->view->pathStyle=$this->theme->pathStyle;
|
||||
$user = new Scores_Utilisateur();
|
||||
|
||||
$request = $this->getRequest();
|
||||
$source = $request->getParam('source');
|
||||
|
||||
$tabSource = array();
|
||||
$user = new Scores_Utilisateur();
|
||||
|
||||
// Main email
|
||||
$email = $user->getEmail();
|
||||
$ref=$user->identity->id . 'surv'.Date('YmdHis');
|
||||
foreach ($this->sourceDroit as $s => $perm) {
|
||||
if ($user->checkPerm($perm)) {
|
||||
$tabSource[] = array(
|
||||
'value' => $s,
|
||||
'name' => $this->sourceTxt[$s],
|
||||
'select' => (!empty($source) && $source==$s) ? ' selected' : '',
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$this->view->assign('tabSource', $tabSource);
|
||||
$this->view->assign('email', $email);
|
||||
$this->view->assign('ref', $ref);
|
||||
$this->view->assign('encours', $encours);
|
||||
$this->view->msg="Sélectionnez votre fichier";
|
||||
}
|
||||
}
|
@ -104,7 +104,7 @@ class UserController extends Zend_Controller_Action
|
||||
$this->logger->info('setInfosLogin');
|
||||
$this->logger->info(print_r($options,1));
|
||||
$reponse = $ws->setInfosLogin($login, $action, $options);
|
||||
$this->logger->info(print_r($response,1));
|
||||
$this->logger->info('setInfosLogin'.print_r($response,1));
|
||||
|
||||
$isProfilUpdated = true;
|
||||
$message = 'Erreur lors de la mise à jour du compte !';
|
||||
@ -505,7 +505,11 @@ class UserController extends Zend_Controller_Action
|
||||
*/
|
||||
public function logoutAction()
|
||||
{
|
||||
Zend_Auth::getInstance()->clearIdentity();
|
||||
$auth = Zend_Auth::getInstance();
|
||||
if ( $auth->hasIdentity() ) {
|
||||
$this->identity = $auth->getIdentity();
|
||||
}
|
||||
Zend_Auth::getInstance()->clearIdentity();
|
||||
$session = new Zend_Session_Namespace('wcheck');
|
||||
$session->unsetAll();
|
||||
$this->_helper->layout()->disableLayout();
|
||||
@ -518,12 +522,14 @@ class UserController extends Zend_Controller_Action
|
||||
$this->view->assign('ajax', $ajax);
|
||||
|
||||
$refresh = 5;
|
||||
|
||||
$url = 'http://'.$_SERVER['SERVER_NAME'].$this->view->url(array(
|
||||
if($this->identity->idClient==195){//Redirection spéciale inextenso
|
||||
$url="http://inexweb.fr";
|
||||
}else{
|
||||
$url = 'http://'.$_SERVER['SERVER_NAME'].$this->view->url(array(
|
||||
'controller' => 'user',
|
||||
'action' => 'login',
|
||||
), 'default', true);
|
||||
|
||||
}
|
||||
$this->view->assign('url', $url);
|
||||
|
||||
if ( $ajax == 0 ) {
|
||||
|
@ -0,0 +1,22 @@
|
||||
<div class="panel-body">
|
||||
<h4 class="text-primary text-center">Spécialiste de l'information légale et financière sur les entreprises, Scores & Décisions vous permet par
|
||||
confirmation des éléments ci-contre d'accéder à toute sa base de données.</h4>
|
||||
|
||||
<ul class="list-group">
|
||||
<li class="list-group-item text-center">
|
||||
Télécharger nos Conditions Générales de Services
|
||||
<a href="<?=$this->baseUrl()?>/documents/inextenso_cgs.pdf" target="_blank">
|
||||
<span class="glyphicon glyphicon-file" ></span></a>
|
||||
</li>
|
||||
<li class="list-group-item text-center">
|
||||
Télécharger nos Conditions Tarifaires
|
||||
<a href="#" target="_blank">
|
||||
<span class="glyphicon glyphicon-file" ></span></a>
|
||||
</li>
|
||||
<li class="list-group-item text-center">
|
||||
Télécharger les coordonnées de vos contacts
|
||||
<a href="<?=$this->baseUrl()?>/documents/inextenso_contacts.pdf" target="_blank">
|
||||
<span class="glyphicon glyphicon-file"></span></a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
@ -28,28 +28,7 @@
|
||||
<br/>
|
||||
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-body">
|
||||
<p class="text-primary">Spécialiste de l'information légales et financières sur les entreprises, Scores & Décisions vous permet par
|
||||
confirmation des éléments ci-contre d'accéder à toute sa base de données.</p>
|
||||
|
||||
<ul class="list-group">
|
||||
<li class="list-group-item">
|
||||
Télécharger nos Conditions Générales de Services
|
||||
<a href="<?=$this->baseUrl()?>/documents/inextenso_cgs.pdf" target="_blank">
|
||||
<span class="glyphicon glyphicon-file pull-right" aria-hidden="true"></span></a>
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
Télécharger nos Conditions Tarifaires
|
||||
<a href="#" target="_blank">
|
||||
<span class="glyphicon glyphicon-file pull-right" aria-hidden="true"></span></a>
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
Télécharger les coordonnées de vos contacts
|
||||
<a href="<?=$this->baseUrl()?>/documents/inextenso_contacts.pdf" target="_blank">
|
||||
<span class="glyphicon glyphicon-file pull-right" aria-hidden="true"></span></a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<?php echo $this->partial('auth/cgu.phtml',array()); ?>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@ -72,12 +51,12 @@
|
||||
<li><strong>Découvrez la valeur de votre entreprises ou celles de vos concurrents ></strong> Mon entreprise a t elle de la
|
||||
valeur ? combien me coûterait le rachat d'un concurrent ?</li>
|
||||
|
||||
<li><strong>Trouvez vos futurs clients ></strong> Où sont et qui sont mes prospects ?</li>
|
||||
|
||||
<li><strong>Trouvez vos futurs clients ></strong> Où sont et qui sont mes prospects ?
|
||||
<p>Les données agrégées sont officielles, exhaustives, fraîches et opposables aux tiers. Elles sont utilisées
|
||||
par des grands groupes et institutionnels dans des cadres contentieux, de conformité, de fraude...</p></li>
|
||||
</ul>
|
||||
|
||||
<p>Les données agrégées sont officielles, exhaustives, fraîches et opposables aux tiers. Elles sont utilisées
|
||||
par des grands groupes et institutionnels dans des cadres contentieux, de conformité, de fraude...</p>
|
||||
|
||||
|
||||
<?php if ($this->FormUrlParams) {?>
|
||||
<a type="button" class="btn btn-success btn-lg" href="<?=$this->url($this->FormUrlParams, 'default', true)?>">Accédez au site</a>
|
||||
@ -85,7 +64,10 @@
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="bannierebas"> </div>
|
||||
<div class="alert alert-info"><?=$this->msg;?></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
@ -6,6 +6,7 @@
|
||||
<?php echo $this->headStyle(); ?>
|
||||
<?php echo $this->headLink(); ?>
|
||||
<?php echo $this->headScript(); ?>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
@ -17,34 +18,13 @@
|
||||
<div class="col-md-6">
|
||||
<p><img src="/themes/default/images/partner/<?=$this->logo?>"/></p>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-body">
|
||||
<p class="text-primary">Spécialiste de l'information légales et financières sur les entreprises, Scores & Décisions vous permet par
|
||||
confirmation des éléments ci-contre d'accéder à toute sa base de données.</p>
|
||||
|
||||
<ul class="list-group">
|
||||
<li class="list-group-item">
|
||||
Télécharger nos Conditions Générales de Services
|
||||
<a href="<?=$this->baseUrl()?>/documents/inextenso_cgs.pdf" target="_blank">
|
||||
<span class="glyphicon glyphicon-file pull-right" aria-hidden="true"></span></a>
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
Télécharger nos Conditions Tarifaires
|
||||
<a href="#" target="_blank">
|
||||
<span class="glyphicon glyphicon-file pull-right" aria-hidden="true"></span></a>
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
Télécharger les coordonnées de vos contacts
|
||||
<a href="<?=$this->baseUrl()?>/documents/inextenso_contacts.pdf" target="_blank">
|
||||
<span class="glyphicon glyphicon-file pull-right" aria-hidden="true"></span></a>
|
||||
</li>
|
||||
</ul>
|
||||
<?php echo $this->partial('auth/cgu.phtml',array()); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<span id="errors"></span>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
|
||||
<form method="post" action="<?=$this->url(array('controller'=>'auth', 'action'=>'userssocreate'), 'default', true)?>">
|
||||
<form id="ssoform" method="post" action="<?=$this->url(array('controller'=>'auth', 'action'=>'userssocreate'), 'default', true)?>">
|
||||
<h2 class="form-signin-heading">Extranet <small>Scores & Décisions</small></h2>
|
||||
<?php
|
||||
//Error
|
||||
@ -83,7 +63,7 @@
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="siret">SIRET</label>
|
||||
<label for="siret">SIRET *</label>
|
||||
<input type="text" class="form-control" name="siret" value="<?=$this->FormSiret?>">
|
||||
</div>
|
||||
|
||||
@ -102,7 +82,7 @@
|
||||
<input type="text" class="form-control" name="tel" value="<?=$this->FormTel?>">
|
||||
</div>
|
||||
|
||||
<button class="btn btn-lg btn-primary btn-block clearfix" type="submit">Valider</button>
|
||||
<button class="btn btn-lg btn-primary btn-block clearfix" id="ssosubmit" type="submit">Valider</button>
|
||||
|
||||
<?php }?>
|
||||
</form>
|
||||
@ -119,7 +99,23 @@
|
||||
<p class="text-muted credit"> © <?=date('Y')?> <a href="http://www.scores-decisions.com">Scores & Décisions SAS</a>.</p>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(function(){
|
||||
$('#ssosubmit').click(function(e){
|
||||
e.preventDefault();
|
||||
siret=$('input[name=siret]').val();
|
||||
|
||||
if(EstSiretValide(siret)){
|
||||
$('#ssoform').submit();
|
||||
}else{
|
||||
$('input[name=siret]').addClass('alert alert-danger');
|
||||
$('#errors').addClass('alert alert-danger');
|
||||
$('#errors').html('Veuillez entrer un siret valide pour vous identifier');
|
||||
}
|
||||
//$('form[name=cgu]').submit();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<?php echo $this->inlineScript(); ?>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -2,12 +2,19 @@
|
||||
<h2>Erreur</h2>
|
||||
|
||||
<div class="paragraph">
|
||||
|
||||
<div style="padding:0.7em;" class="ui-state-error ui-corner-all">
|
||||
<p><span style="float: left; margin-right: 0.3em;" class="ui-icon ui-icon-alert"></span>
|
||||
<?php if($this->portemonnaie):?>
|
||||
Votre requete n'a pas abouti.
|
||||
Merci de vérifier que vous possédez les crédits suffisants pour cette opération.
|
||||
Pour consulter ou renouveler vos crédits utiliser le
|
||||
<a href="/achatclient" class="btn">
|
||||
<button name="contact" id="contact" class="button ui-button ui-corner-all ui-widget" role="button">Porte-monnaie en ligne</button></a>
|
||||
<?php else: ?>
|
||||
Une erreur est survenue lors de votre requête...<br/>
|
||||
Un message à été envoyé à l'administrateur.<br/>
|
||||
Nous vous remercions de bien vouloir renouveler votre demande ultérieurement.
|
||||
<?php endif;?>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
@ -42,7 +42,7 @@
|
||||
<td valign="top" ><p style="text-decoration:underline;"><?=$relation->libBanque?></p>
|
||||
<?php if (empty($this->AutrePage) && $this->edition) {?>
|
||||
<a class="dialog" title="Edition RIB/IBAN" href="<?=$this->url(array('controller'=>'saisie','action'=>'ribiban','mode'=>'edit','siren'=>$this->siren, 'guichetMod'=>$relation->codeGuichet, 'banqueMod'=>$relation->codeBanque), null, true)?>"><img src="/themes/default/images/interfaces/editer.png" /></a>
|
||||
<a class="dialog" title="Supprimer RIB/IBAN" href="<?=$this->url(array('controller'=>'saisie','action'=>'ribiban','mode'=>'delete','siren'=>$this->siren, 'guichetMod'=>$relation->codeGuichet, 'banqueMod'=>$relation->codeBanque), null, true)?>"><img src="/themes/default/images/interfaces/supprimer.png" /></a>
|
||||
<a class="dialog" title="Supprimer RIB/IBAN" href="<?=$this->url(array('controller'=>'saisie','action'=>'ribiban','mode'=>'delete','siren'=>$this->siren,'siret'=>$this->siret), null, true)?>"><img src="/themes/default/images/interfaces/supprimer.png" /></a>
|
||||
<?php }?>
|
||||
</td>
|
||||
<td>
|
||||
|
@ -40,15 +40,6 @@
|
||||
</td>
|
||||
</tr>
|
||||
<?php }?>
|
||||
<?php if (0 < $this->exportObjet->TOP_CONFIDENTIEL) : ?>
|
||||
<tr>
|
||||
<td width="30"> </td>
|
||||
<td colspan="2">
|
||||
<span class="ui-icon ui-icon-info" style="float: left; margin-right: .3em;"></span>
|
||||
Ce bilan est confidentiel.
|
||||
</td>
|
||||
</tr>
|
||||
<?php endif ?>
|
||||
<?php if ( $this->champType == 'S' ) {?>
|
||||
<tr>
|
||||
<td colspan="3">
|
||||
|
@ -92,14 +92,9 @@ switch ($type) {
|
||||
$date = new Zend_Date($element->dateExercicePre, 'yyyyMMdd');
|
||||
echo $date->toString('dd/MM/yyyy');
|
||||
} ?> - <?php if ($element->dureeExercicePre > 0) {?><?=$element->dureeExercicePre?> Mois<?php } ?></td>
|
||||
<td><?php if (in_array($this->idClient, [1, 147]) || ($element->confidentielClient == $this->idClient || 0 == $element->confidentiel)) : ?>
|
||||
<a href="<?=$this->url(array('controller'=>'finance', 'action'=>'liasse',
|
||||
'siret'=>$this->siret, 'id'=>$this->id, 'date'=> $type.$element->dateExercice), 'default', true)?>">
|
||||
Visualiser
|
||||
</a>
|
||||
<?php else :?>
|
||||
Confidentiel
|
||||
<?php endif; ?>
|
||||
<td><a href="<?=$this->url(array('controller'=>'finance','action'=>'liasse',
|
||||
'siret'=>$this->siret,'id'=>$this->id, 'date'=> $type.$element->dateExercice), 'default', true)?>">
|
||||
Visualiser</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php break;?>
|
||||
@ -155,13 +150,9 @@ switch ($type) {
|
||||
?>
|
||||
- <?php if ($element->dureeExercicePre > 0) {?><?=$element->dureeExercicePre?> Mois<?php } ?>
|
||||
</td>
|
||||
<td><?php if (in_array($this->idClient, [1, 147]) || ($element->confidentielClient == $this->idClient || 0 == $element->confidentiel)) : ?>
|
||||
<a href="<?=$this->url(array('controller'=>'finance', 'action'=>'liasse', 'siret'=>$this->siret,
|
||||
'id'=>$this->id, 'date'=> $type.$element->dateExercice), 'default', true)?>">
|
||||
Visualiser</a>
|
||||
<?php else :?>
|
||||
Confidentiel
|
||||
<?php endif; ?>
|
||||
<td><a href="<?=$this->url(array('controller'=>'finance', 'action'=>'liasse', 'siret'=>$this->siret,
|
||||
'id'=>$this->id, 'date'=> $type.$element->dateExercice), 'default', true)?>">
|
||||
Visualiser</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php }?>
|
||||
|
@ -31,7 +31,7 @@ span.poste input { width:50px; }
|
||||
|
||||
<h2>Liasse</h2>
|
||||
<div class="paragraph">
|
||||
<?php if ($this->infos) { ?>
|
||||
<?php if ($this->infos) {?>
|
||||
<div class="content">
|
||||
<?php
|
||||
$params = array(
|
||||
|
@ -4,19 +4,13 @@ div#dialog fieldset {border:1px solid; padding:1px; }
|
||||
div#dialog fieldset legend {padding:5px; font-weight:bold; }
|
||||
|
||||
</style>
|
||||
<?php
|
||||
$bq=new Scores_Finance_Banques();
|
||||
$banques=$bq->getBDF_Etabs('php');
|
||||
$list_bq=json_encode($banques);
|
||||
$list_guichets=$bq->getBDF_Guichets();
|
||||
$lbanque = (array)json_decode($this->banques);
|
||||
//var_dump($lbanque);
|
||||
?>
|
||||
|
||||
|
||||
|
||||
<form name="saveRiban" action="<?=$this->url(array('controller'=>'saisie', 'action'=>'ribansave'),null, true)?>" method="post">
|
||||
<?php if($this->mode == add || $this->mode == edit){?>
|
||||
<input type="hidden" name="mode" value="<?=$this->mode?>" />
|
||||
<input type="hidden" name="siren" value="<?=$this->siren?>" />
|
||||
<?php if($this->mode == 'add' || $this->mode == 'edit'){?>
|
||||
<div class="fieldgrp">
|
||||
<label>Siren</label>
|
||||
<div class="field">
|
||||
@ -29,12 +23,10 @@ $lbanque = (array)json_decode($this->banques);
|
||||
<label>Situation RIB</label>
|
||||
<div class="field">
|
||||
<?php
|
||||
if ($this->actif==1 || (isset($lbanque['dateSuppr']) && $lbanque['dateSuppr']=='0000-00-00 00:00:00') ){
|
||||
if ($this->actif==1){
|
||||
$checkActive = 'checked';
|
||||
$checkInactive = '';
|
||||
} else {
|
||||
$checkInactive = 'checked';
|
||||
$checkActive = '';
|
||||
}
|
||||
?>
|
||||
<div style="float:left;">Active<input type="radio" name="actif" value="1" <?=$checkActive;?>/></div>
|
||||
@ -43,127 +35,79 @@ if ($this->actif==1 || (isset($lbanque['dateSuppr']) && $lbanque['dateSuppr']=='
|
||||
</div>
|
||||
|
||||
<div class="fieldgrp">
|
||||
|
||||
|
||||
<fieldset>
|
||||
<legend>Saisie RIB</legend>
|
||||
<div class="fieldgrp">
|
||||
<label>Banque</label>
|
||||
<div class="field" >
|
||||
<select name="Banque" type="text" value="<?=$this->banqueMod?>" >
|
||||
<option value="<?=$this->banqueMod?>"><?=isset($banques[$this->banqueMod])?$banques[$this->banqueMod]:$this->banqueMod?></option>
|
||||
<?php foreach($banques as $num => $name):?>
|
||||
<option value="<?=$num?>"><?=substr($name,0,40)?></option>
|
||||
<?php endforeach;?>
|
||||
</select>
|
||||
<span id="denombque"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="fieldgrp">
|
||||
<label>Guichet</label>
|
||||
<div class="field" >
|
||||
<select name="Guichet" style="width:160px;" >
|
||||
<select name="Banque" style="width:160px;" >
|
||||
<option value=""><?=$this->banqueMod?></option>
|
||||
<?php foreach( $this->banques as $val ) {?>
|
||||
<option value="<?=$val->codeBanque?>"><?=$val->codeBanque?></option>
|
||||
<?php }?>
|
||||
</select>
|
||||
<span id="denomgcht"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="fieldgrp">
|
||||
<label>Guichet</label>
|
||||
<div class="field" >
|
||||
<select name="Guichet" style="width:160px;" >
|
||||
<option value=""><?=$this->guichetMod?></option>
|
||||
<?php foreach( $this->banques as $val ) {?>
|
||||
<option value="<?=$val->codeGuichet?>"><?=$val->codeGuichet?></option>
|
||||
<?php }?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="fieldgrp">
|
||||
<label>RIB</label>
|
||||
<div class="field">
|
||||
<input type="text" name="code_banque" size="4" value="<?=(isset($lbanque['codeBanque'])?$lbanque['codeBanque']:'') ?>"/>
|
||||
<input type="text" name="code_guichet" size="4" value="<?=(isset($lbanque['codeGuichet'])?$lbanque['codeGuichet']:'') ?>"/>
|
||||
<input type="text" name="num_compte" size="32" value="<?=(isset($lbanque['numCompte'])?$lbanque['numCompte']:'') ?>"/>
|
||||
<input type="text" name="code_banque" size="4" value=""/>
|
||||
<input type="text" name="code_guichet" size="4" value=""/>
|
||||
<input type="text" name="num_compte" size="32" value=""/>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="fieldgrp">
|
||||
<fieldset>
|
||||
<legend>Saisie BIC/IBAN</legend>
|
||||
<div class="fieldgrp">
|
||||
<label>BIC/SWIFT</label>
|
||||
<div class="field">
|
||||
<input type="text" name="bic_swift" value="<?=(isset($lbanque['bic'])?$lbanque['bic']:'') ?>" size="20"/>
|
||||
<input type="text" name="bic_swift" value="" size="20"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="fieldgrp">
|
||||
<label>IBAN</label>
|
||||
<div class="field">
|
||||
<input type="text" name="iban" value="<?=(isset($lbanque['iban'])?$lbanque['iban']:'') ?>" size="47"/>
|
||||
<input type="text" name="iban" value="" size="47"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</fieldset>
|
||||
|
||||
<?php }else {?>
|
||||
<input type="hidden" name="code_banque" value="<?=(isset($lbanque['codeBanque'])?$lbanque['codeBanque']:'') ?>" />
|
||||
<input type="hidden" name="code_guichet" value="<?=(isset($lbanque['codeGuichet'])?$lbanque['codeGuichet']:'') ?>" />
|
||||
<input type="hidden" name="num_compte" value="<?=(isset($lbanque['numCompte'])?$lbanque['numCompte']:'') ?>" />
|
||||
<input type="hidden" name="bic_swift" value="<?=(isset($lbanque['bic'])?$lbanque['bic']:'') ?>" />
|
||||
<input type="hidden" name="iban" value="<?=(isset($lbanque['iban'])?$lbanque['iban']:'') ?>" />
|
||||
<p>Voulez vous supprimer ce RIB ?</p>
|
||||
<?php }?>
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
var tab_bqu=<?=$list_bq?>;
|
||||
var tab_guichet=<?=$list_guichets?>;
|
||||
var selecthtml1='<option value="<?=$this->banqueMod?>"><?=$this->banqueMod?></option>';
|
||||
$('select[name=Banque]').change(function(e){
|
||||
var num=$('select[name=Banque]').val();
|
||||
$('select[name=code_banque]').val(num);
|
||||
var selecthtml2=selecthtml1;
|
||||
for(var numg in tab_guichet[num]){
|
||||
selecthtml2+='<option value="'+numg+'">'+numg+'</option>';
|
||||
}
|
||||
$('select[name=Guichet]').html(selecthtml2);
|
||||
if($('input[name=code_banque]').val()==""){
|
||||
$('input[name=code_banque]').val(num);
|
||||
}
|
||||
});
|
||||
$('select[name=Guichet]').change(function(){
|
||||
var num=$('select[name=Banque]').val();
|
||||
var numg=$('select[name=Guichet]').val();
|
||||
$('#denomgcht').html(tab_guichet[num][numg]);
|
||||
if($('input[name=code_guichet]').val()==""){
|
||||
$('input[name=code_guichet]').val(numg);
|
||||
}
|
||||
});
|
||||
$('input[name=code_banque]').change(function(e){
|
||||
var num=$('input[name=code_banque]').val();
|
||||
$('select[name=Banque]').val(num);
|
||||
$('select[name=Banque]').change();
|
||||
});
|
||||
$('input[name=iban]').change(function(e){
|
||||
var regex = new RegExp(' ', "igm");
|
||||
var iban=$('input[name=iban]').val().replace(regex,"");
|
||||
$('input[name=iban]').val(iban);
|
||||
var num=iban.substr(4,5);
|
||||
$('select[name=Banque]').val(num);
|
||||
$('select[name=Banque]').change();
|
||||
var numg=iban.substr(9,5);
|
||||
$('select[name=Guichet]').val(num);
|
||||
$('select[name=Guichet]').change();
|
||||
});
|
||||
|
||||
$('#dialog').dialog({ buttons: [
|
||||
{ text: "Valider", click: function() {
|
||||
var form = $('form[name=saveRiban]');
|
||||
$.post(form.attr('action'), form.serialize(), function(data){
|
||||
form.replaceWith(data);
|
||||
}).done(function(data){ alert(data);
|
||||
}).fail(function(){ alert('Unknow error'); });
|
||||
} },
|
||||
{ text: "Annuler", click: function() { $(this).dialog("close"); } }
|
||||
|
@ -28,14 +28,9 @@ if ( empty($this->source) ){
|
||||
?>
|
||||
</div>
|
||||
|
||||
<h2>Traitements de masse</h2>
|
||||
<div class="paragraph">
|
||||
<h2>Extraction des surveillances</h2>
|
||||
<?=$this->action('surveillancecsv', 'surveillance')?>
|
||||
<p class="options">Demande de surveillance en série :
|
||||
<a class="dialogsurv" href="/surveillance/surveillanceserie" title="Demande de surveillance en série ">
|
||||
OK</a></p>
|
||||
|
||||
</div>
|
||||
<h2>Options de recherche</h2>
|
||||
|
||||
<div class="paragraph">
|
||||
@ -157,8 +152,7 @@ par
|
||||
'siret' => $item['siren'].$item['nic'],
|
||||
'ref' => urlencode($surveillance['ref']),
|
||||
'email' => $surveillance['email'],
|
||||
'source' => $surveillance['source'],
|
||||
'q' => $this->q,
|
||||
'source' => $surveillance['source']
|
||||
))?>" title="Supprimer la surveillance <?=$surveillance['source']?>">
|
||||
<img src="/themes/default/images/interfaces/supprimer.png"/>
|
||||
</a>
|
||||
@ -301,3 +295,4 @@ $(function() {
|
||||
?>
|
||||
});
|
||||
</script>
|
||||
|
||||
|
@ -1,70 +0,0 @@
|
||||
<div id="survForm">
|
||||
<link href="<?=$this->pathStyle?>/bsmain.css" media="all" rel="stylesheet" type="text/css">
|
||||
<?php if(intval($this->step==0)):?>
|
||||
<?php
|
||||
$cs=new Scores_Import_FileCsv();
|
||||
$msg=$cs->standardhelptext;
|
||||
?>
|
||||
<div id="msgintro" class="alert-sm alert-success"><?=$msg?>
|
||||
<br><br><center>
|
||||
<button id="btnstart" class="btn btn-sm btn-info">Le fichier est pret</button>
|
||||
</center><br><br>
|
||||
</div>
|
||||
|
||||
<?php endif;?>
|
||||
<?php if(intval($this->step==2)):?>
|
||||
<div id="center">
|
||||
<h1 class="titre">SURVEILLANCE</h1>
|
||||
<div class="paragraph">
|
||||
<div id="msgintro" class="alert-sm alert-warning"><?=$this->msg?>
|
||||
<br><br>
|
||||
|
||||
<br><br><center>
|
||||
<a href="<?=$this->url(array('controller' => 'surveillance', 'action' => 'liste'))?>" class="submit">Retour</a>
|
||||
</center><br><br>
|
||||
</div>
|
||||
|
||||
<?php endif;?>
|
||||
<div id="msg" class="alert-sm alert-danger"></div>
|
||||
<form enctype="multipart/form-data" id="fileform" action="<?=$this->url(array('controller' => 'surveillance', 'action' => 'surveillanceserie'))?>" method="POST">
|
||||
<input class="required" type="file" name="fichier" size="50000" >
|
||||
<div class="form-group">
|
||||
<?php foreach($this->tabSource as $s) : ?>
|
||||
<input type="checkbox" name="source[]" value="<?=$s['value']?>"<?=$s['select']?>/> <?=$s['name']?><br/>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label for="email">Adresse email du destinataire</label>
|
||||
<input class="required" name="email" type="text" value="<?=$this->email?>"/>
|
||||
</div>
|
||||
<input class="btn btn-sm btn-info" name="loadfile" value="Charger le fichier" type="submit">
|
||||
<input name="ref" type="hidden" value="<?=$this->ref?>"/></div>
|
||||
</form>
|
||||
</div>
|
||||
<script>
|
||||
$( "#fileform" ).hide();
|
||||
$('#btnstart').click(function( event ) {
|
||||
$( "#fileform" ).show();
|
||||
$( "#msgintro" ).hide();
|
||||
});
|
||||
$( "#fileform" ).submit(function( event ) {
|
||||
var ok=false;
|
||||
if($('input[name="source[]"]:checked').length > 0){
|
||||
ok=true;
|
||||
}
|
||||
if ( $( ".required" ).val().length === 0 ) {
|
||||
ok=false;
|
||||
}
|
||||
if(!ok){
|
||||
$('#msg').html('Merci de remplir tous les champs');
|
||||
}
|
||||
if ( $( "input[name=fichier]" ).val().substr(-4,4) != '.csv' ) {
|
||||
$('#msg').html('Format de fichier incorrect');
|
||||
ok=false;
|
||||
}
|
||||
if(!ok){
|
||||
event.preventDefault();
|
||||
}
|
||||
});</script>
|
6
composer.lock
generated
6
composer.lock
generated
@ -604,7 +604,7 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/browser-kit",
|
||||
"version": "v3.2.7",
|
||||
"version": "v3.2.6",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/browser-kit.git",
|
||||
@ -661,7 +661,7 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/css-selector",
|
||||
"version": "v3.2.7",
|
||||
"version": "v3.2.6",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/css-selector.git",
|
||||
@ -714,7 +714,7 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/dom-crawler",
|
||||
"version": "v3.2.7",
|
||||
"version": "v3.2.6",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/dom-crawler.git",
|
||||
|
@ -1,8 +0,0 @@
|
||||
<?php
|
||||
class Application_Model_CommandesSurveillance extends Zend_Db_Table_Abstract
|
||||
{
|
||||
protected $_name = 'commandes_surveillance';
|
||||
|
||||
|
||||
|
||||
}
|
71
library/Paybox/Config.php
Normal file
71
library/Paybox/Config.php
Normal file
@ -0,0 +1,71 @@
|
||||
<?php
|
||||
class Paybox_Config
|
||||
{
|
||||
protected $PBX_SITE;
|
||||
|
||||
protected $PBX_RANG;
|
||||
|
||||
protected $PBX_IDENTIFIANT;
|
||||
|
||||
protected $KEY;
|
||||
|
||||
protected $SERVER;
|
||||
|
||||
protected $URL_PAIEMENT;
|
||||
|
||||
protected $PBX_TYPEPAIEMENT="CARTE";
|
||||
|
||||
protected $PBX_TYPECARTE="VISA";
|
||||
|
||||
protected $PBX_MODE=1;
|
||||
|
||||
public function __construct($test = false)
|
||||
{
|
||||
if ($test === false) {
|
||||
Zend_Loader::loadClass('Paybox_Config_Prod');
|
||||
$config = new Paybox_Config_Prod();
|
||||
} else {
|
||||
Zend_Loader::loadClass('Paybox_Config_Test');
|
||||
$config = new Paybox_Config_Test();
|
||||
}
|
||||
|
||||
foreach ( $config->variables as $var => $value ) {
|
||||
$this->{'PBX_'.$var} = $value;
|
||||
}
|
||||
|
||||
$this->KEY = $config->key;
|
||||
$this->SERVER = $config->server;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Check server availability and set the paiement url
|
||||
* @return boolean
|
||||
*/
|
||||
public function checkservers()
|
||||
{
|
||||
$serveurOK = "";
|
||||
foreach($this->SERVER as $serveur)
|
||||
{
|
||||
$doc = new DOMDocument();
|
||||
$doc->loadHTMLFile($serveur['ping']);
|
||||
$server_status = "";
|
||||
$element = $doc->getElementById('server_status');
|
||||
if($element){
|
||||
$server_status = $element->textContent;
|
||||
}
|
||||
if($server_status == "OK"){
|
||||
//Le serveur est prêt et les services opérationnels
|
||||
$serveurOK = $serveur;
|
||||
$this->URL_PAIEMENT = $serveur['url'];
|
||||
return true;
|
||||
break;
|
||||
}
|
||||
// else : La machine est disponible mais les services ne le sont pas.
|
||||
}
|
||||
if(!$serveurOK){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
23
library/Paybox/Config/Prod.php
Normal file
23
library/Paybox/Config/Prod.php
Normal file
@ -0,0 +1,23 @@
|
||||
<?php
|
||||
class Paybox_Config_Prod
|
||||
{
|
||||
public $key = '249DE9DBD388E3430AC464ACFE23A668F1F3221432F96028468A5A0775AFEB8438C7F4DED096066109BBB5E1B2E22DC53D9D31181CC06DD4C6C1239110ADFFD7';
|
||||
|
||||
public $server = array(
|
||||
array(
|
||||
'ping' => "https://tpeweb.paybox.com/load.html",
|
||||
'url' => "https://tpeweb.paybox.com/cgi/MYchoix_pagepaiement.cgi",
|
||||
),
|
||||
array(
|
||||
'ping' => "https://tpeweb1.paybox.com/load.html",
|
||||
'url' => "https://tpeweb1.paybox.com/cgi/MYchoix_pagepaiement.cgi",
|
||||
),
|
||||
);
|
||||
|
||||
public $variables = array(
|
||||
'SITE' => '5136925',
|
||||
'RANG' => '01',
|
||||
'IDENTIFIANT' => '533616985',
|
||||
);
|
||||
|
||||
}
|
26
library/Paybox/Config/Test.php
Normal file
26
library/Paybox/Config/Test.php
Normal file
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
class Paybox_Config_Test
|
||||
{
|
||||
//public $key = '0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF';
|
||||
public $key = '249DE9DBD388E3430AC464ACFE23A668F1F3221432F96028468A5A0775AFEB8438C7F4DED096066109BBB5E1B2E22DC53D9D31181CC06DD4C6C1239110ADFFD7';
|
||||
//public $key = 'E941B48379E0C65997F52FDA8DC920B358B1AAB99A6E3CCF584F97E6AC55FB3C701DE0CC0CCFAEC82A1B0AA865CCDA36A420C4043376BBAFB51790D8480E2F77';
|
||||
public $server = array(
|
||||
array(
|
||||
'ping' => "https://preprod-tpeweb.paybox.com/load.html",
|
||||
'url' => "https://preprod-tpeweb.paybox.com/cgi/MYchoix_pagepaiement.cgi",
|
||||
),
|
||||
);
|
||||
|
||||
/*public $variables = array(
|
||||
'SITE' => '1999888',
|
||||
'RANG' => '32',
|
||||
'IDENTIFIANT' => '110647233',
|
||||
);*/
|
||||
|
||||
public $variables = array(
|
||||
'SITE' => '5136925',
|
||||
'RANG' => '01',
|
||||
'IDENTIFIANT' => '533616985',
|
||||
);
|
||||
|
||||
}
|
6
library/Paybox/Key/pubkey.pem
Normal file
6
library/Paybox/Key/pubkey.pem
Normal file
@ -0,0 +1,6 @@
|
||||
-----BEGIN PUBLIC KEY-----
|
||||
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDe+hkicNP7ROHUssGNtHwiT2Ew
|
||||
HFrSk/qwrcq8v5metRtTTFPE/nmzSkRnTs3GMpi57rBdxBBJW5W9cpNyGUh0jNXc
|
||||
VrOSClpD5Ri2hER/GcNrxVRP7RlWOqB1C03q4QYmwjHZ+zlM4OUhCCAtSWflB4wC
|
||||
Ka1g88CjFwRw/PB9kwIDAQAB
|
||||
-----END PUBLIC KEY-----
|
198
library/Paybox/Response.php
Normal file
198
library/Paybox/Response.php
Normal file
@ -0,0 +1,198 @@
|
||||
<?php
|
||||
class Paybox_Response
|
||||
{
|
||||
protected $data;
|
||||
|
||||
protected $sign;
|
||||
|
||||
protected $errCode = 0;
|
||||
|
||||
protected $errLabel = 'Impossible de valider le paiement.';
|
||||
|
||||
protected $values = array();
|
||||
|
||||
public function __construct(){}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param array $values
|
||||
*/
|
||||
public function setData($values)
|
||||
{
|
||||
if ( !array_key_exists('sign', $values) )
|
||||
return;
|
||||
|
||||
//Set and remove the sign
|
||||
$this->setSign($values['sign']);
|
||||
unset($values['sign']);
|
||||
|
||||
$this->values = $values;
|
||||
|
||||
//Concat datas with &
|
||||
$this->data = '';
|
||||
$i = 0;
|
||||
$max = count($values);
|
||||
foreach( $values as $key => $val ) {
|
||||
|
||||
if ( !in_array($key, array('eta', 'id', 'type', 'mt', 'auto', 'idtrans')))
|
||||
continue;
|
||||
|
||||
$this->data.= $key."=".urlencode($val);
|
||||
$i++;
|
||||
|
||||
if ( $i<$max ) {
|
||||
$this->data.= '&';
|
||||
}
|
||||
}
|
||||
|
||||
// If the last char is &, remove it
|
||||
if ( substr($this->data, -1) == '&' ) {
|
||||
$this->data = substr($this->data, 0, strlen($this->data)-1);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Défini la signature
|
||||
* @param string $value
|
||||
*/
|
||||
protected function setSign($value)
|
||||
{
|
||||
$this->sign = base64_decode($value);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
protected function isDataSign()
|
||||
{
|
||||
if (empty($this->data))
|
||||
return false;
|
||||
|
||||
if (empty($this->sign))
|
||||
return false;
|
||||
|
||||
$cert = file_get_contents(__DIR__.'/Key/pubkey.pem');
|
||||
|
||||
$pubkeyid = openssl_pkey_get_public($cert);
|
||||
|
||||
// state whether signature is okay or not
|
||||
$ok = openssl_verify($this->data, $this->sign, $pubkeyid, OPENSSL_ALGO_SHA1);
|
||||
|
||||
// free the key from memory
|
||||
openssl_free_key($pubkeyid);
|
||||
|
||||
if ($ok == 1) {
|
||||
return true;
|
||||
} elseif ($ok == 0) {
|
||||
return false;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Vérifie le code retour
|
||||
* @return boolean
|
||||
*/
|
||||
protected function checkEta()
|
||||
{
|
||||
$code = $this->values['eta'];
|
||||
|
||||
if ( intval($code) === 0 ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
switch($code) {
|
||||
/*
|
||||
00000
|
||||
Opération réussie.
|
||||
00001
|
||||
La connexion au centre d’autorisation a échoué ou une erreur interne est survenue. Dans ce cas, il est souhaitable de faire une tentative sur le site secondaire : tpeweb1.paybox.com.
|
||||
001xx
|
||||
Paiement refusé par le centre d’autorisation [voir §12.1 Codes réponses du centre d’autorisation].
|
||||
En cas d’autorisation de la transaction par le centre d’autorisation de la banque ou de l’établissement financier privatif, le code erreur “00100” sera en fait remplacé directement par “00000”.
|
||||
=> Liste des codes erreurs
|
||||
|
||||
00003
|
||||
Erreur Paybox. Dans ce cas, il est souhaitable de faire une tentative sur le site secondaire FQDN tpeweb1.paybox.com.
|
||||
00004
|
||||
Numéro de porteur ou cryptogramme visuel invalide.
|
||||
00006
|
||||
Accès refusé ou site/rang/identifiant incorrect.
|
||||
00008
|
||||
Date de fin de validité incorrecte.
|
||||
00009
|
||||
Erreur de création d’un abonnement.
|
||||
00010
|
||||
Devise inconnue.
|
||||
00011
|
||||
Montant incorrect.
|
||||
00015
|
||||
Paiement déjà effectué.
|
||||
00016
|
||||
Abonné déjà existant (inscription nouvel abonné). Valeur ‘U’ de la variable PBX_RETOUR.
|
||||
00021
|
||||
Carte non autorisée.
|
||||
00029
|
||||
Carte non conforme. Code erreur renvoyé lors de la documentation de la variable « PBX_EMPREINTE ».
|
||||
00030
|
||||
Temps d’attente > 15 mn par l’internaute/acheteur au niveau de la page de paiements.
|
||||
00031
|
||||
Réservé
|
||||
00032
|
||||
Réservé
|
||||
00033
|
||||
Code pays de l’adresse IP du navigateur de l’acheteur non autorisé.
|
||||
00040
|
||||
Opération sans authentification 3-DSecure, bloquée par le filtre.
|
||||
99999
|
||||
Opération en attente de validation par l’émetteur du moyen de paiement.
|
||||
*/
|
||||
|
||||
default:
|
||||
$this->errCode = 0;
|
||||
$this->errLabel = 'Validation du paiement incorrect';
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function checkData()
|
||||
{
|
||||
//Vérification de la signature
|
||||
if ( $this->isDataSign() === false ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
//Vérifier le retour des données
|
||||
$vars = array('eta');
|
||||
foreach ( $vars as $var ) {
|
||||
if ( method_exists($this, 'check'.ucfirst($var)) ) {
|
||||
if ( $this->{'check'.ucfirst($var)}() === true ) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//eta:E;id:R;type:P;pays:Y;mt:M;auto:A;idtrans:S;sign:K
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get error message
|
||||
* @return stdClass
|
||||
*/
|
||||
public function getError()
|
||||
{
|
||||
$return = new stdClass();
|
||||
$return->code = $this->errCode;
|
||||
$return->label = $this->errLabel;
|
||||
return $return;
|
||||
}
|
||||
}
|
309
library/Paybox/System.php
Normal file
309
library/Paybox/System.php
Normal file
@ -0,0 +1,309 @@
|
||||
<?php
|
||||
/*
|
||||
Page scores
|
||||
===========
|
||||
Choix du moyen de paiement
|
||||
- Liste les cartres de paiement autorisées
|
||||
|
||||
Forçage du moyen de paiement
|
||||
PBX_TYPEPAIEMENT
|
||||
PBX_TYPECARTE
|
||||
|
||||
URL de Paybox System :
|
||||
Variables à transmettre
|
||||
- PBX_SITE = Numéro de site (fourni par Paybox)
|
||||
- PBX_RANG = Numéro de rang (fourni par Paybox)
|
||||
- PBX_IDENTIFIANT = Identifiant interne (fourni par Paybox)
|
||||
- PBX_TOTAL = Montant total de la transaction
|
||||
- PBX_DEVISE = Devise de la transaction
|
||||
- PBX_CMD = Référence commande côté commerçant
|
||||
- PBX_PORTEUR = Adresse E-mail de l’acheteur
|
||||
- PBX_RETOUR = Liste des variables à retourner par Paybox
|
||||
- PBX_HASH = Type d’algorithme de hachage pour le calcul de l’empreinte
|
||||
- PBX_TIME = Horodatage de la transaction
|
||||
- PBX_HMAC = Signature calculée avec la clé secrète
|
||||
|
||||
Gestion du HMAC
|
||||
1 - Générer un clé par l'interface de backoffice
|
||||
2 - Valider la clé, reception d'un email demandant la validation (la clé est valable 31 jours)
|
||||
Pas possible plusieurs clés...
|
||||
|
||||
=> Pour le test clé définie
|
||||
|
||||
Page de paiement paybox
|
||||
========================
|
||||
Personnalisation
|
||||
- Le logo en haut de page
|
||||
- L’affichage du logo Paybox
|
||||
- Les boutons de validation/annulation/retour boutique
|
||||
- Les langues
|
||||
- Le fond d’écran
|
||||
- Et bien d’autres options via un fichier CSS
|
||||
=> Transmettre ces éléments à PayBox
|
||||
|
||||
|
||||
|
||||
*/
|
||||
class Paybox_System extends Paybox_Config
|
||||
{
|
||||
/**
|
||||
* Algorithme utilisé pour la signature du message
|
||||
* SHA512, RIPEMD160, SHA224, SHA256, SHA384, MDC2
|
||||
* @var string
|
||||
*/
|
||||
protected $PBX_HASH = 'SHA512';
|
||||
|
||||
/**
|
||||
* Date à laquelle l’empreinte HMAC a été calculée. Doit être URL-encodée
|
||||
* Date au format ISO8601.
|
||||
* @var string
|
||||
*/
|
||||
protected $PBX_TIME;
|
||||
|
||||
protected $PBX_HMAC;
|
||||
|
||||
/**
|
||||
* Référence de commande
|
||||
* @var string
|
||||
*/
|
||||
protected $PBX_CMD;
|
||||
|
||||
/**
|
||||
* Devise (monnaie)
|
||||
* Code monnaie de la transaction suivant la norme ISO 4217 (code numérique)
|
||||
* Exemples :
|
||||
* - Euro : 978
|
||||
* - US Dollar : 840
|
||||
* @var string
|
||||
*/
|
||||
protected $PBX_DEVISE = '978';
|
||||
|
||||
/**
|
||||
* URL de retour en cas de succès
|
||||
* @var string
|
||||
*/
|
||||
protected $PBX_EFFECTUE;
|
||||
|
||||
/**
|
||||
* URL de retour en cas d'abandon
|
||||
* @var string
|
||||
*/
|
||||
protected $PBX_ANNULE;
|
||||
|
||||
/**
|
||||
* URL de retour en cas de refus de paiement
|
||||
* @var string
|
||||
*/
|
||||
protected $PBX_REFUSE;
|
||||
|
||||
/**
|
||||
* URL IPN (Instant Payement Notification)
|
||||
* @var string
|
||||
*/
|
||||
protected $PBX_REPONDRE_A;
|
||||
|
||||
/**
|
||||
* Configuration de la réponse
|
||||
* Chaine <nom de variable>:<lettre> concaténé par ;
|
||||
* mt:M => Montant de la transaction
|
||||
* eta:E
|
||||
* Liste des erreurs possible
|
||||
*
|
||||
* id:R => Référence commande (précisée dans PBX_CMD)
|
||||
* auto:A => numéro d'Autorisation (numéro remis par le centre d’autorisation)
|
||||
* type:P => Type de Paiement retenu (cf. PBX_TYPEPAIEMENT)
|
||||
* idtrans:S => Numéro de TranSaction Paybox
|
||||
* pays:Y => Code paYs de la banque émettrice de la carte. Format : ISO 3166 (alphabétique)
|
||||
* sign:K => Signature sur les variables de l'URL. Format : url-encodé (toujours en dernier)
|
||||
* @var string
|
||||
*/
|
||||
protected $PBX_RETOUR = 'eta:E;id:R;type:P;mt:M;auto:A;idtrans:S;sign:K';
|
||||
|
||||
/**
|
||||
* Langue de la page de paiement
|
||||
* @var string
|
||||
*/
|
||||
protected $PBX_LANGUE = '';
|
||||
|
||||
/**
|
||||
* Adresse email du client
|
||||
* @var string
|
||||
*/
|
||||
protected $PBX_PORTEUR = '';
|
||||
|
||||
/**
|
||||
* TEST
|
||||
* Code erreur à renvoyer pour tests
|
||||
* @var string
|
||||
*/
|
||||
protected $PBX_ERRORCODETEST;
|
||||
|
||||
/**
|
||||
* ORDRE des champs pour l'affichage du formulaire et le calcul du HMAC
|
||||
* @var array
|
||||
*/
|
||||
protected $stackfields = array(
|
||||
'PBX_SITE',
|
||||
'PBX_RANG',
|
||||
'PBX_IDENTIFIANT',
|
||||
'PBX_TOTAL',
|
||||
'PBX_DEVISE',
|
||||
'PBX_CMD',
|
||||
'PBX_PORTEUR',
|
||||
'PBX_RETOUR',
|
||||
'PBX_HASH',
|
||||
'PBX_TIME',
|
||||
);
|
||||
|
||||
public $URL_PARAMETERS;
|
||||
|
||||
public function __construct($test = false) {
|
||||
parent::__construct($test);
|
||||
}
|
||||
|
||||
public function getFormUrl()
|
||||
{
|
||||
return $this->URL_PAIEMENT;
|
||||
}
|
||||
|
||||
public function getFormParameters()
|
||||
{
|
||||
$params = array();
|
||||
foreach ( $this->stackfields as $field ) {
|
||||
$value = $this->{$field};
|
||||
if ( !empty($value) ) {
|
||||
$params[] = array(
|
||||
'name' => $field,
|
||||
'value' => $value,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$params[] = array(
|
||||
'name' => 'PBX_HMAC',
|
||||
'value' => $this->PBX_HMAC,
|
||||
);
|
||||
|
||||
return $params;
|
||||
}
|
||||
|
||||
/**
|
||||
* Défini le montant
|
||||
* @param float $value
|
||||
*/
|
||||
public function setMontant($value)
|
||||
{
|
||||
$montant = str_replace(',', '', number_format($value, 2, ',', ''));
|
||||
$this->PBX_TOTAL = $montant;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the command reference
|
||||
* @param string $value
|
||||
*/
|
||||
public function setReference($value)
|
||||
{
|
||||
$this->PBX_CMD = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set user email
|
||||
* @param string $value
|
||||
*/
|
||||
public function setEmail($value)
|
||||
{
|
||||
$this->PBX_PORTEUR = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the IPN Url
|
||||
* @param string $url
|
||||
*/
|
||||
public function setUrlRepondreA($url)
|
||||
{
|
||||
$this->PBX_REPONDRE_A = $url;
|
||||
}
|
||||
|
||||
/**
|
||||
* Define URL parameters as string to calculate HMAC
|
||||
* @param string $withReturnUrl
|
||||
*/
|
||||
public function setUrlParameters($withReturnUrl = '')
|
||||
{
|
||||
if ( !empty($withReturnUrl) ) {
|
||||
$this->setReturnUrl($withReturnUrl);
|
||||
$this->stackfields = array_merge($this->stackfields, array(
|
||||
'PBX_EFFECTUE',
|
||||
'PBX_REFUSE',
|
||||
'PBX_ATTENTE',
|
||||
'PBX_ANNULE',
|
||||
));
|
||||
}
|
||||
|
||||
if ( !empty($this->PBX_REPONDRE_A) ) {
|
||||
$this->stackfields = array_merge($this->stackfields, array(
|
||||
'PBX_REPONDRE_A',
|
||||
));
|
||||
}
|
||||
|
||||
$dateTime = date('c');
|
||||
$this->PBX_TIME = $dateTime;
|
||||
$params = '';
|
||||
$i = 0;
|
||||
foreach ( $this->stackfields as $field ) {
|
||||
$value = $this->{$field};
|
||||
if ( !empty($value) ) {
|
||||
$params.= $field.'='.$value;
|
||||
$i++;
|
||||
if ( $i < count($this->stackfields) ) {
|
||||
$params.= '&';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If the last char is &, remove it
|
||||
if ( substr($params, -1) == '&' ) {
|
||||
$params = substr($params, 0, strlen($params)-1);
|
||||
}
|
||||
|
||||
$this->URL_PARAMETERS = $params;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the paiement URL if available
|
||||
* @return string|boolean
|
||||
*/
|
||||
public function setUrlPaiement()
|
||||
{
|
||||
$this->checkservers();
|
||||
|
||||
if ( !empty($this->URL_PAIEMENT) ) {
|
||||
return $this->URL_PAIEMENT;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Calcul le HMAC
|
||||
* @return void
|
||||
*/
|
||||
public function calculateHMAC()
|
||||
{
|
||||
$binKey = pack("H*", $this->KEY);
|
||||
//echo "URL_PARAMETERS : ".$this->URL_PARAMETERS;die;
|
||||
$this->PBX_HMAC = strtoupper(hash_hmac('sha512', $this->URL_PARAMETERS, $binKey));
|
||||
}
|
||||
|
||||
/**
|
||||
* Define Return URL
|
||||
* @param string $url
|
||||
*/
|
||||
public function setReturnUrl($url)
|
||||
{
|
||||
$this->PBX_EFFECTUE = $url;
|
||||
$this->PBX_REFUSE = $url;
|
||||
$this->PBX_ATTENTE = $url;
|
||||
$this->PBX_ANNULE = $url;
|
||||
}
|
||||
}
|
@ -81,7 +81,7 @@ class Scores_Auth_Adapter_Ws implements Zend_Auth_Adapter_Interface
|
||||
public function authenticate()
|
||||
{
|
||||
$ip = $_SERVER['REMOTE_ADDR'];
|
||||
if (isset($_SERVER['HTTP_X_FORWARDED_FOR']) && in_array($ip, $this->listProxyIp)) {
|
||||
if ( isset($_SERVER['HTTP_X_FORWARDED_FOR']) && in_array($ip, $this->listProxyIp)) {
|
||||
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
|
||||
}
|
||||
|
||||
@ -97,25 +97,21 @@ class Scores_Auth_Adapter_Ws implements Zend_Auth_Adapter_Interface
|
||||
|
||||
$this->logger->info(__CLASS__ . ' : '.__METHOD__);
|
||||
$this->logger->info(print_r($InfosLogin,1));
|
||||
|
||||
$identity = new stdClass();
|
||||
|
||||
// --- Erreur technique
|
||||
if ($InfosLogin === false) {
|
||||
return new Zend_Auth_Result(Zend_Auth_Result::FAILURE_UNCATEGORIZED, $identity, array("Identification impossible"));
|
||||
}
|
||||
// --- Renvoi
|
||||
elseif (is_string($InfosLogin) || $InfosLogin->error->errnum != 0) {
|
||||
// --- Renvoi
|
||||
if ( is_string($InfosLogin) || $InfosLogin->error->errnum != 0 ) {
|
||||
$message = $InfosLogin;
|
||||
return new Zend_Auth_Result(Zend_Auth_Result::FAILURE_CREDENTIAL_INVALID, $identity, array($message));
|
||||
}
|
||||
// --- Assignation identity
|
||||
elseif ($InfosLogin->result->login == $this->_username) {
|
||||
elseif ( $InfosLogin !== false && !empty($InfosLogin->result->login)) {
|
||||
$identity = new stdClass();
|
||||
if ($this->_checkIp || $this->_checkHach) {
|
||||
$this->logger->info("IN");
|
||||
$identity->password = $this->_password;
|
||||
} else {
|
||||
$identity->password = md5($InfosLogin->result->login.'|'.$this->_password);
|
||||
}
|
||||
$this->logger->info($identity->password);
|
||||
$identity->username = $InfosLogin->result->login;
|
||||
$identity->email = $InfosLogin->result->email;
|
||||
$identity->profil = $InfosLogin->result->profil;
|
||||
@ -142,12 +138,10 @@ class Scores_Auth_Adapter_Ws implements Zend_Auth_Adapter_Interface
|
||||
$identity->version = $InfosLogin->result->version;
|
||||
$identity->modeEdition = false;
|
||||
|
||||
$timeout = (!empty($InfosLogin->result->timeout)) ?
|
||||
$InfosLogin->result->timeout : $this->_timeout;
|
||||
$timeout = (!empty($InfosLogin->result->timeout)) ? $InfosLogin->result->timeout : $this->_timeout;
|
||||
$identity->timeout = $timeout;
|
||||
$identity->time = time() + $timeout;
|
||||
$lang = in_array($InfosLogin->result->lang, array('fr','en')) ?
|
||||
$InfosLogin->result->lang : 'fr';
|
||||
$lang = in_array($InfosLogin->result->lang, array('fr','en')) ? $InfosLogin->result->lang : 'fr';
|
||||
$identity->lang = $lang;
|
||||
$identity->langtmp = $lang;
|
||||
|
||||
@ -176,9 +170,8 @@ class Scores_Auth_Adapter_Ws implements Zend_Auth_Adapter_Interface
|
||||
$this->_password = $identity->password;
|
||||
return new Zend_Auth_Result(Zend_Auth_Result::SUCCESS, $identity);
|
||||
}
|
||||
// --- Fallback
|
||||
else {
|
||||
return new Zend_Auth_Result(Zend_Auth_Result::FAILURE_UNCATEGORIZED, $identity, array("Identification impossible"));
|
||||
return new Zend_Auth_Result(Zend_Auth_Result::FAILURE_UNCATEGORIZED, $identity, array("Identification impossible"));
|
||||
}
|
||||
}
|
||||
|
||||
|
File diff suppressed because one or more lines are too long
@ -1368,8 +1368,7 @@ class IdentiteEntreprise
|
||||
if($i==2) break;
|
||||
}
|
||||
switch($i){
|
||||
case 0: $unite = ' '; break;
|
||||
case 1: $unite = ' K'; break;
|
||||
case 1: $unite = ' K'; break;
|
||||
case 2: $unite = ' M'; break;
|
||||
}
|
||||
return number_format($number, 0, '', ' ').$unite;
|
||||
|
@ -1,186 +0,0 @@
|
||||
<?php
|
||||
class Scores_Import_FileCsv
|
||||
{
|
||||
private $filepath='';
|
||||
private $standardcolumns=array(
|
||||
'siren','nic','ref'
|
||||
);
|
||||
private $standarddelimiter=',';
|
||||
private $standardencoding='utf-8';
|
||||
public $standardhelptext='Le fichier attendu est un csv standard : fichier texte extension .csv contenant 3 colonnes (siren nic ref) séparées par des virgules';
|
||||
public function __construct()
|
||||
{
|
||||
$c = new Zend_Config_Ini(realpath(APPLICATION_PATH) . '/configs/application.ini');
|
||||
$ct = $c->toArray();
|
||||
$this->config=$ct[APPLICATION_ENV];
|
||||
//home/vhosts/data/extranet
|
||||
$this->filepath=$this->config['profil']['path']['shared'].'/persist/surveillance/';
|
||||
if(!is_dir($this->filepath)){
|
||||
mkdir($this->filepath);
|
||||
}
|
||||
}
|
||||
public function verifandupload($file,$request){
|
||||
$ref=$request->getParam('ref');
|
||||
$user = new Scores_Utilisateur();
|
||||
$this->login = $user->identity->username;
|
||||
//var_dump($user->identity);die;
|
||||
$this->email=$request->getParam('email');
|
||||
$this->sources=$request->getParam('source');
|
||||
|
||||
$fileinname=$file["fichier"]["name"];
|
||||
$fileType = pathinfo($fileinname,PATHINFO_EXTENSION);
|
||||
if($fileType!='csv'){
|
||||
return array('success' => false, 'message' => 'Extension incorrecte');
|
||||
}
|
||||
$fileoutname=$ref.'.csv';
|
||||
$target=$this->filepath.$fileinname;
|
||||
if (!move_uploaded_file($file["fichier"]["tmp_name"], $target)) {
|
||||
return array('success' => false, 'message' => 'Le fichier '
|
||||
. basename( $file["fichier"]["name"]). ' ne peut pas être chargé.');
|
||||
}
|
||||
$result=$this->verifyformat($fileinname,$fileoutname);
|
||||
if($result['success']){
|
||||
$row=$result['message'];
|
||||
}else{
|
||||
return $result;
|
||||
}
|
||||
$result=$this->sendtoftp($fileoutname);
|
||||
if(!$result['success']){
|
||||
return $result;
|
||||
}
|
||||
|
||||
$cmd=new Application_Model_CommandesSurveillance();
|
||||
foreach($sources as $source){
|
||||
$data= array(
|
||||
'ref' => $ref,
|
||||
'login' =>$this->login,
|
||||
'email' => $this->email,
|
||||
'filename' => $fileinname,
|
||||
'surv_source' => $source,
|
||||
'date_created' => Date('Y-m-d')
|
||||
);
|
||||
$cmd->insert($data);
|
||||
}
|
||||
$mail = new Zend_Mail('UTF-8');
|
||||
// --- Configuration du transport SMTP
|
||||
if ( $this->config['profil']['mail']['method'] == 'smtp' ) {
|
||||
$config = array();
|
||||
if ( isset($this->config['profil']['mail']['username']) ) {
|
||||
$config['username'] = $this->config['profil']['mail']['username'];
|
||||
}
|
||||
if ( isset($this->config['profil']['mail']['password']) ) {
|
||||
$config['password'] = $this->config['profil']['mail']['password'];
|
||||
}
|
||||
|
||||
if ( isset($this->config['profil']['mail']['port']) ) {
|
||||
$config['port'] = $c->profil->mail->port;
|
||||
}
|
||||
$tr = new Zend_Mail_Transport_Smtp($this->config['profil']['mail']['host'], $config);
|
||||
}
|
||||
// --- Configuration transport Sendmail
|
||||
if ( $this->config['profil']['mail']['method']== 'sendmail' ) {
|
||||
$tr = new Zend_Mail_Transport_Sendmail();
|
||||
}
|
||||
$mail->setDefaultTransport($tr);
|
||||
$mail->setBodyText(implode('###',$data));
|
||||
$mail->setFrom('support@scores-decisions.com', 'Extranet');
|
||||
$mail->addTo('supportdev@scores-decisions.com', 'Support');
|
||||
$mail->setSubject('Commande de surveillance '.$ref);
|
||||
try{
|
||||
$mail->send(); // Ne fonctionne pas en dev....
|
||||
}catch(Exception $e){
|
||||
// Ne fonctionne pas en dev.... voir en prod
|
||||
}
|
||||
|
||||
return array('success' => true, 'message' => $row);
|
||||
}
|
||||
private function verifyformat($fileinname,$fileoutname){
|
||||
$handle=fopen($this->filepath.$fileinname,'r');
|
||||
$h2=fopen($this->filepath.$fileoutname,'w');
|
||||
if(!$handle){
|
||||
return array('success' => false, 'message' => 'Fichier illisible.');
|
||||
}
|
||||
if(!$h2){
|
||||
return array('success' => false, 'message' => 'Un probleme technique est survenu merci de nous contacter avec le code erreur '.__LINE__);
|
||||
}
|
||||
ini_set("auto_detect_line_endings", true);
|
||||
$row=1;
|
||||
while (($data = fgetcsv($handle)) !== FALSE) {
|
||||
$num = count($data);
|
||||
if($num!=3){
|
||||
return array('success' => false, 'message' => 'Nombre de colonnes erronné à la ligne '.$row.'.');
|
||||
}
|
||||
if($data[0]=='siren' & $row==1){
|
||||
continue;
|
||||
}
|
||||
$data[0]=trim($data[0]);
|
||||
if(strlen($data[0])>9){
|
||||
return array('success' => false, 'message' => 'Siren mal formaté à la ligne '.$row.'.');
|
||||
}
|
||||
if(!is_numeric($data[0])){
|
||||
return array('success' => false, 'message' => 'Siren non numérique '.$data[0].' à la ligne '.$row.'.');
|
||||
}
|
||||
$siren=substr('000000000'.$data[0],-9,9);
|
||||
if(!$this->estValide($siren)){
|
||||
return array('success' => false, 'message' => 'Siren invalide '.$data[0].' à la ligne '.$row.'.');
|
||||
}
|
||||
$row++;
|
||||
$data[3]='';
|
||||
$data[4]=$this->login;
|
||||
$data[5]=$this->email;
|
||||
foreach($this->sources as $source){
|
||||
$data[3]=$source;
|
||||
fputcsv($h2,$data);
|
||||
}
|
||||
}
|
||||
fclose($handle);
|
||||
fclose($h2);
|
||||
|
||||
return array('success' => true, 'message' => $row);
|
||||
|
||||
}
|
||||
private function sendtoftp($filename){
|
||||
$connection = ftp_connect('ftp.scores-decisions.com',21);
|
||||
|
||||
$login = ftp_login($connection, 'internesd', 'internesd2017');
|
||||
|
||||
$dest='/send/'.$filename;
|
||||
|
||||
$source=$this->filepath.$filename;
|
||||
|
||||
if (!$connection || !$login) {
|
||||
return array('success' => false, 'message' => 'Un probleme technique est survenu merci de nous contacter avec le code erreur '.__LINE__);
|
||||
}
|
||||
|
||||
if(!ftp_pasv($connection, true)){
|
||||
return array('success' => false, 'message' => 'Un probleme technique est survenu merci de nous contacter avec le code erreur '.__LINE__);
|
||||
}
|
||||
$upload = ftp_put($connection, $dest, $source, FTP_BINARY);
|
||||
|
||||
if (!$upload) {
|
||||
return array('success' => false, 'message' => 'Un probleme technique est survenu merci de nous contacter avec le code erreur '.__LINE__);
|
||||
}
|
||||
|
||||
ftp_close($connection);
|
||||
return array('success' => true, 'message' => '');
|
||||
}
|
||||
private function estValide($siren){
|
||||
// Donc le SIREN est un numérique à 9 chiffres
|
||||
$somme = 0;
|
||||
for ($cpt = 0; $cpt<strlen($siren); $cpt++) {
|
||||
if (($cpt % 2) == 1) { // Les positions paires : 2ème, 4ème, 6ème et 8ème chiffre
|
||||
$tmp = substr($siren,$cpt,1) * 2; // On le multiplie par 2
|
||||
if ($tmp > 9)
|
||||
$tmp -= 9; // Si le résultat est supérieur à 9, on lui soustrait 9
|
||||
}
|
||||
else
|
||||
$tmp = substr($siren,$cpt,1);
|
||||
$somme += (int)$tmp;
|
||||
}
|
||||
if (($somme % 10) == 0)
|
||||
return true; // Si la somme est un multiple de 10 alors le SIREN est valide
|
||||
else
|
||||
return false;
|
||||
|
||||
}
|
||||
}
|
@ -71,6 +71,7 @@ class Scores_Utilisateur
|
||||
$identity->lang = $lang;
|
||||
$identity->langtmp = $lang;
|
||||
$identity->browser = $this->getBrowserInfo();
|
||||
$identity->siret = $InfosLogin->result->siret;
|
||||
|
||||
$this->identity = $identity;
|
||||
|
||||
@ -277,6 +278,14 @@ class Scores_Utilisateur
|
||||
return $hasPref;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne le siret du client
|
||||
*/
|
||||
public function getSiret()
|
||||
{
|
||||
return $this->identity->siret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retourne la langue par défaut du client
|
||||
*/
|
||||
|
@ -46,6 +46,9 @@ return array(
|
||||
'setUserEmail' => array(
|
||||
'log' => 'mail',
|
||||
),
|
||||
'setUserSiret' => array(
|
||||
'log' => 'mail',
|
||||
),
|
||||
'setUserPassword' => array(
|
||||
'log' => 'mail',
|
||||
),
|
||||
|
34
library/Scores/Ws/Client/Credit.php
Normal file
34
library/Scores/Ws/Client/Credit.php
Normal file
@ -0,0 +1,34 @@
|
||||
<?php
|
||||
return array(
|
||||
'0.1' => array(
|
||||
'payCredit' => array(
|
||||
'debug' => true,
|
||||
'errorMsg' => array('MSG'),
|
||||
),
|
||||
'infoCredit' => array(
|
||||
'debug' => true,
|
||||
'errorMsg' => array('MSG'),
|
||||
),
|
||||
'mensuelconsoCredit' => array(
|
||||
'debug' => true,
|
||||
'errorMsg' => array('MSG'),
|
||||
),
|
||||
'useCredit' => array(
|
||||
'debug' => true,
|
||||
'errorMsg' => array('MSG'),
|
||||
),
|
||||
'contactCredit' => array(
|
||||
'debug' => true,
|
||||
'errorMsg' => array('MSG'),
|
||||
),
|
||||
'getcontactsCredit' => array(
|
||||
'debug' => true,
|
||||
'errorMsg' => array('MSG'),
|
||||
),
|
||||
'getfactinfosCredit' => array(
|
||||
'debug' => true,
|
||||
'errorMsg' => array('MSG'),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
@ -5,17 +5,7 @@ return array(
|
||||
'debug' => true,
|
||||
'log' => 'mail',
|
||||
),
|
||||
'dupliqueAnnonce' => array(
|
||||
'debug' => true,
|
||||
'errorMsg' => array('MSG'),
|
||||
'log' => 'mail',
|
||||
),
|
||||
'setRib' => array(
|
||||
'debug' => true,
|
||||
'errorMsg' => array('MSG'),
|
||||
'log' => 'mail',
|
||||
),
|
||||
'getRib' => array(
|
||||
'dupliqueAnnonce' => array(
|
||||
'debug' => true,
|
||||
'errorMsg' => array('MSG'),
|
||||
'log' => 'mail',
|
||||
|
@ -45,6 +45,12 @@ class WsScores
|
||||
*/
|
||||
protected $logger;
|
||||
|
||||
/**
|
||||
* Free service
|
||||
* @var boolean
|
||||
*/
|
||||
public $freeService=false;
|
||||
|
||||
/**
|
||||
* Load WebService config
|
||||
* @param string $login
|
||||
@ -192,6 +198,7 @@ class WsScores
|
||||
if ($this->cacheWrite) {
|
||||
$cache = new Cache($filename);
|
||||
if ($cache->exist() && $this->cacheEnable ){
|
||||
$this->decLog('getContactEt');
|
||||
return $cache->getBlock();
|
||||
}
|
||||
}
|
||||
@ -283,6 +290,7 @@ class WsScores
|
||||
if ($this->cacheWrite) {
|
||||
$cache = new Cache($filename);
|
||||
if ($cache->exist() && $this->cacheEnable ){
|
||||
if(!$this->decLog('getValo',$siren)){return false;}
|
||||
return $cache->getBlock();
|
||||
}
|
||||
}
|
||||
@ -405,24 +413,24 @@ class WsScores
|
||||
}
|
||||
}
|
||||
|
||||
public function getCatalogCity($id, $columns)
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->id = $id;
|
||||
$params->columns = $columns;
|
||||
$client = $this->loadClient('catalog');
|
||||
try {
|
||||
$reponse = $client->getCity($params);
|
||||
return $reponse->getCityResult;
|
||||
} catch (SoapFault $fault) {
|
||||
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
|
||||
return $fault->faultstring;
|
||||
} else {
|
||||
echo $client->__getLastResponse();
|
||||
//$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
public function getCatalogCity($id, $columns)
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->id = $id;
|
||||
$params->columns = $columns;
|
||||
$client = $this->loadClient('catalog');
|
||||
try {
|
||||
$reponse = $client->getCity($params);
|
||||
return $reponse->getCityResult;
|
||||
} catch (SoapFault $fault) {
|
||||
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
|
||||
return $fault->faultstring;
|
||||
} else {
|
||||
echo $client->__getLastResponse();
|
||||
//$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function getCatalogLegalForm($id, $columns)
|
||||
@ -501,42 +509,42 @@ class WsScores
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Score Cut Off
|
||||
* @param string $siren
|
||||
* @return Cutoff values or False
|
||||
*/
|
||||
public function getScoreCutoff($siren)
|
||||
{
|
||||
/**
|
||||
* Get Score Cut Off
|
||||
* @param string $siren
|
||||
* @return Cutoff values or False
|
||||
*/
|
||||
public function getScoreCutoff($siren)
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->siren = $siren;
|
||||
$client = $this->loadClient('saisie');
|
||||
try {
|
||||
$reponse = $client->getScoreCutoff($params);
|
||||
return $reponse->getScoreCutoffResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$params->siren = $siren;
|
||||
$client = $this->loadClient('saisie');
|
||||
try {
|
||||
$reponse = $client->getScoreCutoff($params);
|
||||
return $reponse->getScoreCutoffResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->logger->info($fault->faultcode.':'.$fault->faultstring);
|
||||
return $fault->faultstring;
|
||||
}
|
||||
return $fault->faultstring;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete Score Cut Off
|
||||
* @param string $siren
|
||||
* @return boolean
|
||||
*/
|
||||
public function delScoreCutoff($siren)
|
||||
{
|
||||
/**
|
||||
* Delete Score Cut Off
|
||||
* @param string $siren
|
||||
* @return boolean
|
||||
*/
|
||||
public function delScoreCutoff($siren)
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->siren = $siren;
|
||||
$client = $this->loadClient('saisie');
|
||||
try {
|
||||
$reponse = $client->delScoreCutoff($params); //change name when webservice is ready
|
||||
return $reponse->delScoreCutoffResult; //change name when webservice is ready
|
||||
} catch (SoapFault $fault) {
|
||||
$params->siren = $siren;
|
||||
$client = $this->loadClient('saisie');
|
||||
try {
|
||||
$reponse = $client->delScoreCutoff($params); //change name when webservice is ready
|
||||
return $reponse->delScoreCutoffResult; //change name when webservice is ready
|
||||
} catch (SoapFault $fault) {
|
||||
$this->logger->info($fault->faultcode.':'.$fault->faultstring);
|
||||
return $fault->faultstring;
|
||||
}
|
||||
return $fault->faultstring;
|
||||
}
|
||||
}
|
||||
|
||||
public function searchLogin($idClient, $query)
|
||||
@ -884,18 +892,18 @@ class WsScores
|
||||
$params->type = $type;
|
||||
$params->libelle = $libelle;
|
||||
$params->date = $date;
|
||||
$client = $this->loadClient('saisie');
|
||||
try {
|
||||
$reponse = $client->setActeAsso($params);
|
||||
return $reponse->setActeAssoResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->logger->info($fault->faultcode.':'.$fault->faultstring);
|
||||
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
|
||||
return $fault->faultstring;
|
||||
} else {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
$client = $this->loadClient('saisie');
|
||||
try {
|
||||
$reponse = $client->setActeAsso($params);
|
||||
return $reponse->setActeAssoResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->logger->info($fault->faultcode.':'.$fault->faultstring);
|
||||
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
|
||||
return $fault->faultstring;
|
||||
} else {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -943,14 +951,14 @@ class WsScores
|
||||
$params->identifiant = $identifiant;
|
||||
$params->position = $position;
|
||||
$params->nbRep = $nbRep;
|
||||
$client = $this->loadClient('pieces');
|
||||
try {
|
||||
$reponse = $client->getBilans($params);
|
||||
return $reponse->getBilansResult;
|
||||
$client = $this->loadClient('pieces');
|
||||
try {
|
||||
$reponse = $client->getBilans($params);
|
||||
return $reponse->getBilansResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->logger->info($fault->faultcode.':'.$fault->faultstring);
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
$this->logger->info($fault->faultcode.':'.$fault->faultstring);
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -964,21 +972,21 @@ class WsScores
|
||||
*/
|
||||
public function getPiecesBilan($siren, $type, $diffusion, $dateCloture, $reference = '')
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params = new stdClass();
|
||||
$params->identifiant = $siren;
|
||||
$params->dateCloture = $dateCloture;
|
||||
$params->type = $type;
|
||||
$params->diffusion = $diffusion;
|
||||
$params->reference = $reference;
|
||||
$client = $this->loadClient('pieces');
|
||||
try {
|
||||
$client = $this->loadClient('pieces');
|
||||
try {
|
||||
$reponse = $client->getBilan($params);
|
||||
$this->logger->info(print_r($reponse,1));
|
||||
return $reponse->getBilanResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->logger->info($fault->faultcode.':'.$fault->faultstring);
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
$this->logger->info(print_r($reponse,1));
|
||||
return $reponse->getBilanResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->logger->info($fault->faultcode.':'.$fault->faultstring);
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1103,15 +1111,15 @@ class WsScores
|
||||
*/
|
||||
public function getUser($login)
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->login = $login;
|
||||
$client = $this->loadClient('gestion');
|
||||
try {
|
||||
$reponse = $client->getUser($params);
|
||||
return $reponse->getUserResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
$params = new stdClass();
|
||||
$params->login = $login;
|
||||
$client = $this->loadClient('gestion');
|
||||
try {
|
||||
$reponse = $client->getUser($params);
|
||||
return $reponse->getUserResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1170,17 +1178,18 @@ class WsScores
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->siren = $siren;
|
||||
$client = $this->loadClient('interne');
|
||||
try {
|
||||
$reponse = $client->getGroupeInfos($params);
|
||||
return $reponse->getGroupeInfosResult;
|
||||
$client = $this->loadClient('interne');
|
||||
if(!$this->decLog('getGroupeInfos',$siren)){return false;}
|
||||
try {
|
||||
$reponse = $client->getGroupeInfos($params);
|
||||
return $reponse->getGroupeInfosResult;
|
||||
} catch (SoapFault $fault) {
|
||||
if ( in_array($fault->faultcode, array('Error')) ){
|
||||
return $fault->faultstring;
|
||||
} else {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1196,11 +1205,12 @@ class WsScores
|
||||
$filename.= '-0';
|
||||
if ($stopAtIsin === true) {
|
||||
$filename.= '-1';
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->cacheWrite) {
|
||||
$cache = new Cache($filename);
|
||||
if ($cache->exist() && $this->cacheEnable ){
|
||||
$this->decLog('getGroupesArbo',$siren);
|
||||
return $cache->getBlock();
|
||||
}
|
||||
}
|
||||
@ -1214,7 +1224,7 @@ class WsScores
|
||||
try {
|
||||
$reponse = $client->getGroupesArbo($params);
|
||||
if ($this->cacheWrite) {
|
||||
$cache->deletefile();
|
||||
$cache->deletefile();
|
||||
$cache->setBlock($reponse->getGroupesArboResult);
|
||||
}
|
||||
return $reponse->getGroupesArboResult;
|
||||
@ -1304,6 +1314,7 @@ class WsScores
|
||||
if ($this->cacheWrite) {
|
||||
$cache = new Cache($filename);
|
||||
if ($cache->exist() && $this->cacheEnable ){
|
||||
$this->decLog('getListeDepots');
|
||||
return $cache->getBlock();
|
||||
}
|
||||
}
|
||||
@ -1474,6 +1485,7 @@ class WsScores
|
||||
if ($this->cacheWrite) {
|
||||
$cache = new Cache($filename);
|
||||
if ($cache->exist() && $this->cacheEnable ){
|
||||
if(!$this->decLog('getRapport',$siren)){return false;}
|
||||
return $cache->getBlock();
|
||||
}
|
||||
}
|
||||
@ -1588,6 +1600,11 @@ class WsScores
|
||||
if ($this->cacheWrite) {
|
||||
$cache = new Cache($filename);
|
||||
if ($cache->exist() && $this->cacheEnable ){
|
||||
if($niveau==4){
|
||||
if(!$this->decLog('getReportSynthese',$siren)){return false;}
|
||||
}else{
|
||||
if(!$this->decLog('getIndiScore',$siren)){return false;}
|
||||
}
|
||||
return $cache->getBlock();
|
||||
}
|
||||
}
|
||||
@ -1898,7 +1915,8 @@ class WsScores
|
||||
$filename = 'listejalcollecte';
|
||||
$cache = new Cache($filename);
|
||||
if ($cache->exist() && $this->cacheEnable ){
|
||||
return $cache->getBlock();
|
||||
$this->decLog('getListeJalCollecte');
|
||||
return $cache->getBlock();
|
||||
}
|
||||
$params = new stdClass();
|
||||
$client = $this->loadClient('interne');
|
||||
@ -1913,28 +1931,28 @@ class WsScores
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getListeDepartements
|
||||
* Liste des départements
|
||||
/**
|
||||
* getListeDepartements
|
||||
* Liste des départements
|
||||
*/
|
||||
public function getCatalogDepartements($id, $columns)
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->id = $id;
|
||||
$params->columns = $columns;
|
||||
$client = $this->loadClient('catalog');
|
||||
try {
|
||||
$reponse = $client->getDepartements($params);
|
||||
return $reponse->getDepartementsResult;
|
||||
} catch (SoapFault $fault) {
|
||||
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
|
||||
return $fault->faultstring;
|
||||
} else {
|
||||
echo $client->__getLastResponse();
|
||||
//$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
public function getCatalogDepartements($id, $columns)
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->id = $id;
|
||||
$params->columns = $columns;
|
||||
$client = $this->loadClient('catalog');
|
||||
try {
|
||||
$reponse = $client->getDepartements($params);
|
||||
return $reponse->getDepartementsResult;
|
||||
} catch (SoapFault $fault) {
|
||||
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
|
||||
return $fault->faultstring;
|
||||
} else {
|
||||
echo $client->__getLastResponse();
|
||||
//$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -2061,6 +2079,7 @@ class WsScores
|
||||
if ($this->cacheWrite) {
|
||||
$cache = new Cache($filename);
|
||||
if ($cache->exist() && $this->cacheEnable ){
|
||||
if(!$this->decLog('getMarques', $siren)){return false;}
|
||||
return $cache->getBlock();
|
||||
}
|
||||
}
|
||||
@ -2094,6 +2113,7 @@ class WsScores
|
||||
if ($this->cacheWrite) {
|
||||
$cache = new Cache($filename);
|
||||
if ($cache->exist() && $this->cacheEnable ){
|
||||
if(!$this->decLog('getListeConventions',$siren)){return false;}
|
||||
return $cache->getBlock();
|
||||
}
|
||||
}
|
||||
@ -2128,6 +2148,7 @@ class WsScores
|
||||
if ($this->cacheWrite) {
|
||||
$cache = new Cache($filename);
|
||||
if ($cache->exist() && $this->cacheEnable ){
|
||||
if(!$this->decLog('getListeCompetences',$siren)){return false;}
|
||||
return $cache->getBlock();
|
||||
}
|
||||
}
|
||||
@ -2162,6 +2183,7 @@ class WsScores
|
||||
if ($this->cacheWrite) {
|
||||
$cache = new Cache($filename);
|
||||
if ($cache->exist() && $this->cacheEnable ){
|
||||
if(!$this->decLog('getInfosReg',$siren)){return false;}
|
||||
return $cache->getBlock();
|
||||
}
|
||||
}
|
||||
@ -2185,11 +2207,11 @@ class WsScores
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function getAnnoncesNum($siren)
|
||||
{
|
||||
$filename = 'annoncesnum-'.$siren;
|
||||
$filename = 'annoncesnum-'.$siren;
|
||||
|
||||
if ($this->cacheWrite) {
|
||||
$cache = new Cache($filename);
|
||||
@ -2197,57 +2219,58 @@ class WsScores
|
||||
return $cache->getBlock();
|
||||
}
|
||||
}
|
||||
|
||||
$params = new stdClass();
|
||||
$params->siren = $siren;
|
||||
$client = $this->loadClient('entreprise');
|
||||
try {
|
||||
$reponse = $client->getAnnoncesNum($params);
|
||||
|
||||
$params = new stdClass();
|
||||
$params->siren = $siren;
|
||||
$client = $this->loadClient('entreprise');
|
||||
try {
|
||||
$reponse = $client->getAnnoncesNum($params);
|
||||
if ($this->cacheWrite) {
|
||||
$cache->deletefile();
|
||||
$cache->deletefile();
|
||||
$cache->setBlock($reponse->getAnnoncesNumResult);
|
||||
}
|
||||
return $reponse->getAnnoncesNumResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
return $reponse->getAnnoncesNumResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public function getAnnoncesBalo($siren, $idAnn=null, $filtre=null, $position=0, $nbRep=20)
|
||||
{
|
||||
$filename = 'annoncesbalo-'.$siren.'-'.$idAnn.'-'.$position.'-'.$nbRep;
|
||||
$filename = 'annoncesbalo-'.$siren.'-'.$idAnn.'-'.$position.'-'.$nbRep;
|
||||
|
||||
if ($this->cacheWrite) {
|
||||
$cache = new Cache($filename);
|
||||
if ($cache->exist() && $this->cacheEnable ){
|
||||
if(!$this->decLog('getAnnoncesBalo',$siren)){return false;}
|
||||
return $cache->getBlock();
|
||||
}
|
||||
}
|
||||
|
||||
$params = new stdClass();
|
||||
$params->siren = $siren;
|
||||
|
||||
$params = new stdClass();
|
||||
$params->siren = $siren;
|
||||
$params->idAnn = $idAnn;
|
||||
$params->filtre = $filtre;
|
||||
$params->position = $position;
|
||||
$params->nbRep = $nbRep;
|
||||
$client = $this->loadClient('entreprise');
|
||||
try {
|
||||
$params->nbRep = $nbRep;
|
||||
$client = $this->loadClient('entreprise');
|
||||
try {
|
||||
$reponse = $client->getAnnoncesBalo($params);
|
||||
if ($this->cacheWrite) {
|
||||
$cache->deletefile();
|
||||
$cache->deletefile();
|
||||
$cache->setBlock($reponse->getAnnoncesBaloResult);
|
||||
}
|
||||
return $reponse->getAnnoncesBaloResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
return $reponse->getAnnoncesBaloResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public function getAnnoncesBoamp($siren, $idAnn=null, $filtre = null, $position=0, $nbRep=20)
|
||||
{
|
||||
$filename = 'annoncesboamp-'.$siren.'-'.$filtre.'-'.$position.'-'.$nbRep;
|
||||
public function getAnnoncesBoamp($siren, $idAnn=null, $filtre = null, $position=0, $nbRep=20)
|
||||
{
|
||||
$filename = 'annoncesboamp-'.$siren.'-'.$filtre.'-'.$position.'-'.$nbRep;
|
||||
|
||||
if ($idAnn !== null) {
|
||||
$filename = 'annoncesboamp-'.$siren.'-'.$filtre.'-'.$idAnn.'-'.$position.'-'.$nbRep;
|
||||
@ -2256,101 +2279,104 @@ class WsScores
|
||||
if ($this->cacheWrite) {
|
||||
$cache = new Cache($filename);
|
||||
if ($cache->exist() && $this->cacheEnable ){
|
||||
if(!$this->decLog('getAnnoncesBoamp',$siren)){return false;}
|
||||
return $cache->getBlock();
|
||||
}
|
||||
}
|
||||
|
||||
$params = new stdClass();
|
||||
$params->siren = $siren;
|
||||
|
||||
$params = new stdClass();
|
||||
$params->siren = $siren;
|
||||
$params->idAnn = $idAnn;
|
||||
|
||||
$params->filtre = null;
|
||||
if (!empty($filtre) && in_array($filtre,array('A','M'))) {
|
||||
$filtreStruct = new stdClass();
|
||||
$filtreStruct->key = 'type';
|
||||
$filtreStruct->key = 'type';
|
||||
$filtreStruct->value = $filtre;
|
||||
$params->filtre[] = $filtreStruct;
|
||||
}
|
||||
|
||||
$params->position = $position;
|
||||
$params->nbRep = $nbRep;
|
||||
$client = $this->loadClient('entreprise');
|
||||
try {
|
||||
|
||||
$params->position = $position;
|
||||
$params->nbRep = $nbRep;
|
||||
$client = $this->loadClient('entreprise');
|
||||
try {
|
||||
$reponse = $client->getAnnoncesBoamp($params);
|
||||
if ($this->cacheWrite) {
|
||||
$cache->deletefile();
|
||||
$cache->deletefile();
|
||||
$cache->setBlock($reponse->getAnnoncesBoampResult);
|
||||
}
|
||||
return $reponse->getAnnoncesBoampResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return $reponse->getAnnoncesBoampResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public function getAnnoncesAsso($siren, $idAnn=null, $filtre=null, $position=0, $nbRep=20)
|
||||
{
|
||||
$filename = 'annoncesasso-'.$siren.'-'.$idAnn.'-'.$position.'-'.$nbRep;
|
||||
public function getAnnoncesAsso($siren, $idAnn=null, $filtre=null, $position=0, $nbRep=20)
|
||||
{
|
||||
$filename = 'annoncesasso-'.$siren.'-'.$idAnn.'-'.$position.'-'.$nbRep;
|
||||
|
||||
if ($this->cacheWrite) {
|
||||
$cache = new Cache($filename);
|
||||
if ($cache->exist() && $this->cacheEnable ){
|
||||
if(!$this->decLog('getAnnoncesAsso',$siren)){return false;}
|
||||
return $cache->getBlock();
|
||||
}
|
||||
}
|
||||
|
||||
$params = new stdClass();
|
||||
$params->siren = $siren;
|
||||
|
||||
$params = new stdClass();
|
||||
$params->siren = $siren;
|
||||
$params->idAnn = $idAnn;
|
||||
$params->filtre = $filtre;
|
||||
$params->position = $position;
|
||||
$params->nbRep = $nbRep;
|
||||
$client = $this->loadClient('entreprise');
|
||||
try {
|
||||
$reponse = $client->getAnnoncesAsso($params);
|
||||
$params->filtre = $filtre;
|
||||
$params->position = $position;
|
||||
$params->nbRep = $nbRep;
|
||||
$client = $this->loadClient('entreprise');
|
||||
try {
|
||||
$reponse = $client->getAnnoncesAsso($params);
|
||||
if ($this->cacheWrite) {
|
||||
$cache->deletefile();
|
||||
$cache->deletefile();
|
||||
$cache->setBlock($reponse->getAnnoncesAssoResult);
|
||||
}
|
||||
return $reponse->getAnnoncesAssoResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return $reponse->getAnnoncesAssoResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public function getAnnoncesLegales($siren, $idAnn=null, $filtre=null, $position=0, $nbRep=20)
|
||||
{
|
||||
$filename = 'annonceslegales-'.$siren.'-'.$idAnn.'-'.$position.'-'.$nbRep;
|
||||
public function getAnnoncesLegales($siren, $idAnn=null, $filtre=null, $position=0, $nbRep=20)
|
||||
{
|
||||
$filename = 'annonceslegales-'.$siren.'-'.$idAnn.'-'.$position.'-'.$nbRep;
|
||||
|
||||
if ($this->cacheWrite) {
|
||||
$cache = new Cache($filename);
|
||||
if ($cache->exist() && $this->cacheEnable ){
|
||||
if(!$this->decLog('getAnnoncesLegales',$siren)){return false;}
|
||||
return $cache->getBlock();
|
||||
}
|
||||
}
|
||||
|
||||
$params = new stdClass();
|
||||
$params->siren = $siren;
|
||||
|
||||
$params = new stdClass();
|
||||
$params->siren = $siren;
|
||||
$params->idAnn = $idAnn;
|
||||
$params->filtre = $filtre;
|
||||
$params->position = $position;
|
||||
$params->nbRep = $nbRep;
|
||||
$client = $this->loadClient('entreprise');
|
||||
try {
|
||||
$reponse = $client->getAnnoncesLegales($params);
|
||||
$this->logger->info(print_r($reponse,1));
|
||||
$params->filtre = $filtre;
|
||||
$params->position = $position;
|
||||
$params->nbRep = $nbRep;
|
||||
$client = $this->loadClient('entreprise');
|
||||
try {
|
||||
$reponse = $client->getAnnoncesLegales($params);
|
||||
$this->logger->info(print_r($reponse,1));
|
||||
if ($this->cacheWrite) {
|
||||
$cache->deletefile();
|
||||
$cache->deletefile();
|
||||
$cache->setBlock($reponse->getAnnoncesLegalesResult);
|
||||
}
|
||||
return $reponse->getAnnoncesLegalesResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return $reponse->getAnnoncesLegalesResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* getAnnonces
|
||||
* @param string $siren
|
||||
@ -2366,6 +2392,7 @@ class WsScores
|
||||
if ($this->cacheWrite) {
|
||||
$cache = new Cache($filename);
|
||||
if ($cache->exist() && $this->cacheEnable ){
|
||||
$this->decLog('getAnnonces',$siren);
|
||||
return $cache->getBlock();
|
||||
}
|
||||
}
|
||||
@ -2457,11 +2484,25 @@ class WsScores
|
||||
*/
|
||||
public function getListeBilans($siren)
|
||||
{
|
||||
$filename = 'listebilans-'.$siren;
|
||||
|
||||
if ($this->cacheWrite) {
|
||||
$cache = new Cache($filename);
|
||||
if ($cache->exist() && $this->cacheEnable ){
|
||||
if(!$this->decLog('getListeBilans',$siren)){return false;}
|
||||
return $cache->getBlock();
|
||||
}
|
||||
}
|
||||
|
||||
$params = new StdClass;
|
||||
$params->siren = $siren;
|
||||
$client = $this->loadClient('entreprise');
|
||||
try {
|
||||
$reponse = $client->getListeBilans($params);
|
||||
if ($this->cacheWrite) {
|
||||
$cache->deletefile();
|
||||
$cache->setBlock($reponse->getListeBilansResult);
|
||||
}
|
||||
return $reponse->getListeBilansResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
@ -2483,6 +2524,7 @@ class WsScores
|
||||
if ($this->cacheWrite) {
|
||||
$cache = new Cache($filename);
|
||||
if ($cache->exist() && $this->cacheEnable ){
|
||||
if(!$this->decLog('getBilan',$siren)){return false;}
|
||||
return $cache->getBlock();
|
||||
}
|
||||
}
|
||||
@ -2517,6 +2559,7 @@ class WsScores
|
||||
if ($this->cacheWrite) {
|
||||
$cache = new Cache($filename);
|
||||
if ($cache->exist() && $this->cacheEnable ){
|
||||
if(!$this->decLog('getBanques',$siren)){return false;}
|
||||
return $cache->getBlock();
|
||||
}
|
||||
}
|
||||
@ -2548,6 +2591,7 @@ class WsScores
|
||||
if ($this->cacheWrite) {
|
||||
$cache = new Cache($filename);
|
||||
if ($cache->exist() && $this->cacheEnable ){
|
||||
if(!$this->decLog('getInfosBourse',$siren)){return false;}
|
||||
return $cache->getBlock();
|
||||
}
|
||||
}
|
||||
@ -2579,12 +2623,26 @@ class WsScores
|
||||
*/
|
||||
public function getRatios($siren, $page = 'ratios')
|
||||
{
|
||||
$filename = 'ratios-'.$siren.'-'.$page;
|
||||
|
||||
if ($this->cacheWrite) {
|
||||
$cache = new Cache($filename);
|
||||
if ($cache->exist() && $this->cacheEnable ){
|
||||
if(!$this->decLog('get'.ucfirst($page),$siren)){return false;}
|
||||
return $cache->getBlock();
|
||||
}
|
||||
}
|
||||
|
||||
$params = new StdClass();
|
||||
$params->siren = $siren;
|
||||
$params->page = $page;
|
||||
$client = $this->loadClient('entreprise');
|
||||
try {
|
||||
$reponse = $client->getRatios($params);
|
||||
if ($this->cacheWrite) {
|
||||
$cache->deletefile();
|
||||
$cache->setBlock($reponse->getRatiosResult);
|
||||
}
|
||||
return $reponse->getRatiosResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
@ -2605,6 +2663,7 @@ class WsScores
|
||||
if ($this->cacheWrite) {
|
||||
$cache = new Cache($filename);
|
||||
if ($cache->exist() && $this->cacheEnable ){
|
||||
if(!$this->decLog('getDirigeants',$siren)){return false;}
|
||||
return $cache->getBlock();
|
||||
}
|
||||
}
|
||||
@ -2637,6 +2696,7 @@ class WsScores
|
||||
if ($this->cacheWrite) {
|
||||
$cache = new Cache($filename);
|
||||
if ($cache->exist() && $this->cacheEnable ){
|
||||
$this->decLog('getDirigeantsOp');
|
||||
return $cache->getBlock();
|
||||
}
|
||||
}
|
||||
@ -2658,29 +2718,29 @@ class WsScores
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* setDirigeantsOp
|
||||
* @param array $infos
|
||||
*/
|
||||
public function setDirigeantsOp($infos, $mode, $id)
|
||||
{
|
||||
$params = new stdClass();
|
||||
/**
|
||||
* setDirigeantsOp
|
||||
* @param array $infos
|
||||
*/
|
||||
public function setDirigeantsOp($infos, $mode, $id)
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->infos = $infos;
|
||||
$params->mode = $mode;
|
||||
$params->id = $id;
|
||||
$client = $this->loadClient('saisie');
|
||||
try {
|
||||
$reponse = $client->setDirigeantsOp($params);
|
||||
return $reponse->setDirigeantsOpResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->logger->info($fault->faultcode.':'.$fault->faultstring);
|
||||
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
|
||||
return $fault->faultstring;
|
||||
} else {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
$params->mode = $mode;
|
||||
$params->id = $id;
|
||||
$client = $this->loadClient('saisie');
|
||||
try {
|
||||
$reponse = $client->setDirigeantsOp($params);
|
||||
return $reponse->setDirigeantsOpResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->logger->info($fault->faultcode.':'.$fault->faultstring);
|
||||
if ( in_array($fault->faultcode, array('ERR', 'MSG')) ){
|
||||
return $fault->faultstring;
|
||||
} else {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -2695,6 +2755,7 @@ class WsScores
|
||||
if ($this->cacheWrite) {
|
||||
$cache = new Cache($filename);
|
||||
if ($cache->exist() && $this->cacheEnable ){
|
||||
$this->decLog('getAvisRncs');
|
||||
return $cache->getBlock();
|
||||
}
|
||||
}
|
||||
@ -2767,6 +2828,7 @@ class WsScores
|
||||
if ($this->cacheWrite) {
|
||||
$cache = new Cache($filename);
|
||||
if ($cache->exist() && $this->cacheEnable ){
|
||||
if(!$this->decLog('getIdentite',$siret)){return false;}
|
||||
return $cache->getBlock();
|
||||
}
|
||||
}
|
||||
@ -2805,6 +2867,7 @@ class WsScores
|
||||
if ($this->cacheWrite) {
|
||||
$cache = new Cache($filename);
|
||||
if ($cache->exist() && $this->cacheEnable ){
|
||||
if(!$this->decLog('getIdentiteProcol',$siret)){return false;}
|
||||
return $cache->getBlock();
|
||||
}
|
||||
}
|
||||
@ -2839,6 +2902,7 @@ class WsScores
|
||||
if ($this->cacheWrite) {
|
||||
$cache = new Cache($filename);
|
||||
if ($cache->exist() && $this->cacheEnable ){
|
||||
$this->decLog('getLiensById');
|
||||
return $cache->getBlock();
|
||||
}
|
||||
}
|
||||
@ -2875,6 +2939,7 @@ class WsScores
|
||||
if ($this->cacheWrite) {
|
||||
$cache = new Cache($filename);
|
||||
if ($cache->exist() && $this->cacheEnable ){
|
||||
if(!$this->decLog('getLiens',$siren)){return false;}
|
||||
return $cache->getBlock();
|
||||
}
|
||||
}
|
||||
@ -2914,6 +2979,7 @@ class WsScores
|
||||
if ($this->cacheWrite) {
|
||||
$cache = new Cache($filename);
|
||||
if ($cache->exist() && $this->cacheEnable ){
|
||||
if(!$this->decLog('getListeEvenements',$siren)){return false;}
|
||||
return $cache->getBlock();
|
||||
}
|
||||
}
|
||||
@ -2953,6 +3019,7 @@ class WsScores
|
||||
if ($this->cacheWrite) {
|
||||
$cache = new Cache($filename);
|
||||
if ($cache->exist() && $this->cacheEnable ){
|
||||
if(!$this->decLog('getListeEtablissements',$siren)){return false;}
|
||||
return $cache->getBlock();
|
||||
}
|
||||
}
|
||||
@ -2995,6 +3062,7 @@ class WsScores
|
||||
if ($this->cacheWrite) {
|
||||
$cache = new Cache($filename);
|
||||
if ($cache->exist() && $this->cacheEnable ){
|
||||
$this->decLog('getEtablissementsGeo');
|
||||
return $cache->getBlock();
|
||||
}
|
||||
}
|
||||
@ -3188,24 +3256,24 @@ class WsScores
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* getScoreHistorique pour les derniers 5 ans
|
||||
* @param string $siret
|
||||
* @param string $type
|
||||
*/
|
||||
public function getScoresHisto($siret, $type = 'indiscore')
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->siret = $siret;
|
||||
$params->type = $type;
|
||||
try {
|
||||
$client = $this->loadClient('interne');
|
||||
$reponse = $client->getScoresHisto($params);
|
||||
return $reponse->getScoresHistoResult;
|
||||
/**
|
||||
* getScoreHistorique pour les derniers 5 ans
|
||||
* @param string $siret
|
||||
* @param string $type
|
||||
*/
|
||||
public function getScoresHisto($siret, $type = 'indiscore')
|
||||
{
|
||||
$params = new stdClass();
|
||||
$params->siret = $siret;
|
||||
$params->type = $type;
|
||||
try {
|
||||
$client = $this->loadClient('interne');
|
||||
$reponse = $client->getScoresHisto($params);
|
||||
return $reponse->getScoresHistoResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -3301,25 +3369,25 @@ class WsScores
|
||||
/**
|
||||
* getCategory
|
||||
*/
|
||||
public function getCategory()
|
||||
{
|
||||
$filename = 'category';
|
||||
$cache = new Cache($filename);
|
||||
if ($cache->exist() && $this->cacheEnable ){
|
||||
return $cache->getBlock('category');
|
||||
}
|
||||
try {
|
||||
$client = $this->loadClient('gestion');
|
||||
$reponse = $client->getCategory();
|
||||
$cache->deletefile();
|
||||
$cache->setBlock($reponse->getCategoryResult);
|
||||
return $reponse->getCategoryResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
//Placer exception pour affichage message
|
||||
return false;
|
||||
}
|
||||
|
||||
public function getCategory()
|
||||
{
|
||||
$filename = 'category';
|
||||
$cache = new Cache($filename);
|
||||
if ($cache->exist() && $this->cacheEnable ){
|
||||
return $cache->getBlock('category');
|
||||
}
|
||||
try {
|
||||
$client = $this->loadClient('gestion');
|
||||
$reponse = $client->getCategory();
|
||||
$cache->deletefile();
|
||||
$cache->setBlock($reponse->getCategoryResult);
|
||||
return $reponse->getCategoryResult;
|
||||
} catch (SoapFault $fault) {
|
||||
$this->soaperror(__FUNCTION__, $fault, $client->__getLastRequest(), $client->__getLastResponse());
|
||||
//Placer exception pour affichage message
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -3350,7 +3418,7 @@ class WsScores
|
||||
$message.= "\n\n";
|
||||
}
|
||||
|
||||
$message.= "Referer : ".$_SERVER['HTTP_REFERER']."\n\n";
|
||||
$message.= "Referer : ".isset($_SERVER['HTTP_REFERER'])?$_SERVER['HTTP_REFERER']:''."\n\n";
|
||||
|
||||
$message.= "Requete :\n ".$requete."\n";
|
||||
$message.= "Reponse :\n ".$reponse."\n";
|
||||
@ -3368,4 +3436,15 @@ class WsScores
|
||||
}
|
||||
}
|
||||
}
|
||||
private function decLog($idLog,$siren='extranet'){
|
||||
if(!$this->freeService){
|
||||
$wsc = new Scores_Ws_Client('credit', '0.1');
|
||||
$params = new stdClass();
|
||||
$params->idLog = $idLog;
|
||||
$params->siren = $siren;
|
||||
$infocredit = $wsc->useCredit($params);
|
||||
return $infocredit->result;
|
||||
}
|
||||
return $this->freeService;
|
||||
}
|
||||
}
|
@ -10,3 +10,5 @@ webservices.pieces.wsdl = "pieces/v0.1?wsdl"
|
||||
webservices.pieces.options.soap_version = SOAP_1_2
|
||||
webservices.catalog.wsdl = "catalog/v0.1?wsdl"
|
||||
webservices.catalog.options.soap_version = SOAP_1_2
|
||||
webservices.credit.wsdl = "credit/v0.1?wsdl"
|
||||
webservices.credit.options.soap_version = SOAP_1_2
|
||||
|
BIN
public/documents/inextenso_tarifs.pdf
Normal file
BIN
public/documents/inextenso_tarifs.pdf
Normal file
Binary file not shown.
@ -12,4 +12,5 @@ require_once realpath(__DIR__ . '/../vendor/autoload.php');
|
||||
|
||||
// --- Create application, bootstrap, and run
|
||||
$application = new Zend_Application(APPLICATION_ENV, APPLICATION_PATH . '/configs/application.ini');
|
||||
error_reporting(E_ERROR);
|
||||
$application->bootstrap()->run();
|
BIN
public/themes/default/images/menu/downloadcsv.jpg
Normal file
BIN
public/themes/default/images/menu/downloadcsv.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 570 B |
BIN
public/themes/default/images/partner/inextenso_bandeau_bas.jpg
Normal file
BIN
public/themes/default/images/partner/inextenso_bandeau_bas.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 8.5 KiB |
@ -1 +0,0 @@
|
||||
@import url("./../../../libs/bootstrap-3.3.7/css/bootstrap.min.css");
|
@ -1,5 +1,6 @@
|
||||
body {
|
||||
background-color: #004489;
|
||||
|
||||
}
|
||||
|
||||
p {
|
||||
@ -26,4 +27,14 @@ p.inexweb {
|
||||
color: #4cae4c;
|
||||
margin-top: 20px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
div.bannierebas{
|
||||
background-image: url('/themes/default/images/partner/inextenso_bandeau_bas.jpg');
|
||||
background-repeat: no-repeat;
|
||||
background-position: top left;
|
||||
height:65px;
|
||||
width:940px;
|
||||
}
|
||||
.text-primary{
|
||||
color:#004489;
|
||||
}
|
Loading…
Reference in New Issue
Block a user