Restart
This commit is contained in:
parent
179b7e51ac
commit
5b9a742b3f
@ -1,53 +1,53 @@
|
|||||||
<?php
|
<?php
|
||||||
class IndexController extends Zend_Controller_Action
|
class IndexController extends Zend_Controller_Action
|
||||||
{
|
{
|
||||||
|
|
||||||
public function indexAction()
|
public function indexAction()
|
||||||
{
|
{
|
||||||
//Liste des profils
|
//Liste des profils
|
||||||
$profilM = new Application_Model_Profil();
|
$profilM = new Application_Model_Profil();
|
||||||
$sql = $profilM->select();
|
$sql = $profilM->select();
|
||||||
$this->view->assign('listProfil', $profilM->fetchAll($sql));
|
$this->view->assign('listProfil', $profilM->fetchAll($sql));
|
||||||
|
|
||||||
$commandesM = new Application_Model_Commandes($db);
|
$commandesM = new Application_Model_Commandes($db);
|
||||||
|
|
||||||
//Liste des fichiers en attente de profil
|
//Liste des fichiers en attente de profil
|
||||||
$sql = $commandesM->select()->where('idProfil = ?', 0);
|
$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
|
//Liste des enrichissements en cours
|
||||||
$sql = $commandesM->select()
|
$sql = $commandesM->select()
|
||||||
->where('idProfil != ?', 0)
|
->where('idProfil != ?', 0)
|
||||||
->where("dateStop = '0000-00-00 00:00:00'");
|
->where("dateStop = '0000-00-00 00:00:00'");
|
||||||
$this->view->assign('fileEnCours', $commandesM->fetchAll($sql));
|
$this->view->assign('fileEnCours', $commandesM->fetchAll($sql));
|
||||||
|
|
||||||
//Liste des enrichissements terminé
|
//Liste des enrichissements terminé
|
||||||
$sql = $commandesM->select()
|
$sql = $commandesM->select()
|
||||||
->where("dateStop != '0000-00-00 00:00:00'")
|
->where("dateStop != '0000-00-00 00:00:00'")
|
||||||
->where("error = ''");
|
->where("error = ''");
|
||||||
$this->view->assign('fileFinish', $commandesM->fetchAll($sql));
|
$this->view->assign('fileFinish', $commandesM->fetchAll($sql));
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getinfoAction()
|
public function getinfoAction()
|
||||||
{
|
{
|
||||||
$this->_helper->layout()->disableLayout();
|
$this->_helper->layout()->disableLayout();
|
||||||
$this->_helper->viewRenderer->setNoRender(true);
|
$this->_helper->viewRenderer->setNoRender(true);
|
||||||
|
|
||||||
$request = $this->getRequest();
|
$request = $this->getRequest();
|
||||||
$id = $request->getParam('id');
|
$id = $request->getParam('id');
|
||||||
if (!empty($id)){
|
if (!empty($id)){
|
||||||
$commandesM = new Application_Model_Commandes();
|
$commandesM = new Application_Model_Commandes();
|
||||||
$result = $commandesM->find($id);
|
$result = $commandesM->find($id);
|
||||||
$info = $result->current();
|
$info = $result->current();
|
||||||
$output = array(
|
$output = array(
|
||||||
'nbLigneT' => $info->nbLigneT,
|
'nbLigneT' => $info->nbLigneT,
|
||||||
);
|
);
|
||||||
echo json_encode($output);
|
echo json_encode($output);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getfileAction()
|
public function getfileAction()
|
||||||
{
|
{
|
||||||
$this->_helper->layout()->disableLayout();
|
$this->_helper->layout()->disableLayout();
|
||||||
@ -71,11 +71,9 @@ class IndexController extends Zend_Controller_Action
|
|||||||
echo 'Impossible de charger le fichier.';
|
echo 'Impossible de charger le fichier.';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function restartAction()
|
public function restartAction()
|
||||||
{
|
{
|
||||||
$this->_helper->layout()->disableLayout();
|
|
||||||
$this->_helper->viewRenderer->setNoRender(true);
|
|
||||||
$request = $this->getRequest();
|
$request = $this->getRequest();
|
||||||
$id = $request->getParam('id');
|
$id = $request->getParam('id');
|
||||||
if (!empty($id)){
|
if (!empty($id)){
|
||||||
@ -84,12 +82,12 @@ class IndexController extends Zend_Controller_Action
|
|||||||
'nbLigneT' => 0,
|
'nbLigneT' => 0,
|
||||||
'error' => '',
|
'error' => '',
|
||||||
'dateStart' => '0000-00-00 00:00:00',
|
'dateStart' => '0000-00-00 00:00:00',
|
||||||
'fichierOut' => '',
|
'fichierOut' => '',
|
||||||
);
|
);
|
||||||
$commandesM->update($data, "id=$id");
|
$commandesM->update($data, "id=$id");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function repriseAction()
|
public function repriseAction()
|
||||||
{
|
{
|
||||||
$this->_helper->layout()->disableLayout();
|
$this->_helper->layout()->disableLayout();
|
||||||
@ -103,7 +101,7 @@ class IndexController extends Zend_Controller_Action
|
|||||||
);
|
);
|
||||||
$commandesM->update($data, "id=$id");
|
$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." &");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
1
application/views/scripts/index/restart.phtml
Normal file
1
application/views/scripts/index/restart.phtml
Normal file
@ -0,0 +1 @@
|
|||||||
|
<a href="<?=$this->url(array('controller'=>'index', 'action'=>'index'))?>">Retour</a>
|
Loading…
Reference in New Issue
Block a user