コード例 #1
0
ファイル: module_create.php プロジェクト: hundrex/SERS
    echo "Insertion Assignment OK (id:" . $newAssignment->getId() . ", label:" . $newAssignment->getLabel() . ")";
} else {
    echo "ECHEC insertion assignment, good luck";
}
//********CREATION EXAM**********
//création de l'exam (qu'il faudra liée au module créer plutot)
$validExamLabel = filter_input(INPUT_POST, 'examLabel', FILTER_SANITIZE_STRING);
if ($validExamLabel != null) {
    $newExam->setLabel($validExamLabel);
}
$validExamDescription = filter_input(INPUT_POST, 'examDescription', FILTER_SANITIZE_STRING);
if ($validExamDescription != null) {
    $newExam->setDescription($validExamDescription);
}
$validExamDatePassage = filter_input(INPUT_POST, 'examDate', FILTER_VALIDATE_REGEXP, array("options" => array("regexp" => $myregex)));
if ($validExamDatePassage != null) {
    $newExam->setDatePassage($validExamDatePassage);
}
$validExamPrixRetry = filter_input(INPUT_POST, 'examRetryPrice', FILTER_SANITIZE_NUMBER_INT);
if ($validExamPrixRetry != null) {
    $newExam->setPrixRattrapage($validExamPrixRetry);
}
$newExam->setAffiche(1);
//insertion de l'exam dans la table
$validInsertExam = ExamDAL::insertOnDuplicate($newExam, $moduleId);
if ($validInsertExam != null) {
    echo "Insertion Exam OK (id:" . $newExam->getId() . ", label:" . $newExam->getLabel() . ")";
} else {
    echo "ECHEC insertion exam, good luck";
}
echo '<META HTTP-EQUIV="Refresh" Content="0; URL=../../?page=module_list&modification=success">';