Mise à jour du comptage OK
This commit is contained in:
parent
ba61d4c817
commit
b530470273
@ -1,6 +1,5 @@
|
||||
<?php
|
||||
|
||||
class ComptageController extends Libs_Controller
|
||||
class ComptageController extends Zend_Controller_Action
|
||||
{
|
||||
public function init()
|
||||
{
|
||||
@ -69,13 +68,13 @@ class ComptageController extends Libs_Controller
|
||||
|
||||
//Comptage
|
||||
require_once 'Scores/Ciblage.php';
|
||||
$ciblage = new Ciblage($field->getValues());
|
||||
$ciblage = new Ciblage($values);
|
||||
|
||||
$data = array(
|
||||
'idDefinition' => $idCriteres,
|
||||
'resultat' => $ciblage->execute(),
|
||||
'uniteInsee' => $ciblage->calculRedevanceInsee(),
|
||||
'dateAjout' => date('d/m/Y H:i:s'),
|
||||
'dateAjout' => date('YmdHis'),
|
||||
);
|
||||
//Enregistrement
|
||||
$comptageM = new Table_Comptages();
|
||||
@ -84,7 +83,8 @@ class ComptageController extends Libs_Controller
|
||||
$result = array(
|
||||
'resultat' => number_format($data['resultat'], 0, '', ' '),
|
||||
'uniteInsee' => number_format($data['dateAjout'], 0, '', ' '),
|
||||
'dateAjout' => $data['dateAjout'],
|
||||
'dateAjout' => substr($data['dateAjout'],6,2).'/'.substr($data['dateAjout'],4,2).'/'.substr($data['dateAjout'],6,2)
|
||||
.' '.substr($data['dateAjout'],8,2).':'.substr($data['dateAjout'],10,2).':'.substr($data['dateAjout'],12,2),
|
||||
);
|
||||
$this->view->assign('result', $result);
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ Class Object_Dashboard
|
||||
);
|
||||
//Recherche des comptages
|
||||
$sql = $comptagesM->select(true)
|
||||
->columns(array('resultat', 'uniteInsee', 'dateAjout'))
|
||||
->columns(array('resultat', 'uniteInsee', "DATE_FORMAT(dateAjout, '%d/%m/%Y %H:%i:%s') as dateAjout"))
|
||||
->where('idDefinition = ?', $item['id'])
|
||||
->order('dateAjout DESC')->limit(1);
|
||||
$comptage = $comptagesM->fetchAll($sql)->toArray();
|
||||
@ -55,9 +55,7 @@ Class Object_Dashboard
|
||||
$auth = Zend_Auth::getInstance();
|
||||
$user = $auth->getIdentity();
|
||||
|
||||
$db = Zend_Registry::get('db');
|
||||
|
||||
$criteresM = new Table_Criteres($db);
|
||||
$criteresM = new Table_Criteres();
|
||||
|
||||
//Compter le nombre de page
|
||||
$sql = $criteresM->select()
|
||||
@ -88,7 +86,7 @@ Class Object_Dashboard
|
||||
);
|
||||
//Recherche des comptages
|
||||
$sql = $comptagesM->select(true)
|
||||
->columns(array('resultat', 'uniteInsee', 'dateAjout'))
|
||||
->from($comptageM, array('resultat', 'uniteInsee', "DATE_FORMAT(dateAjout, '%d/%m/%Y %H:%i:%s') as dateAjout"))
|
||||
->where('idDefinition = ?', $item['id'])
|
||||
->order('dateAjout DESC')->limit(1);
|
||||
$comptage = $comptagesM->fetchAll($sql)->toArray();
|
||||
|
@ -13,14 +13,16 @@ $(document).ready(function(){
|
||||
}
|
||||
});
|
||||
|
||||
$("a.update").click(function(){
|
||||
$("a.update").click(function(e){
|
||||
e.preventDefault();
|
||||
var href = $(this).attr('href');
|
||||
$(this).parent().parent().find('td.update').html('<img src="/themes/default/images/ajax.gif" />');
|
||||
var ligne = $(this).parent().parent();
|
||||
ligne.find('td.update').html('<img src="/themes/default/images/ajax.gif" />');
|
||||
$.getJSON(href, function(data){
|
||||
|
||||
|
||||
ligne.find('td.resultat').html(data.resultat);
|
||||
ligne.find('td.insee').html(data.uniteInsee);
|
||||
ligne.find('td.date').html(data.dateAjout);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
$('a.enrichissementref').on('click', function(){
|
||||
|
Loading…
Reference in New Issue
Block a user