b265300d7a
+ Implementation de qtip 2.0
164 lines
9.9 KiB
PHP
164 lines
9.9 KiB
PHP
<?php
|
|
class CriteresController extends Zend_Controller_Action
|
|
{
|
|
public function indexAction(){}
|
|
protected $entreprise = array('siege', 'sirenGrp', 'tel', 'fax', 'web', 'mail', 'presentRcs', 'adrDom', 'dirNom', 'lieuAct', 'nbMPubli', 'dateCrea_ent', 'dateCrea_etab', 'nbActio', 'nbPart');
|
|
protected $economique = array('ape_etab', 'ape_entrep', 'NaceEtab', 'NaceEntrep', 'age_etab', 'age_entrep', 'teff_entrep', 'teff_etab', 'nbEtab', 'eff_entrep', 'eff_etab', 'capital');
|
|
protected $geographique = array('adr_cp', 'adr_dep', 'adr_com');
|
|
protected $juridique = array('cj', 'actifEco', 'procolHisto', 'tvaIntraValide', 'dateImmat');
|
|
protected $financier = array('bilType', 'avisCs', 'bilDuree', 'bilTca', 'bilAnnee', 'bilCloture', 'bilEE', 'bilFL', 'bilFK', 'bilFR', 'bilGF', 'bilGP', 'bilGU', 'bilGW', 'bilHD', 'bilHH', 'bilHL', 'bilHM', 'bilHN', 'bilYP');
|
|
|
|
protected function createSelectProvisoir($nb)
|
|
{
|
|
$array = array();
|
|
|
|
for($i = 0;$i != ($nb+1); $i++)
|
|
$array[$i] = "$i";
|
|
return ($array);
|
|
}
|
|
|
|
public function entrepriseAction()
|
|
{
|
|
$champs = array(array('name' => 'siege', 'libelle' => 'Siège', 'type' => 'select', 'parametres' => array('Etablissement' => '0', 'Siege' => '1')),
|
|
array('name' => 'sirenGrp', 'libelle' => 'Siren de groupe', 'type' => 'select', 'parametres' => array('Oui' => '1', 'Non' => '0')),
|
|
array('name' => 'tel', 'libelle' => 'Téléphone', 'type' => 'select', 'parametres' => array('Oui' => 1, 'Non' => '0')),
|
|
array('name' => 'fax', 'libelle' => 'Télécopie', 'type' => 'select', 'parametres' => array('Oui' => 1, 'Non' => '0')),
|
|
array('name' => 'web', 'libelle' => 'Site Internet', 'type' => 'select', 'parametres' => array('Oui' => '1', 'Non' => '0')),
|
|
array('name' => 'mail', 'libelle' => 'Email', 'type' => 'select', 'parametres' => array('Oui' => '1', 'Non' => '0')),
|
|
array('name' => 'presentRcs', 'libelle' => 'Etablissement présent au RNCS', 'type' => 'select', 'parametres' => array('Oui' => '1', 'Non' => '0')),
|
|
array('name' => 'adrDom', 'libelle' => 'Adresse de domiciliation', 'type' => 'select', 'parametres' => array('Oui' => '1', 'Non' => '0')),
|
|
array('name' => 'dirNom', 'libelle' => 'Nom du principal dirigeant', 'type' => 'select', 'parametres' => array('Oui' => '1', 'Non' => '0')),
|
|
array('name' => 'lieuAct', 'libelle' => 'Lieu d\'activté', 'type' => 'select', 'parametres' => array('0' => '0', '1' => '1', '2' => '2', '3' => '3', '4' => '4', '5' => '5', '6' => '6', '7' => '7', '8' => '8', '9' => '9', '91' => '91', '92' => '92', '93' => '93', '99' => '99')),
|
|
array('name' => 'nbMPubli', 'libelle' => 'Nombre de marchés publiques remportés', 'type' => 'interval:regle'),
|
|
array('name' => 'dateCrea_ent', 'libelle' => 'Date de création de l\'entreprose', 'type' => 'interval:date'),
|
|
array('name' => 'dateCrea_etab', 'libelle' => 'Date de création de l\'etablissement', 'type' => 'interval:date'),
|
|
array('name' => 'nbActio', 'libelle' => 'Nombre d\'actionnaires connus', 'type' => 'interval:regle'),
|
|
array('name' => 'nbPart', 'libelle' => 'Nombre de participations connues', 'type' => 'interval:regle')
|
|
);
|
|
$select['entreprise'] = $this->entreprise;
|
|
$this->view->selectRow = $select;
|
|
$this->view->champs = $champs;
|
|
}
|
|
|
|
public function economiqueAction()
|
|
{
|
|
$this->_helper->layout()->disableLayout();
|
|
$champs = array(array('name' => 'ape_etab', 'libelle' => 'Code NAF Etablissement', 'type' => 'text'),
|
|
array('name' => 'ou'),
|
|
array('name' => 'ape_etab', 'libelle' => 'Liste Code NAF Etablissement', 'type' => 'textarea'),
|
|
array('name' => 'ape_entrep', 'libelle' => 'Code NAF Entreprise', 'type' => 'text'),
|
|
array('name' => 'ou'),
|
|
array('name' => 'ape_entrep', 'libelle' => 'Liste Code NAF Entreprise', 'type' => 'textarea'),
|
|
array('name' => 'NaceEtab', 'libelle' => 'Code NACE de l\'établissement', 'type' => 'text'),
|
|
array('name' => 'ou'),
|
|
array('name' => 'NaceEtab', 'libelle' => 'Liste Code NACE de l\'établissement', 'type' => 'textarea'),
|
|
array('name' => 'NaceEntrep', 'libelle' => 'Code NACE de l\'entreprise', 'type' => 'text'),
|
|
array('name' => 'ou'),
|
|
array('name' => 'NaceEntrep', 'libelle' => 'Liste Code NACE de l\'entreprise', 'type' => 'textarea'),
|
|
array('name' => 'age_etab', 'libelle' => 'Code AGE Etablissement', 'type' => 'text'),
|
|
array('name' => 'age_entrep', 'libelle' => 'Code AGE Entreprise', 'type' => 'text'),
|
|
array('name' => 'teff_entrep', 'libelle' => 'Tranche d\'effectif de l\'entreprise', 'type' => 'interval:regle'),
|
|
array('name' => 'teff_etab', 'libelle' => 'Tranche d\'effectif de l\'etablissement', 'type' => 'interval:regle'),
|
|
array('name' => 'nbEtab', 'libelle' => 'Nombre d\'établissements', 'type' => 'interval'),
|
|
array('name' => 'eff_entrep', 'libelle' => 'Effectif réel de l\'entreprise', 'type' => 'interval'),
|
|
array('name' => 'eff_etab', 'libelle' => 'Effectif réel de l\'établissement', 'type' => 'interval'),
|
|
array('name' => 'capital', 'libelle' => 'Capital de l\'entreprise', 'type' => 'interval:regle'),
|
|
);
|
|
$this->view->champs = $champs;
|
|
}
|
|
|
|
public function nafAction()
|
|
{
|
|
$this->_helper->layout()->disableLayout();
|
|
$this->_helper->viewRenderer->setNoRender();
|
|
|
|
$request = $this->getRequest();
|
|
$niveau = $request->getParam('niveau', 1);
|
|
$parent = $request->getParam('parent', '');
|
|
$nafM = new Application_Model_Naf();
|
|
$sql = $nafM->select();
|
|
$niveau++;
|
|
|
|
if (!empty($parent) && $niveau==2) {
|
|
$sql->where('parent = ?', $parent);
|
|
} elseif (!empty($parent) && $niveau>2) {
|
|
$sql->where("code LIKE '".$parent."%'");
|
|
}
|
|
|
|
$sql->where('niveau = ?', $niveau)->order('code ASC');
|
|
|
|
$result = $nafM->fetchAll($sql)->toArray();
|
|
$tabNaf = array();
|
|
foreach($result as $item){
|
|
$naf = array(
|
|
'data' => $item['code'].' - '.$item['lib'],
|
|
'attr' => array('id' => $item['code'], 'niveau' => $item['niveau']),
|
|
);
|
|
if ($niveau<5){
|
|
$naf['state'] = 'closed';
|
|
$naf['children'] = array();
|
|
}
|
|
$tabNaf[] = $naf;
|
|
}
|
|
echo json_encode($tabNaf);
|
|
}
|
|
|
|
public function geographiqueAction()
|
|
{
|
|
$this->_helper->layout()->disableLayout();
|
|
$this->view->inlineScript()->appendFile('/themes/default/scripts/jquery.jstree.js');
|
|
$champs = array(array('name' => 'adr_cp', 'libelle' => 'Code postal', 'type' => 'text'),
|
|
array('name' => 'ou'),
|
|
array('name' => 'adr_cp', 'libelle' => 'Liste Code postal', 'type' => 'textarea'),
|
|
array('name' => 'adr_dep', 'libelle' => 'Département', 'type' => 'text'),
|
|
array('name' => 'ou'),
|
|
array('name' => 'adr_dep', 'libelle' => 'Liste Département', 'type' => 'textarea'),
|
|
array('name' => 'adr_com', 'libelle' => 'Code commune Insee', 'type' => 'text'),
|
|
array('name' => 'ou'),
|
|
array('name' => 'adr_com', 'libelle' => 'Liste Code commune Insee', 'type' => 'textarea'),
|
|
);
|
|
$this->view->champs = $champs;
|
|
}
|
|
|
|
public function juridiqueAction()
|
|
{
|
|
$this->_helper->layout()->disableLayout();
|
|
$champs = array(array('name' => 'cj', 'libelle' => 'Forme Juridique', 'type' => 'select', 'parametres' => array('1' => '1', '2' => '2', '3' => '3')),
|
|
array('name' => 'actifEco', 'libelle' => 'Établissement économiquement actif', 'type' => 'select', 'parametres' => array('Oui' => '1', 'Non' => '0')),
|
|
array('name' => 'procolHisto', 'libelle' => 'Présence d\'une procédure collective dans l\'histo.', 'type' => 'select', 'parametres' => array('Oui' => '1', 'Non' => '0')),
|
|
array('name' => 'tvaIntraValide', 'libelle' => 'Numéro de TVA Valide', 'type' => 'select', 'parametres' => array('Oui' => '1', 'Non' => '0')),
|
|
array('name' => 'dateImmat', 'libelle' => 'Date d\'immatriculation de l\'entreprise', 'type' => 'interval:date')
|
|
|
|
);
|
|
$this->view->champs = $champs;
|
|
}
|
|
|
|
public function financiereAction()
|
|
{
|
|
$this->_helper->layout()->disableLayout();
|
|
$champs = array(array('name' => 'bilType', 'libelle' => 'Type du dernier bilan', 'type' => 'select', 'parametres' => array('Inconnue' => 'I', 'Estimé' => 'E', 'Réel' => 'R')),
|
|
array('name' => 'avisCs', 'libelle' => 'Informations de paiements', 'type' => 'select', 'parametres' => $this->createSelectProvisoir(50)),
|
|
array('name' => 'bilDuree', 'libelle' => 'Durée du dernier bilan en mois', 'type' => 'select', 'parametres' => $this->createSelectProvisoir(9)),
|
|
array('name' => 'bilTca', 'libelle' => 'Tranche de CA issue du bilan', 'type' => 'select', 'parametres' => $this->createSelectProvisoir(23)),
|
|
array('name' => 'bilAnnee', 'libelle' => 'Dernière année de bilan', 'type' => 'interval'),
|
|
array('name' => 'bilCloture', 'libelle' => 'Dernière date de clôture du bilan', 'type' => 'interval'),
|
|
array('name' => 'bilEE', 'libelle' => 'Total bilan', 'type' => 'interval'),
|
|
array('name' => 'bilFL', 'libelle' => 'CA total', 'type' => 'interval'),
|
|
array('name' => 'bilFK', 'libelle' => 'Chiffre d\'affaires Export', 'type' => 'interval'),
|
|
array('name' => 'bilFR', 'libelle' => 'Produits d\'Exploitation', 'type' => 'interval'),
|
|
array('name' => 'bilGF', 'libelle' => 'Charges d\'Exploitation', 'type' => 'interval'),
|
|
array('name' => 'bilGP', 'libelle' => 'Produits Financiers', 'type' => 'interval'),
|
|
array('name' => 'bilGU', 'libelle' => 'Charges Financières', 'type' => 'interval'),
|
|
array('name' => 'bilGW', 'libelle' => 'RCAI (résultat courant avant impôt)', 'type' => 'interval'),
|
|
array('name' => 'bilHD', 'libelle' => 'Produits Exceptionnels', 'type' => 'interval'),
|
|
array('name' => 'bilHH', 'libelle' => 'Charges Exceptionnels', 'type' => 'interval'),
|
|
array('name' => 'bilHL', 'libelle' => 'Total des Produits', 'type' => 'interval'),
|
|
array('name' => 'bilHM', 'libelle' => 'Total des Charges', 'type' => 'interval'),
|
|
array('name' => 'bilHN', 'libelle' => 'Résultat', 'type' => 'interval'),
|
|
array('name' => 'bilYP', 'libelle' => 'Effectif de l\'entreprise au dernier bilan (poste YP)', 'type' => 'interval')
|
|
);
|
|
$this->view->champs = $champs;
|
|
}
|
|
|
|
}
|