2013-03-08 17:02:01 +00:00
|
|
|
<?php
|
|
|
|
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'Infogreffe.php';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Infogreffe : Document Bilan
|
|
|
|
*/
|
|
|
|
class Metier_Infogreffe_Bi extends Metier_Infogreffe
|
|
|
|
{
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Db Adapter
|
|
|
|
* @var Zend_Db_Adapter_Abstract
|
|
|
|
*/
|
|
|
|
public $db;
|
|
|
|
|
2013-10-04 15:56:26 +00:00
|
|
|
/**
|
|
|
|
* consolides|sociaux
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
public $type_comptes;
|
|
|
|
|
2013-03-08 17:02:01 +00:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
* @param string $siren
|
|
|
|
*/
|
2013-09-05 08:44:20 +00:00
|
|
|
public function __construct($siren, $db = null)
|
2013-03-08 17:02:01 +00:00
|
|
|
{
|
|
|
|
parent::__construct();
|
|
|
|
|
|
|
|
//Set type
|
|
|
|
$this->type_document = 'BI';
|
|
|
|
|
|
|
|
//Set Siren
|
|
|
|
$this->siren = $siren;
|
|
|
|
|
|
|
|
//Get defaut database adapter
|
2013-09-05 08:44:20 +00:00
|
|
|
if ($db === null) {
|
|
|
|
$this->db = Zend_Db_Table_Abstract::getDefaultAdapter();
|
|
|
|
} else {
|
|
|
|
$this->db = $db;
|
|
|
|
}
|
2013-03-08 17:02:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param $onlyDb
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
public function getList($onlyDb = false)
|
|
|
|
{
|
|
|
|
$this->mode_diffusion = 'XL';
|
|
|
|
$this->reference_client = 'list-' . $this->siren;
|
|
|
|
|
|
|
|
//Requete WebService
|
|
|
|
$bilansXML = null;
|
|
|
|
if ( $onlyDb === false ) {
|
|
|
|
$this->debug = true;
|
|
|
|
//Infogreffe webservice
|
|
|
|
$xml = $this->callRequest();
|
|
|
|
$bilansXML = $this->formatList($xml);
|
|
|
|
}
|
|
|
|
|
|
|
|
//Lecture de la base de données
|
|
|
|
$bilansM = new Application_Model_JoGreffesBilans();
|
|
|
|
$sql = $bilansM->select()
|
|
|
|
->where('siren=?', $this->siren)
|
|
|
|
->order('date_cloture DESC');
|
|
|
|
$rows = $bilansM->fetchAll($sql);
|
|
|
|
|
|
|
|
$bilans = array();
|
|
|
|
if ( count($rows)>0 ) {
|
|
|
|
foreach ( $rows as $row ) {
|
|
|
|
$item = new stdClass();
|
|
|
|
$item->File = $row->pdfLink;
|
|
|
|
$item->FileSize = $row->pdfSize;
|
|
|
|
$item->NumberOfPages = $row->pdfPage;
|
|
|
|
$item->Millesime = $row->millesime;
|
|
|
|
$item->NumDepot = $row->num_depot;
|
|
|
|
$item->DateCloture = $row->date_cloture;
|
|
|
|
$item->Type = $row->type_comptes;
|
2013-09-05 08:44:20 +00:00
|
|
|
|
2013-03-08 17:02:01 +00:00
|
|
|
$mode_diffusion = explode(',', $row->mode_diffusion);
|
2013-09-05 08:44:20 +00:00
|
|
|
//@todo : si présence de fichier alors mode T
|
2013-03-08 17:02:01 +00:00
|
|
|
if (in_array('T',$mode_diffusion)) {
|
|
|
|
$item->ModeDiffusion = 'T';
|
|
|
|
} elseif (in_array('C',$mode_diffusion)) {
|
|
|
|
$item->ModeDiffusion = 'C';
|
|
|
|
} else {
|
|
|
|
$item->ModeDiffusion = '';
|
|
|
|
}
|
|
|
|
$item->DureeExercice = $row->duree_exercice;
|
|
|
|
$bilans[] = $item;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return $bilans;
|
|
|
|
}
|
|
|
|
|
2013-09-05 08:44:20 +00:00
|
|
|
|
2013-08-22 13:07:25 +00:00
|
|
|
/**
|
2013-09-05 08:44:20 +00:00
|
|
|
* Download file
|
|
|
|
* @param string $dateCloture
|
|
|
|
* Format AAAA-MM-DD
|
2013-08-22 13:07:25 +00:00
|
|
|
* @param string $type
|
2013-09-05 08:44:20 +00:00
|
|
|
* sociaux ou consolides
|
2013-08-22 13:07:25 +00:00
|
|
|
* @throws Exception
|
|
|
|
* @return string
|
2013-09-05 08:44:20 +00:00
|
|
|
* Return path (not complete) and filename
|
2013-08-22 13:07:25 +00:00
|
|
|
*/
|
2013-03-08 17:02:01 +00:00
|
|
|
public function getCommandeT($dateCloture = null, $type = 'sociaux')
|
|
|
|
{
|
|
|
|
$this->mode_diffusion = 'T';
|
|
|
|
$this->reference_client = 'T'.date('YmdHis');
|
|
|
|
|
|
|
|
//Lire dans la base de données
|
|
|
|
$bilansM = new Application_Model_JoGreffesBilans();
|
|
|
|
$sql = $bilansM->select()
|
|
|
|
->where('siren=?', $this->siren)
|
|
|
|
->where('date_cloture=?', $dateCloture);
|
2013-09-05 08:44:20 +00:00
|
|
|
if ( $type == 'sociaux' || $type == '' ) {
|
2013-03-08 17:02:01 +00:00
|
|
|
$sql->where("(type='sociaux' OR type='')");
|
|
|
|
} else {
|
|
|
|
$sql->where('type=?',$type);
|
|
|
|
}
|
|
|
|
$row = $bilansM->fetchRow($sql);
|
|
|
|
if ( null === $row ) {
|
|
|
|
throw new Exception('Not exist');
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($row->pdfLink != '') {
|
|
|
|
|
|
|
|
//Set filename
|
|
|
|
$filename = $this->getFilePath($type, $dateCloture) .
|
2013-09-05 08:44:20 +00:00
|
|
|
DIRECTORY_SEPARATOR .
|
|
|
|
$this->getFileName($type, $dateCloture);
|
2013-03-08 17:02:01 +00:00
|
|
|
|
|
|
|
//Check if filename exist
|
|
|
|
if ( !file_exists($this->config->storage->path . DIRECTORY_SEPARATOR . $filename) ) {
|
|
|
|
throw new Exception('File not found');
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
$this->greffe = $row->numGreffe;
|
|
|
|
$this->dossier_millesime = substr($row->numRC,0,2);
|
|
|
|
$this->dossier_statut = substr($row->numRC,2,1);
|
|
|
|
$this->dossier_chrono = substr($row->numRC,3);
|
|
|
|
$this->num_depot = $row->num_depot;
|
|
|
|
$this->date_cloture = $row->date_cloture;
|
|
|
|
|
2013-06-07 15:53:52 +00:00
|
|
|
try {
|
|
|
|
$xml = $this->callRequest();
|
|
|
|
} catch(Exception $e) {
|
|
|
|
//@todo : Error
|
|
|
|
//Erreur commande webservice
|
|
|
|
throw new Exception($e->getMessage(), $e->getCode());
|
|
|
|
}
|
|
|
|
|
2013-03-08 17:02:01 +00:00
|
|
|
$bilan = $this->formatItem($xml);
|
|
|
|
|
|
|
|
$url = $bilan['url_acces'];
|
|
|
|
if (empty($url)) {
|
|
|
|
throw new Exception('File url not given');
|
|
|
|
}
|
|
|
|
|
|
|
|
//Set the filename
|
|
|
|
$filename = $this->getFilePath($type, $dateCloture) .
|
|
|
|
DIRECTORY_SEPARATOR .
|
|
|
|
$this->getFileName($type, $dateCloture);
|
|
|
|
|
|
|
|
//Récupérer le fichier
|
|
|
|
$getfile = $this->download($url, $filename);
|
|
|
|
|
|
|
|
//Analyser le fichier - Nombre de page et taille
|
|
|
|
$infos = $this->pdfInfos($getfile);
|
|
|
|
|
|
|
|
//Enregistrer les infos du fichier dans la base de données
|
|
|
|
if (false !== $infos) {
|
|
|
|
$this->dbSetFile($filename, $infos['size'], $infos['pages'], $infos['version']);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return $filename;
|
|
|
|
}
|
|
|
|
|
2013-09-05 08:44:20 +00:00
|
|
|
/**
|
|
|
|
* @todo : Vérifier fonctionnement
|
|
|
|
* @param string $dateCloture
|
|
|
|
* @param string $type
|
|
|
|
* @param string $email
|
|
|
|
* @param string $reference
|
|
|
|
* @throws Exception
|
|
|
|
* @return unknown
|
|
|
|
*/
|
2013-06-07 15:53:52 +00:00
|
|
|
public function getCommandeC($dateCloture = null, $type = 'sociaux', $email = '', $reference = '')
|
2013-03-08 17:02:01 +00:00
|
|
|
{
|
|
|
|
$this->mode_diffusion = 'C';
|
|
|
|
|
2013-06-07 15:53:52 +00:00
|
|
|
//Lire dans la base de données
|
|
|
|
$bilansM = new Application_Model_JoGreffesBilans();
|
|
|
|
$sql = $bilansM->select()
|
|
|
|
->where('siren=?', $this->siren)
|
|
|
|
->where('date_cloture=?', $dateCloture);
|
|
|
|
if ($type=='sociaux') {
|
|
|
|
$sql->where("(type='sociaux' OR type='')");
|
|
|
|
} else {
|
|
|
|
$sql->where('type=?',$type);
|
|
|
|
}
|
|
|
|
$row = $bilansM->fetchRow($sql);
|
|
|
|
if ( null === $row ) {
|
|
|
|
throw new Exception('Not exist');
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
- Importer table commandes
|
|
|
|
- Renommer en table greffes_commandes
|
|
|
|
- Supprimer colonnes idUser, typeCommande
|
|
|
|
- Ajouter colonnes typeDocument, raisonSociale, refClient
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
//Attention, si mode diffusion vide => alors faire commande courrier SD
|
|
|
|
|
2013-03-08 17:02:01 +00:00
|
|
|
//Enregistrer la commande dans la base de données
|
2013-06-07 15:53:52 +00:00
|
|
|
// commandes => Créer la table dans BigData
|
2013-03-08 17:02:01 +00:00
|
|
|
|
2013-06-07 15:53:52 +00:00
|
|
|
// id => id de la commande
|
|
|
|
// login => login
|
|
|
|
// email => email de l'utilisateur
|
2013-03-08 17:02:01 +00:00
|
|
|
|
2013-06-07 15:53:52 +00:00
|
|
|
// Ajouter référence client
|
2013-03-08 17:02:01 +00:00
|
|
|
|
2013-06-07 15:53:52 +00:00
|
|
|
// typeDocument => BI, AC ($this->type_document)
|
|
|
|
// siren => siren de la société
|
|
|
|
// raisonSociale => RS de la société getIdentiteLight()
|
|
|
|
// refDocument =>
|
|
|
|
// libDocument =>
|
|
|
|
// commentaire =>
|
|
|
|
// dateCommande =>
|
|
|
|
// dateReception =>
|
|
|
|
|
|
|
|
//Récuperer l'id de commande - depuis la base de données
|
|
|
|
$this->reference_client = 'G'.$id;
|
2013-03-08 17:02:01 +00:00
|
|
|
|
2013-06-07 15:53:52 +00:00
|
|
|
//Générer les paramètres de commande depuis la base de données
|
|
|
|
$this->greffe = $row->numGreffe;
|
|
|
|
$this->dossier_millesime = substr($row->numRC,0,2);
|
|
|
|
$this->dossier_statut = substr($row->numRC,2,1);
|
|
|
|
$this->dossier_chrono = substr($row->numRC,3);
|
|
|
|
$this->num_depot = $row->num_depot;
|
|
|
|
$this->date_cloture = $row->date_cloture;
|
2013-03-08 17:02:01 +00:00
|
|
|
|
2013-06-07 15:53:52 +00:00
|
|
|
//Faire la requete
|
|
|
|
try {
|
|
|
|
$xml = $this->callRequest();
|
|
|
|
} catch(Exception $e) {
|
|
|
|
//@todo : Gestion des erreurs
|
|
|
|
}
|
2013-03-08 17:02:01 +00:00
|
|
|
|
2013-06-07 15:53:52 +00:00
|
|
|
return $id;
|
2013-03-08 17:02:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Name of file
|
|
|
|
* @param string $type
|
|
|
|
* @param string $dateCloture
|
|
|
|
* Format : AAAAMMJJ
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function getFileName($type, $dateCloture)
|
|
|
|
{
|
|
|
|
if ($type=='') {
|
|
|
|
$type = 'sociaux';
|
|
|
|
}
|
|
|
|
return 'bilan-' . $this->siren . '-' . $type . '-' . $dateCloture . '.pdf';
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Path of file
|
|
|
|
* @param string $type
|
|
|
|
* @param string $dateCloture
|
|
|
|
* Format : AAAAMMJJ
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function getFilePath($type, $dateCloture)
|
|
|
|
{
|
|
|
|
if ($type=='') {
|
|
|
|
$type = 'sociaux';
|
|
|
|
}
|
|
|
|
return 'bilans' . DIRECTORY_SEPARATOR . $type . DIRECTORY_SEPARATOR . substr($dateCloture,0,4);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Format XML to Array for a list of items
|
|
|
|
* @param string $xml
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
protected function formatList($xml)
|
|
|
|
{
|
|
|
|
//Parse XML to make an array
|
|
|
|
$doc = new DOMDocument();
|
|
|
|
$doc->loadXML($xml);
|
|
|
|
$liste_bilan_complet = $doc->getElementsByTagName('liste_bilan_complet')->item(0);
|
|
|
|
$bilan_complet = $liste_bilan_complet->getElementsByTagName('bilan_complet');
|
|
|
|
|
|
|
|
$bilans = array();
|
|
|
|
if ( count($bilan_complet)>0 )
|
|
|
|
{
|
|
|
|
foreach( $bilan_complet as $element )
|
|
|
|
{
|
|
|
|
$bilan = array();
|
|
|
|
$num_gest = $element->getElementsByTagName('num_gest')->item(0);
|
|
|
|
$bilan['num_gest']['greffe'] = $num_gest->getElementsByTagName('greffe')->item(0)->nodeValue;
|
|
|
|
$bilan['num_gest']['dossier_millesime'] = $num_gest->getElementsByTagName('dossier_millesime')->item(0)->nodeValue;
|
|
|
|
$bilan['num_gest']['dossier_statut'] = $num_gest->getElementsByTagName('dossier_statut')->item(0)->nodeValue;
|
|
|
|
$bilan['num_gest']['dossier_chrono'] = $num_gest->getElementsByTagName('dossier_chrono')->item(0)->nodeValue;
|
|
|
|
$bilan['dossier_millesime'] = $num_gest->getElementsByTagName('dossier_millesime')->item(0)->nodeValue;
|
|
|
|
$bilan['dossier_statut'] = $num_gest->getElementsByTagName('dossier_statut')->item(0)->nodeValue;
|
|
|
|
$bilan['dossier_chrono'] = $num_gest->getElementsByTagName('dossier_chrono')->item(0)->nodeValue;
|
|
|
|
$bilan['num_siren'] = $element->getElementsByTagName('num_siren')->item(0)->nodeValue;
|
|
|
|
$bilan['date_cloture'] = $element->getElementsByTagName('date_cloture')->item(0)->nodeValue;
|
|
|
|
$bilan['date_cloture_iso'] = $element->getElementsByTagName('date_cloture_iso')->item(0)->nodeValue;
|
|
|
|
$bilan['millesime'] = $element->getElementsByTagName('millesime')->item(0)->nodeValue;
|
|
|
|
$bilan['num_depot'] = $element->getElementsByTagName('num_depot')->item(0)->nodeValue;
|
|
|
|
$bilan['type_comptes'] = $element->getElementsByTagName('type_comptes')->item(0)->nodeValue;
|
|
|
|
$mode_diffusion = $element->getElementsByTagName('mode_diffusion')->item(0)->getElementsByTagName('mode');
|
|
|
|
foreach($mode_diffusion as $mode)
|
|
|
|
{
|
|
|
|
$bilan['mode_diffusion'][] = $mode->getAttribute('type');
|
|
|
|
}
|
|
|
|
|
|
|
|
//Enregistrer dans la bdd
|
|
|
|
$this->dbUpdateItem($bilan);
|
|
|
|
|
|
|
|
//Génération de l'index pour le tri
|
|
|
|
$date = $bilan['date_cloture_iso'];
|
|
|
|
if( !empty($date) )
|
|
|
|
{
|
2013-10-04 10:43:17 +00:00
|
|
|
$key = substr($date,0,4).substr($date,5,2).substr($date,8,2).'-'.$bilan['num_depot'];
|
|
|
|
//Affectation liste générale avec un index permettant le tri
|
|
|
|
$bilans[$key] = $bilan;
|
2013-03-08 17:02:01 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
krsort($bilans);
|
|
|
|
return $bilans;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Format XML to Array for one item
|
|
|
|
* @param string $xml
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
protected function formatItem($xml)
|
|
|
|
{
|
|
|
|
$doc = new DOMDocument();
|
|
|
|
$doc->loadXML($xml);
|
|
|
|
$bilan_complet = $doc->getElementsByTagName('bilan_complet')->item(0);
|
|
|
|
$bilan = array();
|
|
|
|
$bilan['num_gest'] = array();
|
|
|
|
$num_gest = $bilan_complet->getElementsByTagName('num_gest')->item(0);
|
|
|
|
$bilan['num_gest']['greffe'] = $num_gest->getElementsByTagName('greffe')->item(0)->nodeValue;
|
|
|
|
$bilan['num_gest']['dossier_millesime'] = $num_gest->getElementsByTagName('dossier_millesime')->item(0)->nodeValue;
|
|
|
|
$bilan['num_gest']['dossier_statut'] = $num_gest->getElementsByTagName('dossier_statut')->item(0)->nodeValue;
|
|
|
|
$bilan['num_gest']['dossier_chrono'] = $num_gest->getElementsByTagName('dossier_chrono')->item(0)->nodeValue;
|
|
|
|
$bilan['num_siren'] = $bilan_complet->getElementsByTagName('num_siren')->item(0)->nodeValue;
|
|
|
|
$bilan['date_cloture'] = $bilan_complet->getElementsByTagName('date_cloture')->item(0)->nodeValue;
|
|
|
|
$bilan['date_cloture_iso'] = $bilan_complet->getElementsByTagName('date_cloture_iso')->item(0)->nodeValue;
|
|
|
|
$bilan['millesime'] = $bilan_complet->getElementsByTagName('millesime')->item(0)->nodeValue;
|
|
|
|
$bilan['num_depot'] = $bilan_complet->getElementsByTagName('num_depot')->item(0)->nodeValue;
|
|
|
|
$bilan['type_comptes'] = $bilan_complet->getElementsByTagName('type_comptes')->item(0)->nodeValue;
|
|
|
|
$bilan['url_acces'] = $bilan_complet->getElementsByTagName('url_acces')->item(0)->nodeValue;
|
|
|
|
|
|
|
|
return $bilan;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Update informations about an item in database
|
|
|
|
* @param array $list
|
|
|
|
* @return boolean
|
|
|
|
*/
|
|
|
|
protected function dbUpdateItem($list)
|
|
|
|
{
|
|
|
|
//Insert or Update
|
|
|
|
$data = array(
|
|
|
|
'siren' => $list['num_siren'],
|
|
|
|
'numRC' => $list['num_gest']['dossier_millesime'].
|
|
|
|
$list['num_gest']['dossier_statut'].$list['num_gest']['dossier_chrono'],
|
|
|
|
//'numRC2' => '',
|
|
|
|
'numGreffe' => $list['num_gest']['greffe'],
|
|
|
|
'millesime' => $list['millesime'],
|
|
|
|
'num_depot' => $list['num_depot'],
|
|
|
|
'date_cloture' => $list['date_cloture_iso'],
|
|
|
|
'type_comptes' => $list['type_comptes'],
|
|
|
|
'mode_diffusion' => join(',',$list['mode_diffusion']),
|
|
|
|
);
|
|
|
|
|
|
|
|
try {
|
|
|
|
$bilanM = new Application_Model_JoGreffesBilans();
|
|
|
|
$sql = $bilanM->select()
|
|
|
|
->where('siren=?', $this->siren)
|
|
|
|
->where('date_cloture=?', $list['date_cloture_iso']);
|
|
|
|
if ( null === $bilanM->fetchRow($sql) ) {
|
|
|
|
$result = $bilanM->insert($data);
|
|
|
|
} else {
|
|
|
|
$result = $bilanM->update($data, array(
|
|
|
|
'siren="'.$list['num_siren'].'"',
|
|
|
|
'date_cloture="'.$list['date_cloture_iso'].'"',
|
|
|
|
));
|
|
|
|
}
|
|
|
|
} catch(Zend_Db_Adapter_Exception $e) {
|
|
|
|
throw new Exception($e->getMessage());
|
|
|
|
} catch(Zend_Db_Exception $e) {
|
|
|
|
throw new Exception($e->getMessage());
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($result) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set file informations in database
|
|
|
|
* @param string $filename
|
|
|
|
* @param int $size
|
|
|
|
* @param int $numberOfPage
|
|
|
|
* @param string $version
|
|
|
|
* @return boolean
|
|
|
|
*/
|
2013-10-04 15:56:26 +00:00
|
|
|
public function dbSetFile($filename, $size, $numberOfPage, $version)
|
2013-03-08 17:02:01 +00:00
|
|
|
{
|
|
|
|
$data = array(
|
|
|
|
'pdfLink' => $filename,
|
|
|
|
'pdfSize' => $size,
|
|
|
|
'pdfPage' => $numberOfPage,
|
2013-10-04 15:56:26 +00:00
|
|
|
'pdfVer' => $version,
|
|
|
|
'pdfDate' => date('Ymd'),
|
2013-03-08 17:02:01 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
$where = array(
|
2013-10-04 15:56:26 +00:00
|
|
|
'siren='.$this->siren,
|
|
|
|
'date_cloture="'.substr($this->date_cloture,0,4).'-'.substr($this->date_cloture,4,2).'-'.substr($this->date_cloture,6,2).'"',
|
|
|
|
'type_comptes="'.$this->type_comptes.'"',
|
2013-03-08 17:02:01 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
try {
|
|
|
|
$bilanM = new Application_Model_JoGreffesBilans();
|
|
|
|
$result = $bilanM->update($data, $where);
|
|
|
|
} catch(Zend_Db_Adapter_Exception $e) {
|
|
|
|
throw new Exception($e->getMessage());
|
|
|
|
} catch(Zend_Db_Exception $e) {
|
|
|
|
throw new Exception($e->getMessage());
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($result) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|