Пример #1
0
<?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];
Пример #2
0
 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;
 }
Пример #3
0
                                    <dd><?php 
        echo $user->getType()->getLabel();
        ?>
</dd>
                                </dl>
                            </li>
                            <?php 
        if ($user->getRole() === User::TYPE_USER_STUDENT) {
            ?>
                                <li>
                                    <dl class="dl-horizontal">
                                        <dt>Module(s) followed: </dt>
                                        <dd>

                                            <?php 
            $modules = ModuleDAL::findAllByEleve($user);
            if (sizeof($modules) === 0) {
                echo 'This user has not entered any module.';
            } else {
                ?>
                                                <ul>
                                                    <?php 
                foreach ($modules as $module) {
                    ?>
                                                        <li>
                                                            <?php 
                    echo $module->getLabel();
                    ?>
                                                        </li>
                                                    <?php 
                }
Пример #4
0
                        <dt>Email: </dt>
                        <dd><?php 
echo $userNow->getMail();
?>
</dd>
                    </dl>
                </li>
            </ul>
        </div>
    </div>
</div>

<!--Differ is student or teacher-->
<?php 
if ($userNow->isStudent()) {
    $modulesUser = ModuleDAL::findAllByEleve($userNow);
    ?>
    <div class="panel panel-default">
        <div class="panel-heading">Followed modules</div>
        <div class="panel-body">
            <div class="panel-list">
                <ul class="list-unstyled">
                    <?php 
    foreach ($modulesUser as $module) {
        ?>
                    <li>
                        <dl class="dl-horizontal">
                            <dt><?php 
        echo $module->getLabel();
        ?>
</dt>