Préparation StatsUtilisateurs

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

View File

@ -2680,12 +2680,21 @@ class Interne extends WsScore
$strPayant='';
}
$iDbCrm = new WDB('sdv1');
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);
}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);
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);
} 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);
}
$tabRet = $rep;
return array('error'=>array('errnum'=>0, 'errmsg'=>''), 'results'=>$tabRet);
}