From 5b9a742b3f59875401c8255c6e9de24e99c0d509 Mon Sep 17 00:00:00 2001 From: Michael RICOIS Date: Tue, 15 May 2012 15:02:37 +0000 Subject: [PATCH] Restart --- application/controllers/IndexController.php | 46 +++++++++---------- application/views/scripts/index/restart.phtml | 1 + 2 files changed, 23 insertions(+), 24 deletions(-) create mode 100644 application/views/scripts/index/restart.phtml diff --git a/application/controllers/IndexController.php b/application/controllers/IndexController.php index fd2110db..a2e13383 100644 --- a/application/controllers/IndexController.php +++ b/application/controllers/IndexController.php @@ -1,53 +1,53 @@ select(); $this->view->assign('listProfil', $profilM->fetchAll($sql)); - - $commandesM = new Application_Model_Commandes($db); - - //Liste des fichiers en attente de profil + + $commandesM = new Application_Model_Commandes($db); + + //Liste des fichiers en attente de profil $sql = $commandesM->select()->where('idProfil = ?', 0); - $this->view->assign('fileAttenteProfil', $commandesM->fetchAll($sql)); - + $this->view->assign('fileAttenteProfil', $commandesM->fetchAll($sql)); + //Liste des enrichissements en cours $sql = $commandesM->select() ->where('idProfil != ?', 0) ->where("dateStop = '0000-00-00 00:00:00'"); $this->view->assign('fileEnCours', $commandesM->fetchAll($sql)); - + //Liste des enrichissements terminé $sql = $commandesM->select() ->where("dateStop != '0000-00-00 00:00:00'") ->where("error = ''"); $this->view->assign('fileFinish', $commandesM->fetchAll($sql)); - - + + } - + public function getinfoAction() { $this->_helper->layout()->disableLayout(); $this->_helper->viewRenderer->setNoRender(true); - - $request = $this->getRequest(); + + $request = $this->getRequest(); $id = $request->getParam('id'); if (!empty($id)){ $commandesM = new Application_Model_Commandes(); - $result = $commandesM->find($id); + $result = $commandesM->find($id); $info = $result->current(); $output = array( 'nbLigneT' => $info->nbLigneT, - ); + ); echo json_encode($output); - } + } } - + public function getfileAction() { $this->_helper->layout()->disableLayout(); @@ -71,11 +71,9 @@ class IndexController extends Zend_Controller_Action echo 'Impossible de charger le fichier.'; } } - + public function restartAction() { - $this->_helper->layout()->disableLayout(); - $this->_helper->viewRenderer->setNoRender(true); $request = $this->getRequest(); $id = $request->getParam('id'); if (!empty($id)){ @@ -84,12 +82,12 @@ class IndexController extends Zend_Controller_Action 'nbLigneT' => 0, 'error' => '', 'dateStart' => '0000-00-00 00:00:00', - 'fichierOut' => '', + 'fichierOut' => '', ); $commandesM->update($data, "id=$id"); } } - + public function repriseAction() { $this->_helper->layout()->disableLayout(); @@ -103,7 +101,7 @@ class IndexController extends Zend_Controller_Action ); $commandesM->update($data, "id=$id"); } - exec("php ".APPLICATION_PATH."/../batch/enrichissement.php --reprise --id ".$id." &"); + exec("php ".APPLICATION_PATH."/../batch/enrichissement.php --reprise --id ".$id." &"); } - + } \ No newline at end of file diff --git a/application/views/scripts/index/restart.phtml b/application/views/scripts/index/restart.phtml new file mode 100644 index 00000000..b395a073 --- /dev/null +++ b/application/views/scripts/index/restart.phtml @@ -0,0 +1 @@ +Retour