$params = $DB->get_records_sql($sql_msg); foreach ($params as $param) { $msg = new object(); $msg->exam_name = $param->examtype . '-' . $param->lecturetype; $msg->course_name = $param->coursename; $msg->sem_name = $param->semestername; } $msg->classname = $class_name; // Create new if ($cres) { $message = get_string('createsuccess', 'local_scheduleexam', $msg); $options = array('style' => 'notifysuccess'); $hierarchy->set_confirmation($message, $returnurl, $options); } } redirect($returnurl); } echo $OUTPUT->header(); echo $OUTPUT->heading(get_string('pageheading', 'local_scheduleexam')); $currenttab = 'create'; $exams->tabs($currenttab, $id); if ($id < 0) echo $OUTPUT->box(get_string('createexamdes', 'local_scheduleexam')); else echo $OUTPUT->box(get_string('editexamdes', 'local_scheduleexam')); $scheduleexamobj->display(); echo $OUTPUT->footer();
} else if ($data = $editform->get_data()) { //This is the edit form condition if ($data->id > 0) { // Update $data->description = $data->description['text']; $result = $instance->lecturetype_update_instance($data); $instance->success_error_msg($result, 'success_up_lecture', 'error_up_lecture', $currenturl, $data); } else { // Create new $data->description = $data->description['text']; $result = $instance->lecturetype_add_instance($data); $instance->success_error_msg($result, 'success_add_lecture', 'error_add_lecture', $currenturl, $data); } redirect($returnurl); } echo $OUTPUT->header(); echo $OUTPUT->heading(get_string('create', 'local_lecturetype')); if ($id > 0) $currenttab = 'edit'; else $currenttab = 'create'; $instance->print_lecturetabs($currenttab, $id); if (isset($CFG->allowframembedding) and ! $CFG->allowframembedding) { if ($id < 0) echo $OUTPUT->box(get_string('allowframe', 'local_lecturetype')); else echo $OUTPUT->box(get_string('editframe', 'local_lecturetype')); } $editform->display(); echo $OUTPUT->footer();
if ($gradeeditform->is_cancelled()) { redirect($returnurl); } else{ if ($data = $gradeeditform->get_data()) { $data->schoolname = $DB->get_field('local_school', 'fullname', array('id' => $data->schoolid)); if ($data->id > 0) { // Update $gletters->gradeletter_update_instance($data); $message = get_string('updatedgradeletter', 'local_gradeletter', $data); } else { // Create new $gletters->gradeletter_add_instance($data); $message = get_string('createdgradeletter', 'local_gradeletter', $data); } $options = array('style' => 'notifysuccess'); $hierarchy->set_confirmation($message, $returnurl, $options); } } echo $OUTPUT->header(); echo $OUTPUT->heading(get_string('pluginheading', 'local_gradeletter')); $currenttab = 'create'; $gletters->createtabview_gl($currenttab, $id); echo $OUTPUT->box(get_string('managegradelettertabdes', 'local_gradeletter')); $gradeeditform->display(); echo $OUTPUT->footer();
$instance->success_error_msg($result, 'success_add_exam', 'error_add_exam', $currenturl, $data); } redirect($returnurl); } echo $OUTPUT->header(); echo $OUTPUT->heading(get_string('manageexamtype', 'local_examtype')); if ($id < 0) $currenttab = 'new'; else $currenttab = 'edit'; $instance->print_examtabs($currenttab, $id); if (isset($CFG->allowframembedding) and ! $CFG->allowframembedding) { if ($id > 0) echo $OUTPUT->box(get_string('editexamdesc', 'local_examtype')); else echo $OUTPUT->box(get_string('createexamdesc', 'local_examtype')); echo '</br>'; } $exists = $DB->get_records('local_scheduledexams', array('examtype' => $id)); if (empty($exists)) { $examtypeedit->display(); } else { $yesurl = new moodle_url('/local/examtype/index.php'); $message = get_string('notedit', 'local_examtype'); echo $OUTPUT->box_start('generalbox'); echo '<h4>' . $message . '</h4>'; echo $OUTPUT->single_button(new moodle_url('/local/examtype/index.php'), get_string('continue')); echo $OUTPUT->box_end(); } echo $OUTPUT->footer();