diff --git a/application/modules/frontend/controllers/DashboardController.php b/application/modules/frontend/controllers/DashboardController.php index 5f4250b2..6049266e 100644 --- a/application/modules/frontend/controllers/DashboardController.php +++ b/application/modules/frontend/controllers/DashboardController.php @@ -30,6 +30,7 @@ class DashboardController extends Libs_Controller public function ciblageAction() { require_once('Scores/Field.php'); + $config = new Zend_Config_Ini(APPLICATION_PATH.'/configs/configuration.ini'); $object = new Object_Dashboard(); $request = $this->getRequest(); $comptage = $object->ciblagedetail($request->getParam('id')); @@ -40,7 +41,7 @@ class DashboardController extends Libs_Controller $this->view->criteres = $comptage['criteres']; $this->view->comptages = $comptage['comptages']; $this->view->enrichissements = $enrichissement; - + $this->view->pathfile = $config->path->data; } public function rcomptageAction() @@ -80,7 +81,7 @@ class DashboardController extends Libs_Controller { $auth = Zend_Auth::getInstance(); $user = $auth->getIdentity(); - + $config = new Zend_Config_Ini(APPLICATION_PATH.'/configs/configuration.ini'); //Criteres => Comptages (last) => enrichissement_identifiants => enrichissement_commandes $enrichissementsM = new Table_EnrichissementIdentifiants(); @@ -125,6 +126,7 @@ class DashboardController extends Libs_Controller ->where('i.dateStart != ?', '0000-00-00 00:00:00'); $fini = $enrichissementsM->fetchAll($sql)->toArray(); $this->view->fini = $fini; + $this->view->pathfile = $config->path->data; } /** diff --git a/application/modules/frontend/controllers/EnrichissementController.php b/application/modules/frontend/controllers/EnrichissementController.php index 0c64a548..e342444e 100644 --- a/application/modules/frontend/controllers/EnrichissementController.php +++ b/application/modules/frontend/controllers/EnrichissementController.php @@ -69,6 +69,7 @@ class EnrichissementController extends Zend_Controller_Action */ public function commandeAction() { + set_time_limit(60); $this->_helper->layout()->disableLayout(); $request = $this->getRequest(); @@ -128,9 +129,9 @@ class EnrichissementController extends Zend_Controller_Action 'error' => '', 'dateAdded' => date('YmdHms'), ); - $identifiantsM = new Table_EnrichissementIdentifiants(); $idIdentifiant = $identifiantsM->insert($data); + exec('php '.APPLICATION_PATH.'/../batch/enrichissement.php --id '.$idIdentifiant, $info = array()) or die(print_r($info)); } /** @@ -215,5 +216,24 @@ class EnrichissementController extends Zend_Controller_Action } + public function downloadAction() + { + $id = $this->getRequest()->getParam('id'); + if(!empty($id)) { + $table = new Table_EnrichissementIdentifiants(); + $sql = $table->select() + ->where('id = ?', $id); + $result = $table->fetchRow($sql); + if(!empty($result)) { + $result->toArray(); + $config = new Zend_Config_Ini(APPLICATION_PATH.'/configs/configuration.ini'); + if(file_exists($result['fichier'])) + echo file_get_contents($result['fichier']); + else + echo 'Le fichier n\'éxiste plus...'; + } + } + exit; + } } \ No newline at end of file diff --git a/application/modules/frontend/views/scripts/dashboard/ciblage.phtml b/application/modules/frontend/views/scripts/dashboard/ciblage.phtml index 6f36cad0..3029f772 100644 --- a/application/modules/frontend/views/scripts/dashboard/ciblage.phtml +++ b/application/modules/frontend/views/scripts/dashboard/ciblage.phtml @@ -63,7 +63,7 @@