admin@role retourne maintenant uniquement les non-élèves
This commit is contained in:
parent
dd3d2844bb
commit
31b5fd6acb
|
@ -143,8 +143,8 @@ class DataBase{
|
|||
* @return enseignants<Array> retourne la liste des enseignants de la bdd
|
||||
*
|
||||
*/
|
||||
public static function listeEnseignants(){
|
||||
return userRepo::getTeachers();
|
||||
public static function listeUtilisateursRole(){
|
||||
return userRepo::getRoleUsers();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -94,14 +94,11 @@ class userRepo extends DBAccess{
|
|||
* @return FALSE<Boolean> retourne FAUX si aucun résultat
|
||||
*
|
||||
*/
|
||||
public static function getTeachers(){
|
||||
$getListeEnseignants = DataBase::getPDO()->query("SELECT DISTINCT ens.id_enseignant as id, u.nom, u.prenom, m.id_module, m.nom as module
|
||||
FROM utilisateur as u, enseignement as ens, mcc_module as mcc_m, module as m
|
||||
WHERE u.identifiant = ens.id_enseignant
|
||||
AND ens.id_mcc_module = mcc_m.id_mcc_module
|
||||
AND mcc_m.id_module = m.id_module
|
||||
GROUP BY ens.id_enseignant
|
||||
ORDER BY u.identifiant, m.nom ASC");
|
||||
public static function getRoleUsers(){
|
||||
$getListeEnseignants = DataBase::getPDO()->query("SELECT DISTINCT identifiant as id, nom, prenom
|
||||
FROM utilisateur
|
||||
WHERE droits <> 'student'
|
||||
ORDER BY identifiant ASC");
|
||||
|
||||
return DataBase::delNumeric( $getListeEnseignants->fetchAll() );
|
||||
}
|
||||
|
|
|
@ -99,7 +99,7 @@ require_once __ROOT__.'/manager/database.php';
|
|||
/* liste des enseignants */
|
||||
/*************************/
|
||||
case 'getListeEnseignants': if( permission('admin') ){
|
||||
$answer->userlist = DataBase::getInstance()->listeEnseignants();
|
||||
$answer->userlist = DataBase::getInstance()->listeUtilisateursRole();
|
||||
$answer->request = 'success';
|
||||
}else
|
||||
$answer->request = 'permission_error';
|
||||
|
|
Loading…
Reference in New Issue