Nouvelle présentation des fichiers

This commit is contained in:
Michael RICOIS 2012-12-04 16:36:12 +00:00
parent 81be70c43f
commit f559f69d1c
2 changed files with 50 additions and 7 deletions

View File

@ -4,7 +4,9 @@ class IndexController extends Zend_Controller_Action
public function indexAction()
{
//Liste des profils
$request = $this->getRequest();
$idClient = $request->getParam('idClient', null);
//Liste des profils
$profilM = new Application_Model_Profil();
$sql = $profilM->select();
$this->view->assign('listProfil', $profilM->fetchAll($sql));
@ -24,10 +26,34 @@ class IndexController extends Zend_Controller_Action
//Liste des enrichissements terminé
$sql = $commandesM->select()
->where("dateStop != '0000-00-00 00:00:00'")
->where("error = ''");
->where("error = ''")
->order('dateStart DESC');
if ( $idClient ) {
$sql->where('fichier LIKE '.$idClient.'-%');
} else {
$sql->limit(5);
}
$this->view->assign('fileFinish', $commandesM->fetchAll($sql));
//Récupérer les clients
$dbConfig = array(
'host' => MYSQL_HOST,
'port' => MYSQL_PORT,
'username' => MYSQL_USER,
'password' => MYSQL_PASS,
'dbname' => MYSQL_DEFAULT_DB,
'driver_options' => array(MYSQLI_INIT_COMMAND => 'SET NAMES UTF8;'),
//'driver_options' => array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES UTF8;')
);
$sqlmetier = Zend_Db::factory('Mysqli', $dbConfig);
$sql = $sqlmetier->select()
->from('sdv1.clients', array('id', 'nom'))
->where("actif = 'Oui'");
$clients = $sqlmetier->fetchAll($sql, null, Zend_Db::FETCH_OBJ);
$this->view->assign('clients', $clients);
}
public function getinfoAction()

View File

@ -63,7 +63,7 @@
<a class="restart" href="<?=$this->url(array('action'=>'restart', 'id'=>$file->id))?>">Remise à zéro et redémarrage</a>
<?php if ( !empty($file->error) ) {?>
| <a class="reprise" href="<?=$this->url(array('action'=>'reprise', 'id'=>$file->id))?>">Reprise manuelle sur erreur</a>
<?php }?>
<?php }?>
</td>
</tr>
<?php }?>
@ -76,17 +76,33 @@
<h2>Enrichissements terminés</h2>
<div>
<?php if (count($this->fileFinish)) {?>
<form method="post" action="./">
<div class="fieldgrp">
<label>Client</label>
<div class="field">
<select name="idClient">
<option value="">-</option>
<?php foreach ($this->clients as $client) {?>
<option value="<?=$client->id?>"><?=$client->nom?></option>
<?php }?>
</select>
</div>
<input type="submit" name="Selection" />
</form>
</div>
<div>
<?php if (count($this->fileFinish)) {?>
<table>
<thead>
<tr><th>Fichier</th><th>Date</th><th>Date Fin</th><th>Lignes total</th><th>Fichier enrichi</th></tr>
<tr><th>Fichier</th><th>Ajout</th><th>Départ</th><th>Fin</th><th>Lignes total</th><th>Fichier enrichi</th></tr>
</thead>
<tbody>
<?php foreach($this->fileFinish as $file) {?>
<tr>
<td><?=$file->fichier?></td>
<td><?=$file->dateAdded?></td>
<td><?=$file->dateStarted?></td>
<td><?=$file->dateStop?></td>
<td><?=$file->nbLigneT?></td>
<td>
@ -100,4 +116,5 @@
<?php } else {?>
<p>Vide</p>
<?php }?>
</div>
</div>