extranet/application/controllers/DevController.php

103 lines
5.4 KiB
PHP
Raw Normal View History

<?php
require_once ('Scores/WsScores.php');
Class devController extends Zend_Controller_Action
{
private $webService;
private $functions = array('getAnnonces' => array('string siren', '[integer filtre = 0]',
'[string idAnn = ]', '[integer position = 0]', '[integer nbRep = 100]'),
'getBanques' => array('string siren'),
'getBilan' => array('string siren', 'string millesime',
'[string typeBilan = N]', '[string ref = ]'),
'getDirigeants' => array('string siren', '[boolean histo = false]'),
'getIdentite' => array('string siret', '[integer id = 0]'),
'getIndiScore' => array('string siren', '[mixed nic = 0]',
'[mixed niveau = 2]', '[mixed plus = false]'),
'getInfosBourse' => array('string siren'),
'getInfosReg' => array('string siren', '[mixed id = false]'),
'getLiens' => array('integer siren', '[boolean actifsUniquement = true]'),
'getListeBilans' => array('string siren'),
'getListeCompetences' => array('string siret', 'string type', 'string codeInsee'),
'getListeEtablissements' => array('string siren', '[integer dep = 0]',
'[integer actif = -1]', '[integer position = 0]',
'[integer nbRep = 20]'),
'getListeEvenements' => array('string siren', '[string nic = 0]',
'[integer position = 0]', '[integer nbRep = 1000]'),
'getPrivilegesCumul' => array('string siren', '[array tabTypes = Array]'),
'getPrivilegesDetail' => array('string siren', '[array tabTypes = Array]'),
'getRapport' => array('string siren', '[integer niveau = 3]', '[integer id = 0]'),
'getRatios' => array('string siren', '[string page = ratios]'),
'getSurveillances' => array('SurveillancesFiltre filtre', '[integer position = 0]',
'[integer nbRep = 100]'),
'getTVA' => array('string siren'),
'getTribunaux' => array('array tabTypes'),
'isSirenExistant' => array('string siren'),
'rechercheAnnonce' => array('string source', 'string dateAnnee', 'integer numParution', 'integer numAnnonce'),
'rechercheEntreprise' => array('string type', 'RechercheEntreprise criteres',
'[integer position = 0]', '[integer nbRep = 20]',
'[integer maxRep = 200]', '[boolean pertinence = false]',
'[boolean avecSiren = false]'),
'searchMandataires' => array('mixed nom', '[array type = Array]', '[integer cpDep = 0]'),
'setSurveillance' => array('string siret', 'string email', '[string ref = ]',
'[string source = annonces]', '[boolean delete = false]',
'[integer encoursClient = 0]'),
'status' => array()
);
public function init()
{
$this->webService = new WsScores();
}
public function listefunctionAction()
{
$this->view->assign('listeFunctions', $this->functions);
}
protected function formatFunction($parametre, $function)
{
$i = 0;
if (!empty($parametre))
{
foreach($parametre as $name => $param) {
if($name != 'function')
{
if(!empty($param))
{
$format .= $param;
if($i > 0 and $i < count($parametre))
$format .= ',';
$i++;
}
}
}
if(!empty($parametre[1]))
{
echo '<center><b>Fonction::'.$function.'</b></center><br />';
if(!$result = $this->webService->$function($format))
echo 'erreur sur la fonction';
$this->view->assign('result', $result);
unset($_POST['function']);
}
//$this->view->render('dev/listefunction.phtml');
}
}
public function parametreAction()
{
$webService= new WsScores();
$request = $this->getRequest();
$function = $request->getParam('function');
//$this->_helper->layout()->disableLayout();
if (isset($function)) {
if(!empty($function)) {
self::formatFunction($this->getRequest()->getParams(), $function);
}
}
$this->view->assign('function', $function);
$this->view->assign('parametre', $this->functions[$function]);
}
}
?>