public function getModule() { $module = null; if (is_int($this->extModule)) { $module = ModuleDAL::findById($this->extModule); $this->extModule = $module; } else { if (is_a($this->extModule, "Module")) { $module = $this->extModule; } } return $module; }
<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/SERS/SERS/model/class/Serie.php'; require_once $_SERVER['DOCUMENT_ROOT'] . '/SERS/SERS/model/DAL/ModuleDAL.php'; require_once $_SERVER['DOCUMENT_ROOT'] . '/SERS/SERS/model/DAL/UserDAL.php'; $moduleId = filter_input(INPUT_GET, 'module_id', FILTER_SANITIZE_NUMBER_INT); $module = ModuleDAL::findById($moduleId); $students = UserDAL::findAllByModule($module); $data = array(); $bigdata = array(); foreach ($students as $student) { $nomSerie = new Serie("nom"); $prenomSerie = new Serie("prenom"); $passSerie = new Serie("pass"); $userSerie = new Serie("user"); $nomSerie->data = $student->getNom(); $prenomSerie->data = $student->getPrenom(); $pass = $student->getSuccessModule($moduleId); if ($pass === 1) { $studentPass = '******'; } else { if ($pass === 0) { $studentPass = '******'; } else { $studentPass = '******'; } } $passSerie->data = $studentPass; $userSerie->data = array($nomSerie, $prenomSerie, $passSerie); $data[] = $userSerie; }
$student->setMail($validEmail); $student->setType(4); //place l'user type à 4 (correspond à l'id de student) //Insertion du student dans la table user $validInsertion = UserDAL::insertOnDuplicate($student); if ($validInsertion != null) { echo "Insertion Etudiant OK"; } else { echo "ECHEC insertion Etudiant, good luck"; } //Gestion des module selectionner $unModule = $_POST['module']; if (empty($unModule)) { echo "You didn't select any module."; } $N = count($unModule); $module = new Module(); $moduleId = 0; for ($i = 0; $i < $N; $i++) { $moduleId = (int) $unModule[$i]; //recup l'id du module select, le cast en int et le stock $module = ModuleDAL::findById($moduleId); //recherche le module correspondant à partir de son id $module->inscrireEleve($student); //inscrit dans ce module le student qui a était précédemment créer ModuleDAL::insertOnDuplicate($module); //met a jout le module avec son nouveau etudiant ModuleDAL::inscritStudentModule($student->getId(), $moduleId); echo "Ajout de " . $student->getNom() . " dans le module " . $module->getLabel() . "</br>"; } echo '<META HTTP-EQUIV="Refresh" Content="0; URL=../../?page=student_list&modification=success">';
<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/SERS/SERS/model/class/Serie.php'; require_once $_SERVER['DOCUMENT_ROOT'] . '/SERS/SERS/model/DAL/ModuleDAL.php'; require_once $_SERVER['DOCUMENT_ROOT'] . '/SERS/SERS/model/DAL/UserDAL.php'; $studentId = filter_input(INPUT_GET, 'student_id', FILTER_SANITIZE_NUMBER_INT); $student = UserDAL::findById($studentId); $modules = ModuleDAL::findAllByEleve($student); $categories = array(); $data = array(); $databaseData = array(); foreach ($modules as $module) { $categories[] = $module->getLabel(); $assignmentMarks = $student->getNoteStudentAssignment($module->getId()); $examMarks = $student->getNoteStudentExam($module->getId()); if ($assignmentMarks === -1) { $assignmentMarks = null; } if ($examMarks === -1) { $examMarks = null; } $databaseData[] = array($assignmentMarks, $examMarks); } $assignmentData = array(); $assignmentReturn = array(); $examData = array(); $examReturn = array(); $finalData = array(); $finalReturn = array(); foreach ($databaseData as $row) { $assignMark = $row[0];
//Vérifie ce qui est renvoyer par le POST de /view/phtml/module_create.php //et set de l'objet newModule au fur et à mesure $validModuleLabel = filter_input(INPUT_POST, 'label', FILTER_SANITIZE_STRING); $newModule->setLabel($validModuleLabel); $validModuleNumber = filter_input(INPUT_POST, 'moduleNumber', FILTER_SANITIZE_NUMBER_INT); $newModule->setNumber($validModuleNumber); $validModuleDescription = filter_input(INPUT_POST, 'descriptionModule', FILTER_SANITIZE_STRING); $newModule->setDescription($validModuleDescription); $newModule->setBareme(1); //barème par defaut $newModule->setAffiche(1); //visible //$newModule->setAssignment($newAssignment); //lors de la creation du module dans la table, l'attribut moduleId de l'assignemnt va etre modifier a la valeur de ce module. //$newModule->setExam($newExam); //lie l'exam à ce module //insertion du module dans la table $validInsertModule = ModuleDAL::insertOnDuplicate($newModule); $moduleId = $newModule->getId(); if ($validInsertModule != null) { $moduleId = $newModule->getId(); echo "Insertion Module OK (id:" . $moduleId . ")"; } else { echo "ECHEC insertion module, good luck"; } //***********CREATION ASSIGNMENT********** //création de l'assignement (qu'il faudra liée au module créer plutot), //set les champs s'ils ont été remplis. $validAssignmentLabel = filter_input(INPUT_POST, 'assignmentLabel', FILTER_SANITIZE_STRING); //supprime les caractère pas gentil, if ($validAssignmentLabel != null) { $newAssignment->setLabel($validAssignmentLabel); //s'il a été rempli, alors set le label
<?php if (isset($_SESSION['user']) && isset($_SESSION['role']) && $_SESSION['role'] > User::TYPE_USER_STUDENT) { ?> <META HTTP-EQUIV="Refresh" Content="0; URL=./?error=403"> <?php } else { ?> <?php require_once $_SERVER['DOCUMENT_ROOT'] . '/SERS/SERS/model/DAL/ModuleDAL.php'; require_once $_SERVER['DOCUMENT_ROOT'] . '/SERS/SERS/model/DAL/UserDAL.php'; $module_id = filter_input(INPUT_GET, 'module_id', FILTER_SANITIZE_NUMBER_INT); $module = ModuleDAL::findById($module_id); $students = UserDAL::findAllByModule($module); $studentCurrent = UserDAL::findById($_SESSION['user']); ?> <div class="row"> <div class="col-lg-6"> <div class="input-group"> <label for="title"> <h4> <?php echo $module->getLabel(); ?> </h4> </label> <p> <?php echo $module->getDescription(); ?>
public function getMoyenneExam() { return ModuleDAL::moyenneExam($this->id); }
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ require_once '../../model/class/User.php'; require_once '../../model/DAL/UserDAL.php'; require_once '../../model/class/Module.php'; require_once '../../model/DAL/ModuleDAL.php'; //Création du module à update $module = new Module(); $validModuleId = filter_input(INPUT_POST, 'module', FILTER_SANITIZE_STRING); $module = ModuleDAL::findById($validModuleId); //recupre le module associé à l'id renvoyer par module_inscription //Supprime toute les lignes dans la table user_inscrit_module, où l'id de ce module apparait //permet de raz les liaison entre ce module et les user afin de rebartir avec un nouveau lot de student ModuleDAL::razListeStudentInscrit($validModuleId); //Gestion des student selectionner $mesStudent = $_POST['student']; if (empty($mesStudent)) { echo "You didn't select any students."; } $N = count($mesStudent); $student = new User(); $studentId = 0; for ($i = 0; $i < $N; $i++) { $studentId = (int) $mesStudent[$i]; //recup l'id du student select, le cast en int et le stock ModuleDAL::inscritStudentModule($studentId, $validModuleId); } echo '<META HTTP-EQUIV="Refresh" Content="0; URL=../../?page=module_inscription&modification=success">';
<?php require_once 'model/DAL/ModuleDAL.php'; require_once 'model/DAL/TypeDAL.php'; // Test the user's level of access $role = $_SESSION['user']->getRole()->getName(); if ($role === 'Professor') { $_SESSION['data']['modules'] = ModuleDAL::findAll(); $_SESSION['data']['types'] = TypeDAL::findAll(); require_once 'view/menu/menu_administration.phtml'; require_once 'view/administration/administration_report.phtml'; } else { header('Location: ../home'); }
<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/WebBristol/model/DAL/UserDAL.php'; require_once $_SERVER['DOCUMENT_ROOT'] . '/WebBristol/model/DAL/ModuleDAL.php'; // Test the user's level of access $role = $_SESSION['user']->getRole()->getName(); if ($role === 'Professor') { $_SESSION['data']['modules'] = ModuleDAL::findAll(); require_once 'view/menu/menu_exam.phtml'; require_once 'view/exam/exam_bymodule.phtml'; } else { $_SESSION['data']['modules'] = ModuleDAL::findAllByStudent($_SESSION['user']->getId()); require_once 'view/menu/menu_exam.phtml'; require_once 'view/exam/exam_bymodule_student.phtml'; }
<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/WebBristol/model/DAL/ModuleDAL.php'; require_once $_SERVER['DOCUMENT_ROOT'] . '/WebBristol/model/DAL/UserHasModuleDAL.php'; // Test the user's level of access $role = $_SESSION['user']->getRole()->getName(); if ($role === 'Professor') { //Return every modules $_SESSION['data']['modules'] = ModuleDAL::findAll(); require_once 'view/menu/menu_module.phtml'; require_once 'view/module/module_all.phtml'; } else { //Return every modules by user connected $usersHaveModule = UserHasModuleDAL::findByUser($_SESSION['user']->getId()); foreach ($usersHaveModule as $userHasModule) { $_SESSION['data']['modules'][] = ModuleDAL::findById($userHasModule->getUserId()); } require_once 'view/menu/menu_module.phtml'; require_once 'view/module/module_all.phtml'; }
<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/WebBristol/model/DAL/ModuleDAL.php'; if (isset($_GET['id'])) { $id = filter_input(INPUT_GET, 'id'); } else { // 403 $_SESSION['message']['danger'] = 'You can\'t access this page.'; header('Location: ../home'); die; } // Test the user's level of access $role = $_SESSION['user']->getRole()->getName(); $_SESSION['data']['mode'] = 'edit'; if ($role === 'Professor') { $_SESSION['data']['users'] = UserDAL::findAll(); $_SESSION['data']['module'] = ModuleDAL::findById($id); require_once 'view/menu/menu_module.phtml'; require_once 'view/module/module_form.phtml'; } else { // 403 $_SESSION['message']['danger'] = 'You can\'t access this page.'; header('Location: ../home'); }
</li> <?php } ?> </ul> </div> </div> </div> <?php } ?> <?php if ($userNow->isEnseignant()) { $modulesUser = ModuleDAL::findAllByEnseignant($userNow); ?> <div class="panel panel-default"> <div class="panel-heading">Student list for each teached module</div> <div class="panel-body"> <div class="panel-list"> <ul class="list-unstyled"> <?php foreach ($modulesUser as $module) { ?> <?php $students = UserDAL::findAllByModule($module); ?> <li> <div class="panel panel-default"> <div class="panel-heading"><?php
<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/SERS/SERS/model/class/SerieStack.php'; require_once $_SERVER['DOCUMENT_ROOT'] . '/SERS/SERS/model/DAL/UserDAL.php'; if (isset($_COOKIE['user_id']) && isset($_COOKIE['user_role']) && $_COOKIE['user_role'] == User::TYPE_USER_TEACHER) { $enseignantId = (int) $_COOKIE['user_id']; //recupe l'id de l'enseignant logguer $enseignant = UserDAL::findById($enseignantId); //recup l'objet User liier a cette enseignant $mesModules = ModuleDAL::findAllByEnseignant($enseignant); //recupère les module de l'enseignant } if (isset($_COOKIE['user_id']) && isset($_COOKIE['user_role']) && $_COOKIE['user_role'] == User::TYPE_USER_ROOT) { $mesModules = ModuleDAL::findAll(); //recupère TOUS les modules } $categories = array(); $data = array(); $databaseData = array(); foreach ($mesModules as $module) { if ($module->getPourcentageHaveModule() >= 0) { $categories[] = $module->getLabel(); $databaseData[] = $module->getPourcentageHaveModule() * 100.0; } } $passFinalData = array(); $failFinalData = array(); foreach ($databaseData as $passFinalDatabaseData) { $passFinal = $passFinalDatabaseData; $passFinalData[] = $passFinal; $failFinalData[] = 100 - $passFinal;
public function getModule() { $mesModules = array(); if (is_int($this->type)) { if (TypeUserDAL::findById($this->type)->getCode() == self::TYPE_USER_STUDENT) { $mesModules = ModuleDAL::findAllByEleve($this); //retourne un array des module auquel l'éléve est inscrit } else { echo "User.php_getModule(int): methode appeler sur un User qui n'est pas de type Student</br>"; } } else { if (is_a($this->type, "TypeUser")) { if ($this->type->getCode() == self::TYPE_USER_STUDENT) { $mesModules = ModuleDAL::findAllByEleve($this); } else { echo "User.php_getModule(typeUser): methode appeler sur un User qui n'est pas de type Student"; } } else { echo "User.php_getModule: methode appeler avec un User de type qui n'est ni un TypeUser ni un Int..."; } } return $mesModules; }
public function getModule() { return ModuleDAL::findByExam($this); }
} ?> </dd> </dl> </li> <?php } ?> <?php if ($user->getRole() === User::TYPE_USER_TEACHER) { ?> <li> <dl class="dl-horizontal"> <dt>Module(s) teached: </dt> <dd> <?php $modules = ModuleDAL::findAllByEnseignant($user); ?> <?php foreach ($modules as $module) { ?> <li> <?php echo $module->getLabel(); ?> </li> <?php } ?> </dd> </dl> </li>
?> <META HTTP-EQUIV="Refresh" Content="0; URL=./?error=403"> <?php } else { ?> <?php require_once $_SERVER['DOCUMENT_ROOT'] . '/SERS/SERS/model/DAL/UserDAL.php'; ?> <script type="text/javascript" src="./view/javascript/report_e.js"></script> <div class="row filter-bar"> <div class="col-lg-6"> <div class="input-group"> <?php $modules = ModuleDAL::findAll(); ?> <span class="input-group-addon" id="moduleSelecterReportE">Module</span> <select id="report-e-selecter" class="form-control"> <?php foreach ($modules as $module) { ?> <option value="<?php echo $module->getId(); ?> "> <?php echo $module->getLabel(); ?> </option>
public function getModule() { return ModuleDAL::findByAssignment($this); }