/** * compter_demandes_evaluation * * @param int $prof_id * @param string $user_join_groupes * @return array */ public static function DB_compter_demandes_evaluation($prof_id,$user_join_groupes) { $listing_eleves_id = DB_STRUCTURE_PROFESSEUR::DB_lister_ids_eleves_professeur($prof_id,$user_join_groupes); if(!$listing_eleves_id) return array(); $DB_SQL = 'SELECT demande_statut, COUNT(demande_id) AS nombre '; $DB_SQL.= 'FROM sacoche_demande '; $DB_SQL.= 'LEFT JOIN sacoche_jointure_user_matiere ON sacoche_demande.matiere_id=sacoche_jointure_user_matiere.matiere_id '; $DB_SQL.= 'WHERE eleve_id IN('.$listing_eleves_id.') AND prof_id IN(0,'.$_SESSION['USER_ID'].') AND sacoche_jointure_user_matiere.user_id=:user_id '; $DB_SQL.= 'GROUP BY demande_statut '; $DB_VAR = array(':user_id'=>$_SESSION['USER_ID']); return DB::queryTab(SACOCHE_STRUCTURE_BD_NAME , $DB_SQL , $DB_VAR , TRUE , TRUE); }