add folder src

This commit is contained in:
benoitpotier 2017-03-28 12:28:12 +02:00
parent 690b854d4e
commit 113bc53ad4
7 changed files with 640 additions and 1 deletions

View File

@ -6,9 +6,13 @@
"doctrine/dbal": "^2.5",
"monolog/monolog": "^1.22"
},
"require-dev": {
"phpunit/phpunit": "^4.8"
},
"include-path": ["src/"],
"autoload": {
"classmap": [
"Metier/"
"src/Metier/"
]
},
"authors": [

View File

@ -0,0 +1,20 @@
<?php
class Metier_Identification_Item
{
public function getKeys() {
return [
'NOM',
'SIRET',
'SIREN',
'NIC',
'REFCLIENT',
'ENSEIGNE',
'ADRESSE1',
'ADRESSE2',
'ADRESSE3',
'CP',
'VILLE',
'TELEPHONE'
];
}
}

View File

@ -0,0 +1,7 @@
<?php
class Metier_Identification_ItemTable extends Zend_Db_Table_Abstract
{
protected $_name = 'cmd';
protected $_schema = 'identification';
}

View File

@ -0,0 +1,159 @@
<?php
class Scores_Sirenage_Display
{
protected $db;
protected $source;
protected $sql;
protected $Limit = 5;
protected $ReponsesNb;
protected $ReponsesTotal;
public function __construct($source)
{
$this->db = Zend_Db_Table_Abstract::getDefaultAdapter();
$this->source = $source;
$this->sourceSql();
}
public function sourceSql()
{
$this->sql = "SELECT ";
// --- Champs
if ($this->source == 'annonces') {
$this->sql.= "s.droitLocal, s.idTable, s.idLien, s.idAnn, s.siren, s.siretProposes, s.dateInsert AS dateInsert_Sirenage, b.raisonSociale, b.adresse, LPAD(b.codePostal,5,0) AS codePostal, b.ville, b.typeEven, b.dateJugement, b.dateInsert AS dateInsert_Bodacc, CONCAT(b.complement,' ',b.annonce,' ',b.infosBrutes) AS annonce, s.appelerMand, s.droitLocal";
}
elseif ($this->source == 'clients') {
$this->sql.= "s.droitLocal, s.idTable, s.idLien, s.idAnn, s.siren, s.siretProposes, s.dateInsert AS dateInsert_Sirenage, b.nom AS raisonSociale, TRIM(CONCAT_WS(' ',b.adresse1,b.adresse2, b.adresse3)) AS adresse, LPAD(b.cp,5,0) AS codePostal, b.ville, '' AS typeEven, '' AS dateJugement, b.dateInsert AS dateInsert_Bodacc, CONCAT_WS(' ','Ref client :',refClient,', Enseigne :',enseigne) AS annonce, s.appelerMand, s.droitLocal";
}
elseif ($this->source == 'asso') {
$this->sql.= "s.droitLocal, s.idTable, s.idLien, s.idAnn, s.siren, s.siretProposes, s.dateInsert AS dateInsert_Sirenage, b.Num_Parution AS Bodacc_Num, b.Date_Parution AS Bodacc_Date_Parution, b.Num_Annonce, b.codTribunal AS Tribunal_Code, '' AS Rubrique_Bodacc, b.Activite AS Rubrique, b.typeAnnonce, b.corrNum_Annonce, corrDate_Parution AS corrBodacc_Date_Parution, b.corrPage, b.corrNumParution, '' AS corrTexteRectificatif, b.typeAsso AS FJ, '' AS Capital, '' AS CapitalDev, b.Waldec AS RC, b.Assoc_Nom AS raisonSociale, '' AS nomCommercial, '' AS enseigne, '' AS nationalite, b.Assoc_Adresse AS adresse, Assoc_AdrNum AS adrNum, Assoc_AdrIndRep AS adrIndRep, Assoc_AdrTypVoie AS adrTypVoie, Assoc_AdrLibVoie AS adrLibVoie, LPAD(Assoc_AdrCP,5,0) AS codePostal, Assoc_AdrVille AS ville, Assoc_AdrComp AS adrComp1, '' AS adrComp2, codEven AS typeEven, Assoc_Date_Declaration2 AS dateJugement, b.dateInsert AS dateInsert_Bodacc, Annonce_Html AS annonce, b.Assoc_Objet AS activite, s.appelerMand, s.droitLocal";
}
elseif ($this->source == 'dirigeants') {
$this->sql.= "s.droitLocal, s.idTable, s.idLien, s.idAnn, s.siren, s.siretProposes, s.dateInsert AS dateInsert_Sirenage, '' AS Bodacc_Num, '' AS Bodacc_Date_Parution, '' AS Num_Annonce, '' AS Tribunal_Code, '' AS Rubrique_Bodacc, '' AS Rubrique, 'Insertion' AS typeAnnonce, '' AS corrNum_Annonce, '' AS corrBodacc_Date_Parution, '' AS corrPage, '' AS corrNumParution, '' AS corrTexteRectificatif, '' AS RC, dirRS AS raisonSociale, civilite, b.nom, prenom, naissance_nom, naissance_date, naissance_lieu, nat AS nationalite, typeDir AS FJ, adresse, fonction_code, fonction_lib, actif, dateFin, source, flux, cinf, b.siren AS sirenDirected, b.dateInsert AS dateInsert_Bodacc, s.appelerMand, s.droitLocal";
}
elseif ($this->source == 'dirigeantsCAC') {
$this->sql.= "s.droitLocal, s.idTable, s.idLien, s.idAnn, s.siren, s.siretProposes, s.dateInsert AS dateInsert_Sirenage, '' AS Bodacc_Num, '' AS Bodacc_Date_Parution, '' AS Num_Annonce, '' AS Tribunal_Code, '' AS Rubrique_Bodacc, '' AS Rubrique, 'Insertion' AS typeAnnonce, '' AS corrNum_Annonce, '' AS corrBodacc_Date_Parution, '' AS corrPage, '' AS corrNumParution, '' AS corrTexteRectificatif, '' AS RC, b.RS AS raisonSociale, '' AS civilite, b.nom, prenom, nomUsage AS naissance_nom, 0 AS naissance_date, '' AS naissance_lieu, '' AS nationalite, '' AS FJ, '' AS adresse, fonction AS fonction_code, '' AS fonction_lib, (depart-1) AS actif, dateFin, 0 AS source, 0 AS flux, 0 AS cinf, b.siren AS sirenDirected, b.dateInsert AS dateInsert_Bodacc, s.appelerMand, s.droitLocal";
}
elseif ($this->source == 'boamp') {
$this->sql.= "s.droitLocal, s.idTable, s.idLien, s.idAnn, s.siren, s.siretProposes, s.dateInsert AS dateInsert_Sirenage, a.Boamp_Num AS Bodacc_Num, b.Boamp_Date_Parution AS Bodacc_Date_Parution, a.Num_Annonce, a.Boamp_Dept_Lib AS Tribunal_Code, b.Boamp_Rubrique AS Rubrique_Bodacc, b.Boamp_Code AS Rubrique, a.typeAnnonce, '' AS corrNum_Annonce, '' AS corrBodacc_Date_Parution, '' AS corrPage, '' AS corrNumParution, '' AS corrTexteRectificatif, '' AS RC, nom AS raisonSociale, adresse, LPAD(cp,5,0) AS codePostal, ville, b.tel, b.fax, b.email, b.web, b.montantTxt, autre, b.num, b.titre, `desc` AS decription, b.dateInsert AS dateInsert_Bodacc, s.appelerMand, s.droitLocal, a.annonce";
}
elseif ($this->source == 'boamp2') {
$this->sql.= "s.droitLocal, s.idTable, s.idLien, s.idAnn, s.siren, s.siretProposes, s.dateInsert AS dateInsert_Sirenage, a.Boamp_Num AS Bodacc_Num, b.Boamp_Date_Parution AS Bodacc_Date_Parution, a.Num_Annonce, a.Boamp_Dept_Lib AS Tribunal_Code, b.Boamp_Rubrique AS Rubrique_Bodacc, b.Boamp_Code AS Rubrique, a.typeAnnonce, '' AS corrNum_Annonce, '' AS corrBodacc_Date_Parution, '' AS corrPage, '' AS corrNumParution, '' AS corrTexteRectificatif, '' AS RC, raisonSociale, adresse, LPAD(cp,5,0) AS codePostal, ville, b.tel, b.fax, b.email, b.web, b.estimValeur AS montantTxt, autres AS autre, 0 AS num, b.titre, carAutre AS decription, b.dateInsert AS dateInsert_Bodacc, s.appelerMand, s.droitLocal, a.annonce";
}
elseif ($this->source == 'tourisme') {
$this->sql.= "s.droitLocal, s.idTable, s.idLien, s.idAnn, s.siren, s.siretProposes, s.dateInsert AS dateInsert_Sirenage, b.nom AS raisonSociale, b.adresse, LPAD(b.adrCp,5,0) AS codePostal, b.adrVille AS ville, '' AS typeEven, '' AS dateJugement, b.dateInsert AS dateInsert_Bodacc, CONCAT_WS(' ', 'Etoiles :',nbEtoiles) AS annonce, s.appelerMand, s.droitLocal";
}
elseif ($this->source == 'marques') {
$this->sql.= "s.droitLocal, s.idTable, s.idLien, s.idAnn, s.siren, s.siretProposes, s.dateInsert AS dateInsert_Sirenage, b.deposantMarque AS raisonSociale, TRIM(CONCAT_WS(' ',b.deposant_AdrNum,b.deposant_AdrIndRep, b.deposant_AdrTypVoie, b.deposant_AdrLibVoie, b.deposant_AdrComp)) AS adresse, LPAD(b.deposant_AdrCP,5,0) AS codePostal, b.deposant_AdrVille AS ville, '' AS typeEven, '' AS dateJugement, b.dateInsert AS dateInsert_Bodacc, CONCAT_WS(' ','Marque :',nomMarque,',',rayonMarque,', Numéro :',numeroMarque,'Dépôt le :',dateDepot,'<br/>',infoMarque) AS annonce, s.appelerMand, s.droitLocal";
}
else {
$this->sql.= "s.droitLocal, s.idTable, s.idLien, s.idAnn, s.siren, s.siretProposes, s.dateInsert AS dateInsert_Sirenage, b.Bodacc_Num, b.Bodacc_Date_Parution, b.Num_Annonce, b.Tribunal_Code, b.Rubrique_Bodacc, b.Rubrique, b.typeAnnonce, b.corrNum_Annonce, b.corrBodacc_Date_Parution, b.corrPage, b.corrNumParution, b.corrTexteRectificatif, b.RC, b.raisonSociale, b.nomCommercial, b.enseigne, b.nationalite, b.FJ, b.Capital, b.CapitalDev, b.adresse, b.adrNum, b.adrIndRep, b.adrTypVoie, b.adrLibVoie, b.adrComp1, b.adrComp2, LPAD(b.codePostal,5,0) AS codePostal, b.ville, b.adresseSiege, b.adrSiegeNum, b.adrSiegeIndRep, b.adrSiegeTypVoie, b.adrSiegeLibVoie, b.adrSiegeComp1, b.adrSiegeComp2, b.codePostalSiege, b.villeSiege, b.administration, b.activite, b.typeEven, b.dateEffet, b.dateDebutActivite, b.dateCessationActivite, b.dateCessationPaiement, b.dateJugement, b.dateInsert AS dateInsert_Bodacc, d.annonce, b.activite, s.appelerMand, s.droitLocal";
}
// --- FROM
$this->sql.= " FROM ";
if ($this->source == 'annonces'){
$this->sql.= 'jo.bodacc_sirenage s, jo.annonces b';
}
elseif ($this->source == 'clients') {
$this->sql.= 'jo.bodacc_sirenage s, jo.sirenage_clients b';
}
elseif ($this->source == 'asso') {
$this->sql.= 'jo.bodacc_sirenage s, jo.asso b';
}
elseif ($this->source == 'dirigeants') {
$this->sql.= 'jo.bodacc_sirenage s, jo.rncs_dirigeants b';
}
elseif ($this->source == 'dirigeantsCAC') {
$this->sql.= 'jo.bodacc_sirenage s, jo.bodacc_dirigeants b';
}
elseif ($this->source == 'bodacc') {
$this->sql.= 'jo.bodacc_sirenage s, jo.bodacc_detail b';
}
elseif ($this->source == 'boamp') {
$this->sql.= 'jo.bodacc_sirenage s, jo.boamp_lots b';
}
elseif ($this->source == 'boamp2') {
$this->sql.= 'jo.bodacc_sirenage s, jo.boamp_detail b';
}
elseif ($this->source == 'tourisme') {
$this->sql.= 'jo.bodacc_sirenage s, jo.tourisme b';
}
elseif ($this->source == 'marques') {
$this->sql.= 'jo.bodacc_sirenage s, bopi.marques b';
}
else {
$this->sql.= 'jo.bodacc_sirenage s, jo.bodacc_detail b, jo.bodacc d';
}
// --- WHERE
$this->sql.= " WHERE ";
if ($this->source == 'annonces') {
$this->sql.= "s.idAnn=b.id AND s.idTable='annonces' AND s.siren=b.siren";
}
elseif ($this->source == 'clients') {
$this->sql.= "s.idAnn=b.id AND s.idTable='sirenage_clients' AND s.siren=b.siren";
}
elseif ($this->source == 'asso') {
$this->sql.= "s.idAnn=b.id AND s.idTable='asso' AND s.siren=b.siren";
}
elseif ($this->source == 'dirigeants') {
$this->sql.= "s.idAnn=b.id AND idTable='rncs_dirigeants' AND s.siren=b.dirSiren";
}
elseif ($this->source == 'dirigeantsCAC') {
$this->sql.= "s.idAnn=b.idL AND idTable='bodacc_dirigeants' AND s.siren=b.dirSiren";
}
elseif ($this->source == 'boamp') {
$this->sql.= "s.idAnn=b.id AND s.idTable='boamp_lots' AND b.idAnn=a.id AND s.siren=b.siren";
}
elseif ($this->source == 'boamp2') {
$this->sql.= "s.idAnn=b.id AND s.idTable='boamp_detail' AND b.id=a.id AND s.siren=b.siren";
}
elseif ($this->source == 'tourisme') {
$this->sql.= "s.idAnn=b.id AND s.idTable='tourisme' AND s.siren=b.siren";
}
elseif ($this->source == 'marques') {
$this->sql.= "s.idAnn=b.id AND s.idTable='marques' AND s.siren=b.sirenDeposant AND deposantPays='FR'";
}
else {
$this->sql.= "s.idAnn=b.id AND s.idTable='bodacc_detail' AND b.sirenValide=0 AND s.siren=b.siren AND b.id=d.id";
}
}
public function setLimit($offset)
{
$this->sql.= " LIMIT $offset, $this->Limit";
}
public function setFilter($name, $value)
{
}
//Date
//Filtre
//Pagination - nbAffichage
//count
public function getResults()
{
$results = $this->db->fetchAll($this->sql);
$resultsFormated = $this->format($results);
return $resultsFormated;
}
public function format($results)
{
}
}

View File

@ -0,0 +1,449 @@
<?php
class Scores_Sirenage_Valid
{
protected $db;
protected $userId;
protected $msg;
public function __construct()
{
$this->db = Zend_Db_Table_Abstract::getDefaultAdapter();
}
public function getErrorMsg()
{
return $this->msg;
}
public function setUserId($id)
{
$this->userId = $id;
}
/**
* ASSO
* @param unknown $idLien
* @param unknown $idAnn
* @param unknown $idSiren
* @param unknown $sirenLu
* @param unknown $nicLu
* @param unknown $siret
*/
public function saveASSO($idLien, $idAnn, $idSiren, $sirenLu, $nicLu, $siret = null)
{
if (strtoupper(substr($sirenLu,0,1)) == 'W') {
$dataUpdate = array(
'Waldec' => strtoupper(substr($siret,0,10)),
'idSirenage' => $this->userId,
);
} else {
$dataUpdate = array(
'siren' => $sirenLu,
'nic' => $nicLu,
'sirenValide' => 2,
'nicValide' => $nicValide,
'idSirenage' => $this->userId,
);
}
if (empty($idSiren)) {
$whereUpdate = 'id='.$idAnn;
} else {
$whereUpdate = 'id='.$idAnn.' AND siren='.$idSiren;
}
$this->db->beginTransaction();
try {
$this->db->update('jo.asso', $dataUpdate, $whereUpdate);
$this->db->delete('jo.bodacc_sirenage', 'idLien='.$idLien);
$this->db->commit();
return true;
} catch (Exception $e) {
$this->db->rollBack();
$this->msg = $e->getMessage();
}
return false;
}
/**
* Tourisme
* @param unknown $idLien
* @param unknown $idAnn
* @param unknown $idSiren
* @param unknown $sirenLu
* @param unknown $nicLu
*/
public function saveTOURISME($idLien, $idAnn, $idSiren, $sirenLu, $nicLu)
{
if (intval($nicLu) == 0) {
$nicValide = 0;
} else {
$nicValide = 2;
}
$dataUpdate = array(
'siren' => $sirenLu,
'nic' => $nicLu,
'sirenValide' => 2,
'nicValide' => $nicValide,
'idSirenage' => $this->userId
);
$whereUpdate = 'id='.$idAnn.' AND siren='.$idSiren;
$this->db->beginTransaction();
try {
$this->db->update('jo.tourisme', $dataUpdate, $whereUpdate);
$this->db->delete('jo.bodacc_sirenage', 'idLien='.$idLien);
$this->db->commit();
return true;
} catch (Exception $e) {
$this->db->rollBack();
$this->msg = $e->getMessage();
}
return false;
}
/**
* BOAMP
* @param unknown $idLien
* @param unknown $idAnn
* @param unknown $idSiren
* @param unknown $sirenLu
* @param unknown $nicLu
*/
public function saveBOAMP($idLien, $idAnn, $idSiren, $sirenLu, $nicLu)
{
if (intval($nicLu) == 0) {
$nicValide = 0;
} else {
$nicValide = 2;
}
$dataUpdate = array(
'siren' => $sirenLu,
'nic' => $nicLu,
'sirenValide' => 2,
'nicValide' => $nicValide,
'idSirenage' => $this->userId
);
$whereUpdate = 'id='.$idAnn.' AND siren='.$idSiren;
$this->db->beginTransaction();
try {
$this->db->update('jo.boamp_lots', $dataUpdate, $whereUpdate);
$this->db->delete('jo.bodacc_sirenage', 'idLien='.$idLien);
$this->db->commit();
return true;
} catch (Exception $e) {
$this->db->rollBack();
$this->msg = $e->getMessage();
}
return false;
}
/**
* Boamp Administration
* @param unknown $idLien
* @param unknown $idAnn
* @param unknown $idSiren
* @param unknown $sirenLu
* @param unknown $nicLu
*/
public function saveBOAMP2($idLien, $idAnn, $idSiren, $sirenLu, $nicLu)
{
if (intval($nicLu) == 0) {
$nicValide = 0;
} else {
$nicValide = 2;
}
$dataUpdate = array(
'siren' => $sirenLu,
'nic' => $nicLu,
'sirenValide' => 2,
'nicValide' => $nicValide,
'idSirenage' => $this->userId
);
$whereUpdate = 'id='.$idAnn.' AND siren='.$idSiren;
$this->db->beginTransaction();
try {
$this->db->update('jo.boamp_detail', $dataUpdate, $whereUpdate);
$this->db->delete('jo.bodacc_sirenage', 'idLien='.$idLien);
$this->db->commit();
return true;
} catch (Exception $e) {
$this->db->rollBack();
$this->msg = $e->getMessage();
}
return false;
}
/**
* Annonces
* @param unknown $idLien
* @param unknown $idAnn
* @param unknown $idSiren
* @param unknown $sirenLu
*/
public function saveANNONCES($idLien, $idAnn, $idSiren, $sirenLu)
{
$dataUpdate = array(
'siren' => $sirenLu,
'sirenValide' => 2,
'idSaisie' => $this->userId
);
$whereUpdate = 'id='.$idAnn.' AND siren='.$idSiren;
$this->db->beginTransaction();
try {
$this->db->update('jo.annonces', $dataUpdate, $whereUpdate);
$this->db->delete('jo.bodacc_sirenage', 'idLien='.$idLien);
$this->db->commit();
return true;
} catch (Exception $e) {
$this->db->rollBack();
$this->msg = $e->getMessage();
}
return false;
}
/**
* CLIENTS
* @param unknown $idLien
* @param unknown $idAnn
* @param unknown $idSiren
* @param unknown $sirenLu
* @param unknown $nicLu
*/
public function saveCLIENTS($idLien, $idAnn, $idSiren, $sirenLu, $nicLu)
{
if (intval($nicLu) == 0) {
$nicValide = 0;
} else {
$nicValide = 2;
}
$dataUpdate = array(
'siren' => $sirenLu,
'nic' => $nicLu,
'sirenValide' => 2,
'nicValide' => $nicValide,
'idSirenage' => $this->userId
);
$whereUpdate = 'id='.$idAnn.' AND siren='.$idSiren;
$this->db->beginTransaction();
try {
$this->db->update('jo.sirenage_clients', $dataUpdate, $whereUpdate);
$this->db->delete('jo.bodacc_sirenage', 'idLien='.$idLien);
$this->db->commit();
return true;
} catch (Exception $e) {
$this->db->rollBack();
$this->msg = $e->getMessage();
}
return false;
}
/**
* MARQUES
* @param unknown $idLien
* @param unknown $idAnn
* @param unknown $idSiren
* @param unknown $sirenLu
* @return boolean
*/
public function saveMARQUES($idLien, $idAnn, $idSiren, $sirenLu)
{
$dataUpdate = array(
'sirenDeposant' => $sirenLu,
'sirenValide' => 2,
'idSirenage' => $this->userId
);
$whereUpdate = 'id='.$idAnn.' AND sirenDeposant='.$idSiren;
$this->db->beginTransaction();
try {
$this->db->update('bopi.marques', $dataUpdate, $whereUpdate);
$this->db->delete('jo.bodacc_sirenage', 'idLien='.$idLien);
$this->db->commit();
return true;
} catch (Exception $e) {
$this->db->rollBack();
$this->msg = $e->getMessage();
}
return false;
}
/**
* DIRIGEANTS
* @param unknown $idLien
* @param unknown $idAnn
* @param unknown $idSiren
* @param unknown $sirenLu
*/
public function saveDIRIGEANTS($idLien, $idAnn, $idSiren, $sirenLu)
{
$dataUpdate = array(
'dirSiren' => $sirenLu,
'idSirenage' => $this->userId
);
$whereUpdate = 'id='.$idAnn;
$this->db->beginTransaction();
try {
$this->db->update('jo.rncs_dirigeants', $dataUpdate, $whereUpdate);
$this->db->delete('jo.bodacc_sirenage', 'idLien='.$idLien);
$this->db->commit();
return true;
} catch (Exception $e) {
$this->db->rollBack();
$this->msg = $e->getMessage();
}
return false;
}
/**
* DIRIGEANTS CAC
* @param unknown $idLien
* @param unknown $idAnn
* @param unknown $idSiren
* @param unknown $sirenLu
*/
public function saveDIRIGEANTSCAC($idLien, $idAnn, $idSiren, $sirenLu)
{
$dataUpdate = array(
'dirSiren' => $sirenLu,
'idSirenage' => $this->userId
);
$whereUpdate = 'idL='.$idAnn;
$this->db->beginTransaction();
try {
$this->db->update('jo.bodacc_dirigeants', $dataUpdate, $whereUpdate);
$this->db->delete('jo.bodacc_sirenage', 'idLien='.$idLien);
$this->db->commit();
return true;
} catch (Exception $e) {
$this->db->rollBack();
$this->msg = $e->getMessage();
}
return false;
}
/**
* BODACC
* @param unknown $idLien
* @param unknown $idAnn
* @param unknown $idSiren
* @param unknown $sirenLu
* @param unknown $nicLu
* @param unknown $siret
*/
public function saveBODACC($idLien, $idAnn, $idSiren, $sirenLu, $nicLu, $siret = null)
{
$exist = $this->db->fetchRow("SELECT count(*) AS nb FROM jo.bodacc_detail WHERE id=$idAnn AND siren=$sirenLu AND sirenValide>0");
// Cette annonce est déjà ratachée à ce siren pour le même code évènement
if (count($exist) > 0 && $exist['nb'] > 0){
if ($idSiren < 1000) {
if (strtoupper(substr($sirenLu,0,1))=='W') {
// --- ????
} else {
$dataUpdate = array(
'idSuppr' => $this->userId,
'dateSuppr' => date('YmdHis'),
);
$whereUpdate = 'id='.$idAnn.' AND siren='.$idSiren;
$this->db->beginTransaction();
try {
$this->db->update('jo.bodacc_detail', $dataUpdate, $whereUpdate);
$this->db->delete('jo.bodacc_sirenage', 'idLien='.$idLien);
$this->db->commit();
return true;
} catch (Exception $e) {
$this->db->rollBack();
$this->msg = $e->getMessage();
}
}
}
} else {
if (intval($nicLu) == 0) {
$nicValide = 0;
} else {
$nicValide = 2;
}
if (strtoupper(substr($sirenLu,0,1))=='W'){
$dataUpdate = array(
'waldec'=>strtoupper(substr($siret,0,10)),
'sirenValide' => 8,
'idSirenage' => $this->userId
);
} else {
$dataUpdate = array(
'siren' => $sirenLu,
'nic' => $nicLu,
'sirenValide' => 2,
'nicValide' => $nicValide,
'idSirenage' => $this->userId
);
}
$whereUpdate = 'id='.$idAnn.' AND siren='.$idSiren;
$this->db->beginTransaction();
try {
$this->db->update('jo.bodacc_detail', $dataUpdate, $whereUpdate);
$this->db->delete('jo.bodacc_sirenage', 'idLien='.$idLien);
$this->db->commit();
return true;
} catch (Exception $e) {
$this->db->rollBack();
$this->msg = $e->getMessage();
}
}
return false;
}
/**
* Contentieux
* @param unknown $idLien
* @param unknown $idAnn
* @param unknown $idSiren
* @param unknown $sirenLu
*/
public function saveCTX($idLien, $idAnn, $idSiren, $sirenLu)
{
$dataUpdate = array(
'entSiren' => $sirenLu,
);
$whereUpdate = 'idL='.$idAnn;
// --- id, userId, action, value, date
$this->db->beginTransaction();
try {
$this->db->update('jo.greffes_affaires_siren', $dataUpdate, $whereUpdate);
$this->db->delete('jo.bodacc_sirenage', 'idLien='.$idLien);
$this->db->commit();
return true;
} catch (Exception $e) {
$this->db->rollBack();
$this->msg = $e->getMessage();
}
return false;
}
}