extranet/application/controllers/IndexController.php
2012-05-20 16:31:28 +00:00

59 lines
1.5 KiB
PHP

<?php
class IndexController extends Zend_Controller_Action
{
public function indexAction()
{
$request = $this->getRequest();
$page = $request->getParam('page');
if ($page == 'annonces')
{
$siret = $request->getParam('siret');
$source = $request->getParam('source');
$idAnn = $request->getParam('idAnn');
$lien = '/juridique/annonces/siret/'.$siret;
if (!empty($source)) $lien.= '/source/'.$source;
if (!empty($idAnn)) $lien.= '/idAnn/'.$idAnn;
$this->_redirect($lien);
}
elseif ( Zend_Registry::get('theme')->name=='mobile' )
{
//Afficher le menu pour la version mobile
}
else
{
$this->_forward('entreprise', 'recherche');
}
}
/**
* Retourne l'url pour le csv d'export du portefeuille
*/
public function portefeuillecsvAction()
{
$this->_helper->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender(true);
require_once 'Scores/WsScores.php';
$user = new Scores_Utilisateur();
$login = $user->getLogin();
$idClient = $user->getIdClient();
$ws = new WsScores();
$reponse = $ws->getPortefeuilleCsv($login, $idClient);
$log = Zend_Registry::get('configuration')->path->data.'/log/altisys.log';
if ($reponse === false){
file_put_contents($log, date('Y-m-d H:i:s')." - URL = ERREUR\n", FILE_APPEND);
echo "Erreur";
} elseif (!empty($reponse->result->Url)) {
file_put_contents($log, date('Y-m-d H:i:s')." - URL = ".$reponse->result->Url."\n", FILE_APPEND);
echo $reponse->result->Url;
}
}
}