/** * Retourne le module correspondant à l'assignment donné. * * @param Assignment $assignment L'assignment pour lequel on cherche le module. * @return Module */ public static function findByAssignment($assignment) { $assignmentId = $assignment->getId(); $data = BaseSingleton::select('SELECT ' . 'module.id as id, module.bareme_id as bareme_id, ' . 'module.label as label, module.description as description, ' . 'module.date_creation as date_creation, module.number as number, ' . 'module.affiche as affiche, assignment.id as assignment_id, exam.id as exam_id ' . 'FROM module, assignment, exam ' . 'WHERE assignment.module_id = module.id AND module.id = exam.module_id ' . 'AND assignment.id = ? ' . 'GROUP BY module.id', array('i', &$assignmentId)); $module = new Module(); $module->hydrate($data); return $module; }
if (isset($_POST['textVideo']) && $_POST['textVideo'] != "") { $assignment->uploadVideo($conn, $_POST['textVideo']); } if (isset($_FILES['uploadedFiles'])) { $fileCount = count($_FILES['uploadedFiles']["name"]); if ($fileCount != 0 && $_FILES['uploadedFiles']["name"][0] != "") { $assignment->uploadFiles($conn, $_FILES['uploadedFiles']); } } $assignment->setAttachments($conn); if (isset($_GET['action'])) { $action = (int) $_GET['action']; if ($action == 1) { ?> <meta http-equiv="refresh" content="0;url=assignment.php?id=<?php echo $assignment->getId(); ?> "><?php } else { if ($action == 2) { ?> <meta http-equiv="refresh" content="0;url=prehladZadani.php"><?php } } } $assignment->getEditingHtml($flag); } else { $assignment = new Assignment($conn, 0); $assignment->getEditingHtml(true); } mysqli_close($conn);