Préparation StatsUtilisateurs

This commit is contained in:
Michael RICOIS 2011-03-11 15:41:46 +00:00
parent 875a7cd30f
commit 9edc2e6e3a

View File

@ -2681,11 +2681,20 @@ class Interne extends WsScore
} }
$iDbCrm = new WDB('sdv1'); $iDbCrm = new WDB('sdv1');
if ($type=='jour') { if ($type=='jour') {
$rep = $iDbCrm->select('logs', 'date(dateHeure) as jours, count(*) as nb', "1 $strPayant AND login='$login' AND dateHeure BETWEEN '$mois-01' AND '$mois-31' GROUP BY jours", true, MYSQL_ASSOC); $rep = $iDbCrm->select('logs',
'date(dateHeure) as jours, count(*) as nb',
"1 $strPayant AND login='$login' AND dateHeure BETWEEN '$mois-01' AND '$mois-31' GROUP BY jours",
true, MYSQL_ASSOC);
} elseif ($type=='heure') { } elseif ($type=='heure') {
$rep = $iDbCrm->select('logs', 'HOUR(dateHeure) as heures, count(*) as nb', "1 $strPayant AND login='$login' AND dateHeure BETWEEN '$mois-01' AND '$mois-31' GROUP BY heures", true, MYSQL_ASSOC); $rep = $iDbCrm->select('logs',
'HOUR(dateHeure) as heures, count(*) as nb',
"1 $strPayant AND login='$login' AND dateHeure BETWEEN '$mois-01' AND '$mois-31' GROUP BY heures",
true, MYSQL_ASSOC);
} }
$tabRet = $rep; $tabRet = $rep;
return array('error'=>array('errnum'=>0, 'errmsg'=>''), 'results'=>$tabRet); return array('error'=>array('errnum'=>0, 'errmsg'=>''), 'results'=>$tabRet);
} }