enrichissement/application/controllers/IndexController.php

48 lines
1.4 KiB
PHP
Raw Normal View History

2012-01-13 13:35:11 +00:00
<?php
class IndexController extends Zend_Controller_Action
{
public function indexAction()
{
2012-01-15 17:43:37 +00:00
$db = Zend_Registry::get('db');
2012-01-17 11:44:02 +00:00
//Liste des profils
$profilM = new Application_Model_Profil();
$sql = $profilM->select();
2012-01-19 15:25:47 +00:00
$this->view->assign('listProfil', $profilM->fetchAll($sql));
2012-01-13 13:35:11 +00:00
2012-01-17 11:44:02 +00:00
$commandesM = new Application_Model_Commandes($db);
2012-01-13 13:35:11 +00:00
2012-01-15 17:43:37 +00:00
//Liste des fichiers en attente de profil
$sql = $commandesM->select()->where('idProfil = ?', 0);
$this->view->assign('fileAttenteProfil', $commandesM->fetchAll($sql));
2012-01-13 13:35:11 +00:00
2012-01-15 17:43:37 +00:00
//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();
$id = $request->getParam('id');
if (!empty($id)){
$db = Zend_Registry::get('db');
$commandesM = new Application_Model_Commandes($db);
2012-01-30 15:11:33 +00:00
$row = $commandesM->find($id);
echo json_encode(array('nbLigneT' => $row->nbLigneT));
}
}
2012-01-13 13:35:11 +00:00
}