extranet/application/controllers/IndexController.php

59 lines
1.5 KiB
PHP
Raw Normal View History

2010-11-22 12:50:12 +00:00
<?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;
2012-05-20 16:31:28 +00:00
$this->_redirect($lien);
}
elseif ( Zend_Registry::get('theme')->name=='mobile' )
2012-04-19 10:27:17 +00:00
{
2012-05-20 16:31:28 +00:00
//Afficher le menu pour la version mobile
2012-04-19 10:27:17 +00:00
}
2012-05-20 16:31:28 +00:00
else
{
2012-04-19 10:27:17 +00:00
$this->_forward('entreprise', 'recherche');
}
2010-11-22 12:50:12 +00:00
}
2012-05-20 16:31:28 +00:00
2012-03-22 08:31:33 +00:00
/**
* Retourne l'url pour le csv d'export du portefeuille
*/
public function portefeuillecsvAction()
{
$this->_helper->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender(true);
2012-05-20 16:31:28 +00:00
require_once 'Scores/WsScores.php';
2012-05-20 16:31:28 +00:00
$user = new Scores_Utilisateur();
$login = $user->getLogin();
$idClient = $user->getIdClient();
2012-05-20 16:31:28 +00:00
$ws = new WsScores();
$reponse = $ws->getPortefeuilleCsv($login, $idClient);
2012-05-20 16:31:28 +00:00
$log = Zend_Registry::get('configuration')->path->data.'/log/altisys.log';
2012-05-20 16:31:28 +00:00
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;
2012-05-20 16:31:28 +00:00
}
}
2012-05-20 16:31:28 +00:00
2010-11-22 12:50:12 +00:00
}