extranet/application/controllers/SurveillanceController.php

1067 lines
34 KiB
PHP
Raw Normal View History

2011-02-21 08:45:13 +00:00
<?php
class SurveillanceController extends Zend_Controller_Action
{
2011-08-19 20:28:30 +00:00
/**
* Association source => texte
* @var array
*/
2011-05-04 13:17:01 +00:00
protected $sourceTxt = array(
'annonces' => 'Annonces',
'insee' => 'Insee',
'bilans' => 'Bilans',
'score' => 'IndiScore',
'actes' => 'Actes',
'dirigeants' => 'Dirigeants',
'privileges' => 'Privilèges',
2012-03-01 08:45:37 +00:00
'paiements' => 'Paiements',
'liens' => 'Liens',
2011-05-04 13:17:01 +00:00
);
2011-08-19 20:28:30 +00:00
/**
* Association source => droits
* @var array
*/
2011-05-04 13:17:01 +00:00
protected $sourceDroit = array(
'annonces' => 'survannonce',
'insee' => 'survinsee',
'bilans' => 'survbilan',
'score' => 'survscore',
'actes' => 'survactes',
'dirigeants' => 'survdirigeants',
'privileges' => 'survpriv',
2012-03-01 08:45:37 +00:00
'paiements' => 'survpaiements',
'liens' => 'survliens',
2011-05-04 13:17:01 +00:00
);
2012-05-20 16:31:28 +00:00
2011-04-19 08:51:48 +00:00
public function init()
{
2011-04-20 13:41:43 +00:00
require_once 'Scores/WsScores.php';
require_once 'common/dates.php';
2011-04-19 08:51:48 +00:00
}
public function indexAction()
{
2011-08-19 20:28:30 +00:00
//What we want to do here
2011-04-19 08:51:48 +00:00
}
2012-05-20 16:31:28 +00:00
2011-05-04 13:17:01 +00:00
/**
* Ajouter une surveillance
*/
public function ajouterAction()
{
//Affichage formulaire demande ref et email
$this->_helper->layout->disableLayout();
$request = $this->getRequest();
$siret = $request->getParam('siret', '');
$email = $request->getParam('email', '');
$ref = $request->getParam('ref', '');
$source = $request->getParam('source', '');
2011-05-04 13:17:01 +00:00
$encours = $request->getParam('encours', 0);
2012-05-20 16:31:28 +00:00
$user = new Scores_Utilisateur();
2011-05-04 13:17:01 +00:00
$email = $user->getEmail();
2012-05-20 16:31:28 +00:00
2011-05-04 13:17:01 +00:00
if( empty($source) ) {
$source = array();
foreach($this->sourceTxt as $Source => $Txt) {
if( $user->checkPerm($this->sourceDroit[$Source]) ) {
$checked = 'checked';
if ($Source=='privileges') {
$checked = '';
}
$source[] = array(
'id' => $Source,
'txt' => $Txt,
'checked' => $checked,
);
}
}
}
$this->view->assign('source', $source);
$this->view->assign('siret', $siret);
2011-05-04 13:17:01 +00:00
$this->view->assign('email', $email);
$this->view->assign('ref', $ref);
$this->view->assign('encours', $encours);
}
2012-05-20 16:31:28 +00:00
public function demanderefAction()
{
$this->_helper->layout->disableLayout();
2012-05-20 16:31:28 +00:00
$user = new Scores_Utilisateur();
$email = $user->getEmail();
2012-05-20 16:31:28 +00:00
$this->view->assign('email', $email);
}
2011-05-04 13:17:01 +00:00
/**
* Supprimer une surveillances
*/
public function supprimerAction()
{
2012-02-02 13:36:18 +00:00
$this->_helper->layout->disableLayout();
2012-05-20 16:31:28 +00:00
2011-05-04 13:17:01 +00:00
$request = $this->getRequest();
2012-05-20 16:31:28 +00:00
$page = $request->getParam('page');
$from = $request->getParam('from');
2012-05-20 16:31:28 +00:00
2011-05-04 13:17:01 +00:00
$siret = $request->getParam('siret', '');
$email = $request->getParam('email', '');
$ref = $request->getParam('ref', '');
$source = $request->getParam('source', 'annonces');
2012-05-20 16:31:28 +00:00
2011-05-04 13:17:01 +00:00
$ws = new WsScores();
2012-02-13 14:39:10 +00:00
$set = $ws->setSurveillance($siret, $email, urldecode($ref), $source, true);
2012-05-20 16:31:28 +00:00
if (isset($from)) {
$this->_helper->viewRenderer->setNoRender(true);
if ( $set->result ) {
2012-05-20 16:31:28 +00:00
echo "Surveillance supprimé";
} else {
echo "Erreur lors de la suppression";
}
} elseif (isset($page)) {
2012-02-02 13:36:18 +00:00
$this->_redirect('surveillance/liste/page/'.$page);
2012-05-20 16:31:28 +00:00
} else {
$this->_redirect('surveillance/liste');
2012-02-02 13:36:18 +00:00
}
2011-05-04 13:17:01 +00:00
}
2012-05-20 16:31:28 +00:00
2011-05-04 13:17:01 +00:00
/**
* Ajoute, Supprime, Edite la surveillance (Ajax)
*/
public function setAction()
{
$this->_helper->layout->disableLayout();
2011-09-19 19:57:29 +00:00
2011-05-04 13:17:01 +00:00
$request = $this->getRequest();
$siret = $request->getParam('siret', '');
$email = $request->getParam('email', '');
$ref = $request->getParam('ref', '');
$source = $request->getParam('source', 'annonces');
$delete = $request->getParam('delete', false);
$encours = $request->getParam('encours', 0);
2012-05-20 16:31:28 +00:00
2011-05-04 13:17:01 +00:00
//Vérification siret / email / ref
if (empty($siret) || empty($email) | empty($ref)){
2011-09-19 19:57:29 +00:00
$msg = 'Erreur email ou reférence non définie !';
}
//Vérification de l'encours (chiffres)
elseif (!preg_match('/([0-9]+)/', $encours)){
2011-09-19 19:57:29 +00:00
$msg = 'Encours incorrect';
} else {
if (!empty($delete)){
$delete = true;
}
$ws = new WsScores();
$set = $ws->setSurveillance($siret, $email, $ref, $source, $delete, $encours);
if ($set) {
if ($delete) { $msg = "Suppression surveillance $source"; }
else { $msg = "Mise sous surveillance $source"; }
2011-09-19 19:57:29 +00:00
} else {
if ($delete) { $msg = "Erreur lors de la suppression de la surveillance $source"; }
else { $msg = "Erreur lors de la mise sous surveillance $source"; }
2011-05-04 13:17:01 +00:00
}
}
2011-09-19 19:57:29 +00:00
$this->view->assign('msg', $msg);
2011-05-04 13:17:01 +00:00
}
2012-05-20 16:31:28 +00:00
2011-05-04 13:17:01 +00:00
/**
* Ajoute un encours client
*/
public function encoursAction()
{
$this->_helper->layout->disableLayout();
$this->_forward('ajouter', 'surveillance', null, array( 'source' => 'score' ));
2011-05-04 13:17:01 +00:00
}
2012-05-20 16:31:28 +00:00
2011-04-20 13:41:43 +00:00
/**
* Affiche les infos d'une surveillance
*/
public function infosAction()
{
$request = $this->getRequest();
2013-01-10 12:52:37 +00:00
//Javascript
$theme = Zend_Registry::get('theme');
Zend_Registry::get('firebug')->info($theme->pathScript);
$this->view->headScript()
->appendFile($theme->pathScript.'/surveillance.js', 'text/javascript');
2013-01-10 12:52:37 +00:00
2011-04-20 13:41:43 +00:00
$source = $request->getParam('source', '');
$siret = $request->getParam('siret', 0);
2012-05-20 16:31:28 +00:00
$user = new Scores_Utilisateur();
2011-04-20 13:41:43 +00:00
//if ($user->checkPerm())
2012-05-20 16:31:28 +00:00
2011-04-20 13:41:43 +00:00
$listSurv = array();
2012-05-20 16:31:28 +00:00
if (intval($siret)!=0)
{
$ws = new WsScores();
2012-05-20 16:31:28 +00:00
2012-02-10 15:54:50 +00:00
$filtre = new stdClass();
$filtre->item = $siret;
$filtre->itemMode = 'siren';
$filtre->source = $source;
$filtre->tri = 'siren';
$filtre->triMode = 'asc';
$filtre->detail = false;
2012-05-20 16:31:28 +00:00
2012-02-10 15:54:50 +00:00
$infos = $ws->getSurveillances($filtre);
2012-05-20 16:31:28 +00:00
$surveillances = $infos->result->item;
if (count($surveillances)>0) {
$titre = 'Ajouter une surveillance';
$texte = "L'entité est sous surveillance";
2012-02-10 15:54:50 +00:00
$item = $surveillances[0];
2012-05-20 16:31:28 +00:00
2012-02-10 15:54:50 +00:00
foreach($item->sources->item as $surv){
$tooltipTexte = '';
$ref = $surv->ref;
$tooltipTexte.= "Ref : ".$ref;
$tooltipTexte.= "<br/>Date d'ajout :".WDate::dateT('Y-m-d', 'd/m/Y', $surv->dateAjout);
if ($surv->dateDerEnvoi!='0000-00-00 00:00:00') {
$tooltipTexte.= "<br/>Date de dernier envoi : ".
WDate::dateT('Y-m-d', 'd/m/Y', substr($surv->dateDerEnvoi,0,10));
}
$listSurv[] = array(
'tooltipTexte' => $tooltipTexte,
'sourceTexte' => $this->sourceTxt[$surv->source]
);
}
} else {
$titre = 'Ajouter une surveillance';
$texte = 'Mettre sous surveillance';
if (!empty($source)){
$texte.= ' '.$this->sourceTxt[$source];
2011-04-20 13:41:43 +00:00
}
}
2011-04-20 13:41:43 +00:00
}
2012-05-20 16:31:28 +00:00
2011-04-20 13:41:43 +00:00
if (!empty($ref)) {
$this->view->assign('ref', $ref);
} else {
$this->view->assign('ref', '');
2011-04-20 13:41:43 +00:00
}
2012-05-20 16:31:28 +00:00
2011-04-20 13:41:43 +00:00
$this->view->assign('surveillances', $listSurv);
$this->view->assign('dialogTitre', $titre);
$this->view->assign('dialogTexte', $texte);
$this->view->assign('dialogSource', $source);
2011-04-20 13:41:43 +00:00
}
2012-05-20 16:31:28 +00:00
2011-04-20 13:41:43 +00:00
/**
* Liste les surveillances
*/
2011-04-19 08:51:48 +00:00
public function listeAction()
{
2012-05-20 16:31:28 +00:00
$user = new Scores_Utilisateur();
2011-08-22 16:02:17 +00:00
if (!$user->checkPerm('survliste')){
2012-05-20 16:31:28 +00:00
$this->_forward('perms', 'error');
2011-08-22 16:02:17 +00:00
}
2012-05-20 16:31:28 +00:00
2011-05-04 13:17:01 +00:00
$this->view->headLink()
2013-02-11 08:25:59 +00:00
->appendStylesheet('/libs/tablesorter/themes/blue/style.css', 'all');
2012-05-20 16:31:28 +00:00
2011-04-20 07:26:17 +00:00
$this->view->headScript()
->appendFile('/libs/tablesorter/jquery.tablesorter.js', 'text/javascript')
2011-04-20 07:26:17 +00:00
->appendFile('/themes/default/scripts/surveillance.js', 'text/javascript');
2012-05-20 16:31:28 +00:00
2011-04-20 07:26:17 +00:00
$request = $this->getRequest();
2012-05-20 16:31:28 +00:00
2011-04-20 07:26:17 +00:00
$page = $request->getParam('page', 0);
$source = $request->getParam('source', '');
2012-05-20 16:31:28 +00:00
2012-02-10 15:54:50 +00:00
$tri = $request->getParam('tri', 'siren');
$this->view->assign('tri', $tri);
2012-05-20 16:31:28 +00:00
2012-02-10 15:54:50 +00:00
$triMode = $request->getParam('triMode', 'asc');
$this->view->assign('triMode', $triMode);
2012-05-20 16:31:28 +00:00
2012-02-10 15:54:50 +00:00
$q = $request->getParam('q', null);
if ( $q == 'Siren, Référence, Raison Sociale' ) { $q = null; }
$this->view->assign('q', $q);
2012-05-20 16:31:28 +00:00
2012-02-10 15:54:50 +00:00
$detail = true;
2012-05-20 16:31:28 +00:00
2012-02-10 15:54:50 +00:00
$nbAffichage = 50;
2011-04-20 07:26:17 +00:00
$position = $page*$nbAffichage;
2012-02-10 15:54:50 +00:00
switch ( $tri ) {
2011-04-20 07:26:17 +00:00
default:
case 'siren': $triws = 'siren'; break;
case 'rs': $triws = 'rs'; break;
case 'reference': $triws = 'ref'; break;
case 'dateajout': $triws = 'dateAjout'; break;
case 'datederenvoi': $triws = 'dateDerEnvoi'; break;
}
2012-05-20 16:31:28 +00:00
$user = new Scores_Utilisateur();
2012-02-10 15:54:50 +00:00
//Select Tri + Liste des sources autorisées
2011-04-20 07:26:17 +00:00
$selectTri = '';
$permSource = array();
2013-01-10 12:52:37 +00:00
foreach ($this->sourceDroit as $s => $perm) {
if ($user->checkPerm($perm)) {
2011-04-20 07:26:17 +00:00
$permSource[] = $s;
$selectTri.= '<option value="'.$s.'"';
if ($source == $s) {
$selectTri.= 'selected';
}
2013-01-10 12:52:37 +00:00
$selectTri.= '>'.$this->sourceTxt[$s].'</option>';
2011-04-20 07:26:17 +00:00
}
}
2012-02-10 15:54:50 +00:00
if ( !empty($source) ) {
$permSource = array( 0 => $source);
}
2012-05-20 16:31:28 +00:00
2012-02-10 15:54:50 +00:00
if ($q != null) {
$filtre = new stdClass();
$filtre->item = $q;
$filtre->itemMode = 'search';
$filtre->source = $source;
$filtre->tri = $tri;
$filtre->triMode = $triMode;
2012-05-20 16:31:28 +00:00
$filtre->detail = true;
2012-02-10 15:54:50 +00:00
} else {
$filtre = new stdClass();
$filtre->item = '';
$filtre->itemMode = 'siren';
$filtre->source = $source;
$filtre->tri = $tri;
$filtre->triMode = $triMode;
2012-05-20 16:31:28 +00:00
$filtre->detail = true;
2012-02-10 15:54:50 +00:00
}
2012-05-20 16:31:28 +00:00
2011-04-19 08:51:48 +00:00
$ws = new WsScores();
2012-02-10 15:54:50 +00:00
$infos = $ws->getSurveillances($filtre, $position, $nbAffichage);
2012-05-20 16:31:28 +00:00
2011-04-20 07:26:17 +00:00
$surveillances = $infos->result->item;
2012-05-20 16:31:28 +00:00
2012-02-10 15:54:50 +00:00
$listTrier = array();
if ( count($surveillances)>0 ) {
foreach ( $surveillances as $item ) {
$data = array();
2012-05-20 16:31:28 +00:00
$data['siren'] = $item->siren;
2012-02-10 15:54:50 +00:00
foreach ( $item->sources->item as $itemSource ) {
$data['rs'] = $itemSource->rs;
$data['cp'] = $itemSource->cp;
$data['ville'] = $itemSource->ville;
2012-05-20 16:31:28 +00:00
$data['email'] = $itemSource->email;
2012-02-10 15:54:50 +00:00
$data['ref'] = $itemSource->ref;
$data['nic'] = $itemSource->nic;
2012-02-17 15:06:37 +00:00
$data['sources'][] = array(
2012-02-10 15:54:50 +00:00
'email' => $itemSource->email,
'ref' => $itemSource->ref,
2012-02-17 15:06:37 +00:00
'source' => $itemSource->source,
2012-02-10 15:54:50 +00:00
'dateAjout' => $itemSource->dateAjout,
'dateDerEnvoi' => $itemSource->dateDerEnvoi,
2011-09-09 14:54:05 +00:00
);
2012-05-20 16:31:28 +00:00
}
2012-02-10 15:54:50 +00:00
$listTrier[] = $data;
2011-04-20 07:26:17 +00:00
}
2012-05-20 16:31:28 +00:00
}
2011-04-20 07:26:17 +00:00
//Calcul pagination
$nbReponses = $infos->nbReponses;
$nbSurveillances = $infos->nbReponsesTotal;
$totPage = ceil($nbSurveillances/$nbAffichage);
$curPage = ceil($position/$nbAffichage);
2012-05-20 16:31:28 +00:00
$this->view->assign('source', $source);
2011-04-20 07:26:17 +00:00
$this->view->assign('selectTri', $selectTri);
$this->view->assign('listSources', $permSource);
$this->view->assign('nbReponses', $nbReponses);
$this->view->assign('nbSurveillances', $nbSurveillances);
$this->view->assign('totPage', $totPage);
$this->view->assign('curPage', $curPage);
2012-02-10 15:54:50 +00:00
$this->view->assign('surveillances', $listTrier);
2011-04-20 07:26:17 +00:00
$this->view->assign('source', $source);
}
2012-05-20 16:31:28 +00:00
2011-04-20 13:41:43 +00:00
/**
* Liste les surveillances Scores
*/
2011-04-19 09:07:57 +00:00
public function portefeuilleAction()
{
2012-05-20 16:31:28 +00:00
$user = new Scores_Utilisateur();
2011-08-22 16:02:17 +00:00
if(!$user->checkPerm('portefeuille')){
2012-05-20 16:31:28 +00:00
$this->_forward('perms', 'error');
2011-08-22 16:02:17 +00:00
}
2012-05-20 16:31:28 +00:00
2011-04-20 07:26:17 +00:00
$this->view->headScript()
2012-04-16 14:35:42 +00:00
->appendFile('/libs/tablesorter/jquery.tablesorter.js', 'text/javascript')
2012-02-10 15:54:50 +00:00
->appendFile('/themes/default/scripts/surveillance.js', 'text/javascript');
2012-05-20 16:31:28 +00:00
2011-04-20 07:26:17 +00:00
$request = $this->getRequest();
$page = $request->getParam('page', 0);
2012-05-20 16:31:28 +00:00
2012-02-10 15:54:50 +00:00
$siren = $request->getParam('siren', null);
if ( $siren == 'Siren' ) { $siren = null; }
$this->view->assign('siren', $siren);
2012-05-20 16:31:28 +00:00
2012-02-10 15:54:50 +00:00
$ref = $request->getParam('ref', null);
if ( $ref == 'Référence' ) { $ref = null; }
2012-05-20 16:31:28 +00:00
$this->view->assign('ref', $ref);
2012-02-10 15:54:50 +00:00
$rs = $request->getParam('rs', null);
if ( $rs == 'Raison Sociale' ) { $rs = null; }
$this->view->assign('rs', $rs);
2012-05-20 16:31:28 +00:00
2012-02-10 15:54:50 +00:00
$tri = $request->getParam('tri', 'siren');
2012-05-20 16:31:28 +00:00
2011-04-20 07:26:17 +00:00
$nbAffichage = 100;
$position = $page*$nbAffichage;
2012-05-20 16:31:28 +00:00
2011-04-20 07:26:17 +00:00
switch ( $tri ){
default:
case 'siren': $triws = 'siren'; break;
case 'rs': $triws = 'rs'; break;
case 'reference': $triws = 'ref'; break;
case 'dateajout': $triws = 'dateAjout'; break;
case 'datederenvoi': $triws = 'dateDerEnvoi'; break;
case 'score' : $triws = 'indiScore'; break;
}
2012-05-20 16:31:28 +00:00
$user = new Scores_Utilisateur();
2011-04-20 07:26:17 +00:00
$maxIndiscore = $user->getTypeScore();
$typeScore = ($maxIndiscore == '100') ? '' : '20';
2012-05-20 16:31:28 +00:00
2011-04-20 07:26:17 +00:00
$dicoSource = array(
'ajout' => '',
'bilans1' => 'publication bilan',
'bilans2' => 'publication bilan',
'bodacc' => 'publication bodacc',
'collecte' => 'publication légale',
'dirigeants' => 'modification de l\'administration',
'insee' => 'modification identitaire',
'liens' => 'mise à jour de la structure du groupe',
'default' => 'modification identitaire',
);
2012-05-20 16:31:28 +00:00
2011-04-20 07:26:17 +00:00
$couleurRisque100 = array(
'rouge' => array('min'=>0, 'max'=>40),
'orange' => array('min'=>41, 'max'=>50),
'vert' => array('min'=>51, 'max'=>100),
);
2012-05-20 16:31:28 +00:00
2011-04-20 07:26:17 +00:00
$couleurRisque20 = array(
'rouge' => array('min'=>0, 'max'=>6),
'orange' => array('min'=>7, 'max'=>10),
'vert' => array('min'=>11, 'max'=>20),
);
2012-05-20 16:31:28 +00:00
2011-04-19 09:07:57 +00:00
$ws = new WsScores();
2012-05-20 16:31:28 +00:00
2011-04-19 09:07:57 +00:00
$filtre = new stdClass();
2011-04-20 07:26:17 +00:00
$filtre->tri = $triws;
2012-02-10 15:54:50 +00:00
$filtre->siret = ($siren!=null) ? $siren : '';
$filtre->ref = ($ref!=null) ? $ref : '';
$filtre->rs = ($rs!=null) ? $rs : '';
2011-04-20 07:26:17 +00:00
$infos = $ws->getPortefeuille($filtre, $position, $nbAffichage);
2012-05-20 16:31:28 +00:00
2011-04-20 07:26:17 +00:00
$portefeuille = $infos->result->item;
2012-05-20 16:31:28 +00:00
2011-04-20 07:26:17 +00:00
$tabResult = array();
if ( count($portefeuille)>0 ) {
foreach ( $portefeuille as $item ) {
$result = new stdClass();
$result = $item;
2012-05-20 16:31:28 +00:00
2011-04-20 07:26:17 +00:00
//Classe de risque
$couleurV = ${'couleurRisque'.$maxIndiscore};
foreach($couleurV as $couleur => $intervalle)
{
if($item->{'indiScore'.$typeScore}>=$intervalle['min'] &&
$item->{'indiScore'.$typeScore}<=$intervalle['max']){
break;
}
}
$indiScore = $item->{'indiScore'.$typeScore};
$indiScorePre = empty($item->{'indiScore'.$typeScore.'Pre'}) ?
0 : $item->{'indiScore'.$typeScore.'Pre'};
2012-05-20 16:31:28 +00:00
2011-04-20 07:26:17 +00:00
//Variation du risque
$variation = abs($item->indiScore-$item->indiScorePre);
if($variation>=5 && $variation<=9){
$deg = '45';
}else{
$deg = '';
}
2012-05-20 16:31:28 +00:00
2011-04-20 07:26:17 +00:00
//Tooltip
$tooltip = '';
if($item->procol=='P'){
$tooltip.= 'En procédure collective.<br/>';
}
if($item->actif==0){
$tooltip.= '&Eacute;tablissement inactif.<br/>';
}
$tooltip.= '- Dernier exercice pris en compte : ';
if ($item->dateBilan=='0000-00-00') {
$tooltip.= 'Néant';
} else {
2011-05-04 13:17:01 +00:00
$tooltip.= 'le '.WDate::dateT('Y-m-d', 'd/m/Y',$item->dateBilan);
2011-04-20 07:26:17 +00:00
}
$tooltip.= '<br/>';
if ($item->sourceModif!='ajout') {
if (!empty($item->sourceModif)) {
$tooltip.= '- Dernière modification ';
if( $item->indiScoreDate=='0000-00-00') {
$tooltip.= '';
} else {
//$tooltip.= 'le '.WDate::dateT('Y-m-d', 'd/m/Y',$item->indiScoreDate);
}
if (!empty($item->sourceModif)) {
if (in_array($item->sourceModif, $dicoSource)) {
$sourceModif = $item->sourceModif;
} else {
$sourceModif = 'default';
}
$tooltip.= ', suite à '.$dicoSource[$sourceModif];
}
$tooltip.= '<br/>';
}
if ($item->indiScoreDatePre!='0000-00-00') {
$tooltip.= '- Précédent score : '.$indiScorePre.'/'.$maxIndiscore;
}
}
2012-05-20 16:31:28 +00:00
2011-04-20 07:26:17 +00:00
$result->tooltip = $tooltip;
2012-05-20 16:31:28 +00:00
2011-04-20 07:26:17 +00:00
//Affichage score
$colScore = '';
if( $item->indiScoreDate!='0000-00-00' &&
$item->procol!='P' && $item->actif!=0)
{
$colScore.= '<span>'.$indiScore.'/'.$maxIndiscore.'</span>';
2012-05-20 16:31:28 +00:00
2011-04-20 07:26:17 +00:00
//Procols
if ($item->procol=='P') {
$colScore.= '<img src="/themes/default/images/portefeuille/score_alert.gif"/>';
//Constant
} elseif($indiScore==$indiScorePre || $item->sourceModif=='ajout') {
$colScore.= '<img src="/themes/default/images/portefeuille/score_'.$couleur.'constant.gif"/>';
//Hausse
} elseif($indiScore>$indiScorePre) {
$colScore.= '<img src="/themes/default/images/portefeuille/score_'.$couleur.'hausse'.$deg.'.gif"/>';
//Baisse
}elseif($indiScore<$indiScorePre){
$colScore.= '<img src="/themes/default/images/portefeuille/score_'.$couleur.'baisse'.$deg.'.gif"/>';
}
} else {
if ($item->procol=='P') {
$colScore.= '<img src="/themes/default/images/portefeuille/score_alert.gif"/>';
} else {
$colScore.= '-';
}
}
$result->colScore = $colScore;
2012-05-20 16:31:28 +00:00
2011-04-20 07:26:17 +00:00
$tabResult[] = $result;
}
}
2012-05-20 16:31:28 +00:00
2013-01-10 12:52:37 +00:00
//Calcul pagination
$nbReponses = $infos->nbReponses;
2011-04-20 07:26:17 +00:00
$nbSurveillances = $infos->nbReponsesTotal;
$totPage = ceil($nbSurveillances/$nbAffichage);
2013-01-10 12:52:37 +00:00
$curPage = ceil($position/$nbAffichage);
2012-05-20 16:31:28 +00:00
2011-04-20 07:26:17 +00:00
$this->view->assign('nbReponses', $nbReponses);
$this->view->assign('nbSurveillances', $nbSurveillances);
$this->view->assign('totPage', $totPage);
$this->view->assign('curPage', $curPage);
$this->view->assign('portefeuille',$tabResult);
}
2012-05-20 16:31:28 +00:00
2011-08-19 20:28:30 +00:00
/**
* Affiche le lien pour exporter le portefeuille au format csv
*/
public function portefeuillecsvAction()
{
$this->view->headScript()->appendFile('/themes/default/scripts/portefeuillecsv.js', 'text/javascript');
}
2012-05-20 16:31:28 +00:00
2011-08-19 20:28:30 +00:00
/**
* Affiche le lien pour exporter les surveillances au format csv
*/
public function surveillancecsvAction()
{
$this->view->headScript()->appendFile('/themes/default/scripts/surveillancecsv.js', 'text/javascript');
2012-05-20 16:31:28 +00:00
$user = new Scores_Utilisateur();
$request = $this->getRequest();
$source = $request->getParam('source');
2012-05-20 16:31:28 +00:00
$tabSource = array();
2012-05-20 16:31:28 +00:00
foreach ($this->sourceDroit as $s => $perm) {
if ($user->checkPerm($perm)) {
$tabSource[] = array(
'value' => $s,
'name' => $this->sourceTxt[$s],
'select' => (!empty($source) && $source==$s) ? ' selected' : '',
);
}
}
2012-05-20 16:31:28 +00:00
$this->view->assign('tabSource', $tabSource);
2012-05-20 16:31:28 +00:00
}
2012-05-20 16:31:28 +00:00
2011-08-19 20:28:30 +00:00
/**
* Affichage des surveillances par fichier pour les clients
*/
2011-05-24 06:25:58 +00:00
public function fichierAction()
{
2011-08-09 15:40:02 +00:00
$request = $this->getRequest();
2012-05-20 16:31:28 +00:00
$user = new Scores_Utilisateur();
2012-01-17 10:47:39 +00:00
$this->view->assign('login', $user->getLogin());
$this->view->assign('nom', $user->getNom());
2012-05-20 16:31:28 +00:00
2011-08-09 15:40:02 +00:00
$client = new SoapClient(null, array(
'trace' => 1,
'soap_version' => SOAP_1_1,
'location' => 'http://78.31.45.206/ws2/',
'uri' => 'http://78.31.45.206/',
'login' => $user->getLogin(),
'password' => $user->getPassword()
));
2012-05-20 16:31:28 +00:00
2011-08-09 15:40:02 +00:00
$nomFic = $request->getParam('nomFic', '');
$getCSV = $request->getParam('get', '');
2011-08-09 15:40:02 +00:00
$c = Zend_Registry::get('config');
$path = $c->profil->path->files;
2012-05-20 16:31:28 +00:00
2011-08-09 15:40:02 +00:00
//Lister les fichiers
if (empty($nomFic)){
$ref = $user->getPrenom();
2012-05-20 16:31:28 +00:00
if ( strtolower($user->getLogin())=='cnasea95'
|| strtolower($user->getLogin())=='cnasea96'
|| strtolower($user->getLogin())=='omni04'
|| strtolower($user->getLogin())=='bodacca3m'
|| strtolower($user->getLogin())=='bodaccomni'
|| strtolower($user->getLogin())=='bodacccrr'
|| strtolower($user->getLogin())=='cpcambr13'
|| strtolower($user->getLogin())=='cpcambr14'
2012-05-20 16:31:28 +00:00
|| $user->getIdClient()==32
|| $user->getIdClient()==82) {
2011-08-09 15:40:02 +00:00
$ref='*';
}
try {
$O = $client->getListeFichierSurv($user->getLogin(), $ref, $nomFic);
$tabFichier = $O['results'];
} catch (SoapFault $fault) {}
2012-05-20 16:31:28 +00:00
2011-08-09 15:40:02 +00:00
$listeFichier = array();
foreach($tabFichier as $fichier){
2012-01-17 10:47:39 +00:00
$tabTmp = explode('_', $fichier);
2011-08-09 15:40:02 +00:00
$date = Wdate::dateT('Ymd','d/m/Y', substr($tabTmp[2],0,8));
2012-01-17 10:47:39 +00:00
$localfile = $path.'/'.$fichier;
2011-08-09 15:40:02 +00:00
$dejaLu = false;
if (!file_exists($localfile)) {
$dejaLu = true;
}
$result = array(
'fichier' => $fichier,
'date' => $date,
'dejaLu' => $dejaLu,
);
2012-05-20 16:31:28 +00:00
$listeFichier[] = $result;
2011-08-09 15:40:02 +00:00
}
$this->view->assign('listeFichier', $listeFichier);
2012-05-20 16:31:28 +00:00
}
2011-08-09 15:40:02 +00:00
//Lister les annonces
2012-05-20 16:31:28 +00:00
elseif (empty($getCSV))
{
$selectFiltre = array(
2012-05-20 16:31:28 +00:00
'procol' => array('lib'=> 'Procédures collectives', 'select'=>''),
'radiations' => array('lib'=> 'Radiations', 'select'=>''),
'ventes' => array('lib'=> 'Ventes/Cessions', 'select'=>''),
2012-05-20 16:31:28 +00:00
'mmd' => array('lib'=> 'Modifications diverses', 'select'=>''),
);
2012-05-20 16:31:28 +00:00
$filtre = $request->getParam('filtre', '');
2012-05-20 16:31:28 +00:00
if (strtolower($user->getLogin())=='cpcambr13') {
$selectFiltre = array(
2012-05-20 16:31:28 +00:00
'procol' => array('lib'=> 'Procédures collectives', 'select'=>' selected'),
);
$filtre = 'procol';
} elseif (strtolower($user->getLogin())=='cpcambr14') {
$selectFiltre = array(
'radiations' => array('lib'=> 'Radiations', 'select'=>''),
'ventes' => array('lib'=> 'Ventes/Cessions', 'select'=>''),
2012-05-20 16:31:28 +00:00
'mmd' => array('lib'=> 'Modifications diverses', 'select'=>''),
);
}
2012-05-20 16:31:28 +00:00
if (!empty($filtre)) {
2011-08-09 15:40:02 +00:00
switch (trim(strtolower($filtre))) {
case 'procol': $filtre = 'procol'; break;
case 'mmd': $filtre = 'mmd'; break;
case 'radiations': $filtre = 'radiations'; break;
case 'ventes': $filtre = 'ventes'; break;
case 'comptes': $filtre = 'comptes'; break;
case 'creations': $filtre = 'creations'; break;
case 'bodacc': $filtre = 'bodacc'; break;
default: $filtre = ''; break;
}
if (array_key_exists($filtre, $selectFiltre)) {
2012-05-20 16:31:28 +00:00
$selectFiltre[$filtre]['select'] = ' selected';
}
}
$this->view->assign('selectFiltre', $selectFiltre);
2012-05-20 16:31:28 +00:00
2011-08-09 15:40:02 +00:00
//Récupération du fichier
2012-01-17 10:47:39 +00:00
$file = $path.'/'.$nomFic;
2011-08-09 15:40:02 +00:00
$file2 = $file.'.bz2';
if (!file_exists($file) || filesize($file)==0 ) {
//Génération du fichier
try {
$O = $client->getListeFichierSurv($user->getLogin(), $user->getPrenom(), $nomFic);
} catch (SoapFault $fault) {}
2012-05-20 16:31:28 +00:00
require_once 'common/curl.php';
2011-08-09 15:40:02 +00:00
$page = getUrl('http://78.31.45.206/csv/'.$nomFic.'.bz2', '', '', '', false);
$body = $page['body'];
$fp=@fopen($file2, 'w');
@fwrite($fp, $body);
@fclose($fp);
$bz = bzopen($file2, "r") or die("Impossible d'ouvrir le fichier $file");
$fp=@fopen($file, 'w');
while (!feof($bz)) {
@fwrite($fp, bzread($bz, 4096));
}
bzclose($bz);
}
2012-05-20 16:31:28 +00:00
2011-08-09 15:40:02 +00:00
$tab = array();
$row = 0;
$count = 0;
$handle = fopen($file, "r");
while (($ann = fgetcsv($handle, 3000, ';')) !== FALSE)
{
$row++;
if ($row==1)
{
// Ligne d'entête, on repère les colonnes
$num = count($ann);
for ($i=0; $i<$num; $i++)
{
if (utf8_encode($ann[$i])=='SITE_CNASEA') $colSiteCnasea=$i;
elseif(utf8_encode($ann[$i])=='Siren') $colSiren=$i;
elseif(utf8_encode($ann[$i])=='Nic') $colNic=$i;
elseif(utf8_encode($ann[$i])=='Référence') $colRef=$i;
elseif(utf8_encode($ann[$i])=='Parution') $colParution=$i;
elseif(utf8_encode($ann[$i])=='Bodacc') $colBodacc=$i;
elseif(utf8_encode($ann[$i])=='Date parution') $colDatePar=$i;
elseif(utf8_encode($ann[$i])=='Numéro Annonce') $colNumAnn=$i;
elseif(utf8_encode($ann[$i])=='Type Annonce') $colTypeAnn=$i;
elseif(utf8_encode($ann[$i])=='Tribunal') $colTribunal=$i;
elseif(utf8_encode($ann[$i])=='Numéro RCS') $colNumRCS=$i;
elseif(utf8_encode($ann[$i])=='Raison sociale') $colRaisonSociale=$i;
elseif(utf8_encode($ann[$i])=='Chapitre') $colChapitre=$i;
elseif(utf8_encode($ann[$i])=='Evènement(s)') $colEven=$i;
elseif(utf8_encode($ann[$i])=='Texte Annonce') $colTexteAnn=$i;
elseif(utf8_encode($ann[$i])=='Date évènement') $colDateEven=$i;
}
}
elseif ($filtre!='' && $filtre!='bodacc' && $ann[$colChapitre]!=$filtre )
{
//On fait rien
2012-05-20 16:31:28 +00:00
}
2011-08-09 15:40:02 +00:00
else
{
//$filtre=='bodacc'
if( substr($user->getLogin(),0,6)=='cnasea' && $ann[$colBodacc]!='A' && $ann[$colBodacc]!='B' && $ann[$colBodacc]!='C' )
{
//on supprime toutes les annonces pas bodacc
}
2012-03-02 16:39:51 +00:00
elseif (strtolower($user->getLogin())=='cpcambr14' && $ann[$colChapitre]=='procol')
{
//On supprime les annnonces de procol pour ce login
}
2011-08-09 15:40:02 +00:00
else
{
$tab[$count]['RaisonSociale'] = utf8_encode($ann[$colRaisonSociale]);
$tab[$count]['Siren'] = utf8_encode($ann[$colSiren]);
$tab[$count]['SiteCnasea'] = utf8_encode($ann[$colSiteCnasea]);
$tab[$count]['Ref'] = utf8_encode($ann[$colRef]);
$tab[$count]['Parution'] = utf8_encode($ann[$colParution]);
$tab[$count]['Bodacc'] = utf8_encode($ann[$colBodacc]);
$tab[$count]['DatePar'] = WDate::dateT('Ymd','d/m/Y',$ann[$colDatePar]);
$tab[$count]['Tribunal'] = utf8_encode($ann[$colTribunal]);
$tab[$count]['Even'] = utf8_encode(str_replace(', ','<br/>',$ann[$colEven]));
$tab[$count]['TexteAnn'] = utf8_encode($ann[$colTexteAnn]);
$count++;
}
}
}
fclose($handle);
2012-05-20 16:31:28 +00:00
2011-08-09 15:40:02 +00:00
$this->view->assign('annonces', $tab);
$this->view->assign('nomFic', $nomFic);
$this->renderScript('surveillance/fichier-ann.phtml');
} else {
$this->_helper->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender(true);
2012-05-20 16:31:28 +00:00
//Récupération du fichier
$file = $path.'/'.$nomFic;
$file2 = $file.'.bz2';
if (!file_exists($file) || filesize($file)==0 ) {
//Génération du fichier
try {
$O = $client->getListeFichierSurv($user->getLogin(), $user->getPrenom(), $nomFic);
} catch (SoapFault $fault) {
}
require_once 'common/curl.php';
$page = getUrl('http://78.31.45.206/csv/'.$nomFic.'.bz2', '', '', '', false);
$body = $page['body'];
$fp=@fopen($file2, 'w');
@fwrite($fp, $body);
@fclose($fp);
$bz = bzopen($file2, "r") or die("Impossible d'ouvrir le fichier $file");
$fp=@fopen($file, 'w');
while (!feof($bz)) {
@fwrite($fp, bzread($bz, 4096));
}
bzclose($bz);
}
2012-05-20 16:31:28 +00:00
$content_type = 'application/csv-tab-delimited-table';
//Envoi du fichier sur la sortie standard
2012-01-25 09:48:27 +00:00
if ( file_exists($file) ) {
header('Content-Transfer-Encoding: none');
header('Content-type: ' . $content_type.'');
2012-01-25 09:48:27 +00:00
header('Content-Length: ' . filesize($file));
header('Content-MD5: ' . base64_encode(md5_file($file)));
header('Content-Disposition: filename="' . basename($file) . '"');
header('Cache-Control: private, max-age=0, must-revalidate');
header('Pragma: public');
ini_set('zlib.output_compression', '0');
echo file_get_contents($file);
} else {
echo 'Impossible de charger le fichier.';
2012-05-20 16:31:28 +00:00
}
2011-08-09 15:40:02 +00:00
}
2011-05-24 06:25:58 +00:00
}
2012-05-20 16:31:28 +00:00
2011-08-19 20:28:30 +00:00
/**
* Export surveillance en fichier pdf
*/
2011-08-09 15:40:02 +00:00
public function fichierpdfAction()
{
$this->_helper->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender(true);
2012-05-20 16:31:28 +00:00
2011-08-09 15:40:02 +00:00
$request = $this->getRequest();
2012-05-20 16:31:28 +00:00
$user = new Scores_Utilisateur();
2011-08-09 15:40:02 +00:00
$client = new SoapClient(null, array(
2012-05-20 16:31:28 +00:00
'trace' => 1,
'soap_version' => SOAP_1_1,
'location' => 'http://78.31.45.206/ws2/',
'uri' => 'http://78.31.45.206/',
'login' => $user->getLogin(),
'password' => $user->getPassword()
2011-08-09 15:40:02 +00:00
));
2012-05-20 16:31:28 +00:00
2011-08-09 15:40:02 +00:00
$nomFic = $request->getParam('q', '');
2012-05-20 16:31:28 +00:00
2011-08-09 15:40:02 +00:00
$filtre = $request->getParam('filtre', '');
2012-05-20 16:31:28 +00:00
if (strtolower($user->getLogin())=='cpcambr13') {
$filtre = 'procol';
2012-05-20 16:31:28 +00:00
}
2011-08-09 15:40:02 +00:00
if (!empty($filtre)){
switch (trim(strtolower($filtre))) {
case 'procol': $filtre = 'procol'; break;
case 'mmd': $filtre = 'mmd'; break;
case 'radiations': $filtre = 'radiations'; break;
case 'ventes': $filtre = 'ventes'; break;
case 'comptes': $filtre = 'comptes'; break;
case 'creations': $filtre = 'creations'; break;
case 'bodacc': $filtre = 'bodacc'; break;
default: $filtre = ''; break;
}
}
$c = Zend_Registry::get('config');
$path = $c->profil->path->files;
2012-05-20 16:31:28 +00:00
2011-08-09 15:40:02 +00:00
//Récupération du fichier
2012-01-17 10:47:39 +00:00
$file = $path.'/'.$nomFic;
2011-08-09 15:40:02 +00:00
$file2 = $file.'.bz2';
if (!file_exists($file) || filesize($file)==0 ) {
//Génération du fichier
try {
$O = $client->getListeFichierSurv($user->getLogin(), $user->getPrenom(), $nomFic);
} catch (SoapFault $fault) {
}
require_once 'common/curl.php';
$page = getUrl('http://78.31.45.206/csv/'.$nomFic.'.bz2', '', '', '', false);
$body = $page['body'];
$fp=@fopen($file2, 'w');
@fwrite($fp, $body);
@fclose($fp);
$bz = bzopen($file2, "r") or die("Impossible d'ouvrir le fichier $file");
$fp=@fopen($file, 'w');
while (!feof($bz)) {
@fwrite($fp, bzread($bz, 4096));
}
bzclose($bz);
}
2012-05-20 16:31:28 +00:00
2011-08-09 15:40:02 +00:00
$tab = array();
$row = 0;
$count = 0;
$handle = fopen($file, "r");
while (($ann = fgetcsv($handle, 3000, ';')) !== FALSE)
{
$row++;
if ($row==1)
{
// Ligne d'entête, on repère les colonnes
$num = count($ann);
for ($i=0; $i<$num; $i++)
{
if (utf8_encode($ann[$i])=='SITE_CNASEA') $colSiteCnasea=$i;
elseif(utf8_encode($ann[$i])=='Siren') $colSiren=$i;
elseif(utf8_encode($ann[$i])=='Nic') $colNic=$i;
elseif(utf8_encode($ann[$i])=='Référence') $colRef=$i;
elseif(utf8_encode($ann[$i])=='Parution') $colParution=$i;
elseif(utf8_encode($ann[$i])=='Bodacc') $colBodacc=$i;
elseif(utf8_encode($ann[$i])=='Date parution') $colDatePar=$i;
elseif(utf8_encode($ann[$i])=='Numéro Annonce') $colNumAnn=$i;
elseif(utf8_encode($ann[$i])=='Type Annonce') $colTypeAnn=$i;
elseif(utf8_encode($ann[$i])=='Tribunal') $colTribunal=$i;
elseif(utf8_encode($ann[$i])=='Numéro RCS') $colNumRCS=$i;
elseif(utf8_encode($ann[$i])=='Raison sociale') $colRaisonSociale=$i;
elseif(utf8_encode($ann[$i])=='Chapitre') $colChapitre=$i;
elseif(utf8_encode($ann[$i])=='Evènement(s)') $colEven=$i;
elseif(utf8_encode($ann[$i])=='Texte Annonce') $colTexteAnn=$i;
elseif(utf8_encode($ann[$i])=='Date évènement') $colDateEven=$i;
}
}
elseif ($filtre!='' && $filtre!='bodacc' && $ann[$colChapitre]!=$filtre )
{
//On fait rien
2012-05-20 16:31:28 +00:00
}
2011-08-09 15:40:02 +00:00
else
{
//$filtre=='bodacc'
if( substr($user->getLogin(),0,6)=='cnasea' && $ann[$colBodacc]!='A' && $ann[$colBodacc]!='B' && $ann[$colBodacc]!='C' )
{
//on supprime toutes les annonces pas bodacc
}
2012-03-02 16:39:51 +00:00
elseif (strtolower($user->getLogin())=='cpcambr14' && $ann[$colChapitre]=='procol')
{
//On supprime les annnonces de procol pour ce login
}
2011-08-09 15:40:02 +00:00
else
{
$tab[$count]['RaisonSociale'] = utf8_encode($ann[$colRaisonSociale]);
$tab[$count]['Siren'] = utf8_encode($ann[$colSiren]);
$tab[$count]['SiteCnasea'] = utf8_encode($ann[$colSiteCnasea]);
$tab[$count]['Ref'] = utf8_encode($ann[$colRef]);
$tab[$count]['Parution'] = utf8_encode($ann[$colParution]);
$tab[$count]['Bodacc'] = utf8_encode($ann[$colBodacc]);
$tab[$count]['DatePar'] = WDate::dateT('Ymd','d/m/Y',$ann[$colDatePar]);
$tab[$count]['Tribunal'] = utf8_encode($ann[$colTribunal]);
$tab[$count]['Even'] = utf8_encode(str_replace(', ','<br/>',$ann[$colEven]));
$tab[$count]['TexteAnn'] = utf8_encode($ann[$colTexteAnn]);
$count++;
}
}
}
fclose($handle);
$page = $request->getParam('page', '');
$nbAnnoncesMin = ($page-1)*100;
$nbAnnoncesMax = $nbAnnoncesMin+100;
2012-05-20 16:31:28 +00:00
2011-08-09 15:40:02 +00:00
$output = '';
$count = 0;
$annonces = $tab;
$nbAnnonces = count($annonces);
2012-05-20 16:31:28 +00:00
2011-08-09 15:40:02 +00:00
if($nbAnnonces>0){
foreach($annonces as $annonce){
if($count>$nbAnnoncesMax) break;
if($count>=$nbAnnoncesMin)
{
$output.= '<page backtop="10mm" backbottom="10mm">';
$output.= '<page_header>';
$output.= '<table style="width:100%; border:solid 1px black;">';
$output.= '<tr>';
$output.= '<td style="text-align:left; width:67%">Surveillance : '.$count.'/'.$nbAnnonces.'</td>';
$output.= '<td style="text-align:right; width:33%">'.date('d/m/Y').'</td>';
$output.= '</tr>';
$output.= '</table>';
$output.= '</page_header>';
$output.= '<table style="width:100%;">';
$output.= '<tr>';
$output.= '<td style="width:50%;">Entreprise : '.$annonce['RaisonSociale'].' ('.$annonce['Siren'].')</td>';
$output.= '<td style="width:50%;">&nbsp;</td>';
$output.= '</tr>';
$output.= '<tr>';
$output.= '<td style="width:50%;">Site : '.$annonce['SiteCnasea'].'</td>';
$output.= '<td style="width:50%;">Référence : '.$annonce['Ref'].'</td>';
$output.= '</tr>';
$output.= '<tr>';
if ($annonce['Bodacc']=='A' || $annonce['Bodacc']=='B' || $annonce['Bodacc']=='C')
{
$source = 'BODACC n&deg;'.$annonce['Parution'].'&nbsp;'.$annonce['Bodacc'].' du '.$annonce['DatePar'].' '.$annonce['Tribunal'].'.';
}
elseif ($annonce['Bodacc']=='G')
{
$source = 'GREFFE du '.$annonce['Tribunal'].' au '.$annonce['DatePar'].'.';
}
elseif ($annonce['Bodacc']=='P')
{
$source = 'RNCS du '.$annonce['Tribunal'].' au '.$annonce['DatePar'].'.';
}
else
{
$source = 'Collecte SD du '.$annonce['Tribunal'].' au '.$annonce['DatePar'].'.';
}
$output.= '<td style="width:100%;" colspan="2">'.$source.'</td>';
2012-05-20 16:31:28 +00:00
2011-08-09 15:40:02 +00:00
$output.= '</tr>';
$output.= '<tr><td style="width:100%;" colspan="2">&nbsp;</td></tr>';
$output.= '<tr>';
$output.= '<td style="width:100%;" colspan="2"><b>'.$annonce['Even'].'</b></td>';
$output.= '</tr>';
$output.= '<tr>';
$output.= '<td style="width:100%;" colspan="2">'.$annonce['TexteAnn'].'</td>';
$output.= '</tr>';
$output.= '</table>';
$output.= '</page>';
}
$count++;
}
}else{
/*
* Fermeture de la balise page lorsqu'il n'y a aucune annonce
* afin de générer un fichier pdf vide et non pas une erreur
*/
$output = '</page>';
}
// conversion HTML => PDF
require_once 'Vendors/html2pdf/html2pdf.class.php';
$html2pdf = new HTML2PDF('P','A4','fr');
$html2pdf->WriteHTML(utf8_decode($output));
$html2pdf->Output(str_replace('.csv', '.pdf', $nomFic), 'D');
2012-05-20 16:31:28 +00:00
}
2011-08-19 20:28:30 +00:00
}