/** * To display success and error message based on condition * @param int $output it holds reultent value * @param string $success it holds the success message * @param string $error - error message * @param string $currenturl(display the confirmation message in this url) * @param object $data used to print dynamic string * @return display confirmation message */ function success_error_msg($output, $success, $error, $currenturl, $data) { $hier = new hierarchy(); if ($output) $confirm_msg = get_string($success, 'local_lecturetype', $data); else $confirm_msg = get_string($error, 'local_lecturetype', $data); $hier->set_confirmation($confirm_msg, $currenturl, array('style' => 'notifysuccess')); }
/** * To display success and error message based on condition * @param int $output it holds reultent value * @param string $success it holds the success message * @param string $error - error message * @param string $currenturl(display the confirmation message in this url) * @param object $data used to print dynamic string * @return display confirmation message */ function success_error_msg($output, $success, $error, $currenturl, $data) { $hier = new hierarchy(); if ($output) { $confirm_msg = get_string($success, 'local_examtype', $data); $options = array('style' => 'notifysuccess'); } else { $confirm_msg = get_string($error, 'local_examtype', $data); $options = array('style' => 'notifyproblem'); } $hier->set_confirmation($confirm_msg, $currenturl, $options); }
/** * @method mentorrejectdropcourse * @todo used to update data when mentor rejected drop course request(student request) * @param int $userid user id * @param int $courseid class id * @return display confirmation message * */ function mentorrejectdropcourse($userid, $courseid) { global $DB; $hierarchy = new hierarchy(); $usercourse = $DB->get_records('local_course_adddrop', array('userid' => $userid, 'classid' => $courseid)); $returnurl = new moodle_url('/local/adddrop/mentor.php?current=pending'); foreach ($usercourse as $usercourses) { $publish = new stdClass(); $publish->id = $usercourses->id; $publish->mentorapproval = 2; $out = $DB->update_record('local_course_adddrop', $publish); } if ($out) { $message = get_string('mentorrejectedcourse', 'local_courseregistration'); $hierarchy->set_confirmation($message, $returnurl, array('style' => 'notifysuccess')); } }
* @author Naveen Kumar<*****@*****.**> * (Resolved) Added succes message after updating the department visibilty */ if ($data->visible == 1) { $data->visible = 'Activated'; } else { $data->visible = 'Inactivated'; } if ($result) { $message = get_string('dept_success', 'local_departments', $data); $style = array('style' => 'notifysuccess'); } else { $message = get_string('dept_failure', 'local_departments', $data); $style = array('style' => 'notifyproblem'); } $hier1->set_confirmation($message, $returnurl, $style); } //-------end of code hide and show------------------------------------------- //for edit purpose // if ($id > 0) $PAGE->navbar->add(get_string('edit_department', 'local_departments')); else $PAGE->navbar->add(get_string('createdept', 'local_departments')); echo $OUTPUT->header(); //----------------manage dept heading------------------------ echo $OUTPUT->heading(get_string('dept_heading', 'local_departments')); try { //checking the id is greater than one...if its fetching content from table...used in edit purpose if ($id > 0) { if (!($tool = $DB->get_record('local_department', array('id' => $id)))) {
} else { /* ---insertion part--- */ foreach ($temp_set as $k => $v) { $temp->schoolid = $form_data['schoolid']; $temp->name = $v; if (empty($form_data[$v])) $form_data[$v] = 0; $temp->value = $form_data[$v]; $DB->insert_record('local_school_settings', $temp); } } /* ---end of else--- */ $confirm_msg = get_string('suc_update', 'local_cobaltsettings'); $options = array('style' => 'notifysuccess'); $hier1->set_confirmation($confirm_msg, $currenturl, $options); } /* ---end of main if--- */ $registrar_asigned_school = $schoolid; foreach ($registrar_asigned_school as $r_s) { $line = array(); $school = $DB->get_record('local_school', array('id' => $r_s->id)); $line[] = $school->fullname; /* ---used to fetch existing school settings--- */ $exists_set = $DB->get_records('local_school_settings', array('schoolid' => $school->id)); $bcheck = ''; $pcheck = ''; $ocheck = ''; $ccheck = ''; $opcheck = '';
require_once(dirname(__FILE__) . '/../../config.php'); global $CFG, $USER, $DB; require_once($CFG->dirroot . '/local/lib.php'); $id = optional_param('recid', 0, PARAM_INT); $tid = optional_param('tid', 0, PARAM_INT); $reject = optional_param('reject', 0, PARAM_INT); $PAGE->set_url('/local/request/reject.php'); $PAGE->set_title(get_string('pluginname', 'local_profilechange')); $PAGE->set_heading(get_string('pluginname', 'local_profilechange')); $hierarchy = new hierarchy(); $PAGE->set_pagelayout('admin'); require_login(); $PAGE->navbar->add(get_string('myprofile', 'local_profilechange')); $PAGE->navbar->add(get_string('pluginname', 'local_profilechange')); echo $OUTPUT->header(); $hierarchy = new hierarchy(); if ($id > 0) { $value = $DB->set_field('local_request_profile_change', 'reg_approval', $reject, array('id' => $id)); $message = get_string('reject_profile_change', 'local_request'); $nexturl = '../../local/request/approval_profile.php'; $style = array('style' => 'notifysuccess'); $hierarchy->set_confirmation($message, $nexturl, $style); }if ($tid > 0) { $value = $DB->set_field('local_request_transcript', 'reg_approval', $reject, array('id' => $tid)); $message = get_string('reject_transcript', 'local_request'); $nexturl = '../../local/request/approval_transcript.php'; $style = array('style' => 'notifysuccess'); $hierarchy->set_confirmation($message, $nexturl, $style); }echo $OUTPUT->footer(); ?>
$fromform->notification = 0; $fromform->requested_date = time(); $fromform->reg_approval = 0; $fromform->regapproval_date = 0; $registrar = $DB->get_records_sql("select userid from {local_school_permissions} where roleid = 9 and schoolid = {$fromform->school_id} group by userid"); foreach ($registrar as $reg) { $registrarid = $reg->userid; } $userto = $DB->get_record('user', array('id' => $registrarid)); $userfrom = $DB->get_record('user', array('id' => $USER->id)); $message = get_string('reqidcardsmsg', 'local_request'); if ($DB->insert_record('local_request_idcard', $fromform)) { message_post_message($userfrom, $userto, $message, FORMAT_HTML); $conmessage = get_string('requestsubmit', 'local_request'); $options = array('style' => 'notifysuccess'); $hierarchy->set_confirmation($conmessage, $nexturl, $options); } } echo $OUTPUT->header(); $check = $DB->get_record_sql("SELECT * FROM {local_request_idcard} WHERE studentid = {$USER->id} AND reg_approval = 0"); if (!empty($check)) { $message = get_string('requestiderror', 'local_request'); $options = array('style' => 'notifyproblem'); $hierarchy->set_confirmation($message, $nexturl, $options); } echo $OUTPUT->heading(get_string('requisitions_id', 'local_request')); $currenttab = 'request'; $requestid->requestidtabview($currenttab);
/** * @method success_error_msg * @todo providing valid success and error message based on condition * @param object $output resultent record * @param string $success Success message * @param string $error Error messgae * @param string $currenturl redirection url * @return printing valid message */ function success_error_msg($output, $success, $error, $currenturl, $dynamic_name1 = false) { $hier = new hierarchy(); if ($output) { if ($dynamic_name1) $confirm_msg = get_string($success, 'local_departments', $dynamic_name1); else $confirm_msg = get_string($success, 'local_departments'); $options = array('style' => 'notifysuccess'); } else { $confirm_msg = get_string($error, 'local_departments'); $options = array('style' => 'notifyproblem'); } $hier->set_confirmation($confirm_msg, $currenturl, $options); }
if (isset($formdata->confirmdelete) AND $formdata->confirmdelete == 1) { if (!$template = $DB->get_record("evaluation_template", array("id"=>$deletetempl))) { print_error('error'); } // if ($template->ispublic) { // $systemcontext = get_system_context(); // require_capability('mod/evaluation:createpublictemplate', $systemcontext); // require_capability('mod/evaluation:deletetemplate', $systemcontext); // } evaluation_delete_template($template); $message = get_string('templatedelsuccess','local_evaluations'); $style = array('style'=>'notifysuccess'); $hierarchy->set_confirmation($message,$deleteurl->out(false),$style); //redirect($deleteurl->out(false)); } /// Print the page header $strevaluations = get_string("modulenameplural", "local_evaluations"); $strevaluation = get_string("modulename", "local_evaluations"); $strdeleteevaluation = get_string('delete_template', 'local_evaluations'); //$PAGE->set_heading(format_string($course->fullname)); $PAGE->set_title(format_string($evaluation->name)); echo $OUTPUT->header(); /// Print the main part of the page
/** * @method registrarrejectcourse * @todo used when registrar rejected the student request( for course enrollment), particular student status will be updated. * @param int $courseid Course id, int $userid user id * @return-- display confirmation message */ function registrarrejectcourse($userid, $classid) { global $DB, $USER; $returnurl = new moodle_url('/local/courseregistration/registrar.php?current=pending'); $usercourse = $DB->get_records('local_user_clclasses', array('userid' => $userid, 'classid' => $classid)); foreach ($usercourse as $usercourses) { $publish = new stdClass(); $publish->id = $usercourses->id; $publish->registrarapproval = 2; $out = $DB->update_record('local_user_clclasses', $publish); } /* ---start of vijaya--- */ $conf = new object(); $hierarchy = new hierarchy(); $conf->username = $DB->get_field('user', 'username', array('id' => $userid)); $conf->classname = $DB->get_field('local_clclasses', 'fullname', array('id' => $classid)); $message = get_string('msg_rej_cls_req', 'local_courseregistration', $conf); $userfrom = $DB->get_record('user', array('id' => $USER->id)); $userto = $DB->get_record('user', array('id' => $userid)); $message_post_message = message_post_message($userfrom, $userto, $message, FORMAT_HTML); /* ---end of vijaya--- */ $message = get_string('reject_success', 'local_courseregistration', $conf); $style = array('style' => 'notifysuccess'); $hierarchy->set_confirmation($message, $returnurl, $style); //return $returnurl; }
/* ---------school filter--------- */ $schoolids = $assignee_ob->check_loginuser_registrar_admin(); $assignee_ob->assignmentor_tabs($currenttab); if (isset($CFG->allowframembedding) and ! $CFG->allowframembedding) { echo $OUTPUT->box(get_string('desc_view_mentor', 'local_assignmentor')); } /* ------code starts- to unassign students from mentor ----- */ if ($id and $unassign and confirm_sesskey()) { $del = $DB->delete_records('local_assignmentor_tostudent', array('id' => $id)); if ($del) { $success = get_string('success_unassign_mentor', 'local_assignmentor'); $options = array('style' => 'notifysuccess'); $hier->set_confirmation($success, $currenturl, $options); } else { $error = get_string('error_unassign_mentor', 'local_assignmentor'); $options = array('style' => 'notifyproblem'); $hier->set_confirmation($error, $currenturl, $options); } } echo $OUTPUT->box_start('generalbox boxaligncenter boxwidthwide'); echo $OUTPUT->box_end(); try { /* ----only displaying registrar enroll school informations------ */ foreach ($schoolids as $sid) { if ($sid->id != null) { $temp[] = $sid->id; }
$school = new school(); /* ---Adding the users to the school --- */ /* ---when Registrar select the users to the school and submits to assign users--- */ if (!empty($moveto) and $data = data_submitted()) { if (!$destschool = $DB->get_record('local_school', array('id' => $data->moveto))) { print_error('cannotfindschool', '', '', $data->moveto); } /* * ###Bugreport #189-Assign Regsitrar * @author Naveen Kumar<*****@*****.**> * (Resolved) Removed success message from the loop, So that it won't redirect */ $currenturl = "{$CFG->wwwroot}/local/collegestructure/assignusers.php"; if (empty($data)) { $hierarche->set_confirmation(get_string('pleaseselectschool', 'local_collegestructure'), $currenturl); } $users = array(); foreach ($data as $key => $value) { if (preg_match('/^c\d+$/', $key)) { $userid = substr($key, 1); array_push($users, $userid); } } $school->add_users($users, $data->moveto); } /* ---end of the user assigning to schools--- */ /* ---Prepare the standard URL params for this page. We'll need them later--- */
//echo $OUTPUT->box_end(); $returnurl = new moodle_url('/local/departments/display_instructor.php'); $currenturl = "{$CFG->wwwroot}/local/departments/display_instructor.php"; try { //------after selecting insrtuctor and department(assigning instructor to department)--------- $data = data_submitted(); if (!empty($moveto) && !empty($data)) { if (!empty($data->check)) { $res = $dept_ob->assign_instructor_department($data); $dept_ob->success_error_msg($res, 'sassign_ins', 'eassign_ins', $currenturl); } $select_msg = get_string('select_instructor', 'local_departments'); $hier1->set_confirmation($select_msg, $currenturl); } //-------------------------------------------------------- // checking if login user is registrar or admin $schoolid = $dept_ob->check_loginuser_registrar_admin(); //-------$count used to avoid school filter(if registrar assigned to more than one school then filter will) $count = sizeof($schoolid); if ($count > 1) { $schoollist = $hier1->get_school_parent($schoolid, '', true); $select = new single_select(new moodle_url('/local/departments/assign_instructor.php'), 'slsid', $schoollist, $slsid, null, null); $select->set_label(get_string('schoolid', 'local_collegestructure')); echo $OUTPUT->render($select); echo '</br>'; $temp_sid = $slsid; } else {
$defaultschoolid = $DB->get_record('local_department', array('id' => $dept_id)); $flag = 0; if ($defaultschoolid->schoolid == $sid) $flag = 1; $used_dept = $DB->get_records('local_cobaltcourses', array('schoolid' => $sid, 'departmentid' => $dept_id)); if (empty($used_dept) && ($flag == 0)) { $DB->delete_records('local_assignedschool_dept', array('id' => $id)); $dept_name = $DB->get_record('local_department', array('id' => $dept_id)); $school_name = $DB->get_record('local_school', array('id' => $sid)); $msg_strings = new stdClass(); $msg_strings->school = $school_name->fullname; $msg_strings->department = $dept_name->fullname; $unassign_dept_msg = get_string('unassign_dept_msg', 'local_departments', $msg_strings); $options = array('style' => 'notifysuccess'); $hier1->set_confirmation($unassign_dept_msg, $currenturl, $options); } else { $options = array('style' => 'notifyproblem'); $error_unassign_msg = get_string('error_unassign_msg', 'local_departments'); $hier1->set_confirmation($error_unassign_msg, $currenturl, $options); } } } if ($sid and $unassign and confirm_sesskey()) { $strheading = get_string('unassign_school', 'local_departments'); $PAGE->navbar->add($strheading); $PAGE->set_title($strheading); echo $OUTPUT->header(); $currenttab = 'assign_school'; //$dept_ob->dept_tabs($currenttab); echo $OUTPUT->heading($strheading);
/** * @method curriculum_delete_instance * @todo to delete curriculum * @param object $data * @return print confirmation message * */ function curriculum_delete_instance($data) { global $DB; $hierarchy = new hierarchy(); $curricula = $DB->delete_records('local_curriculum', array('id' => $data)); $curricula = $DB->delete_records('local_level_settings', array('levelid' => $data->id)); $message = get_string('deletedcurricsuccess', 'local_curriculum'); $hierarchy->set_confirmation($message, $currenturl, array('style' => 'notifysuccess')); }
$conf->deptname = $DB->get_field('local_department', 'fullname', array('id' => $dept->departmentid)); /* ---end of vijaya--- */ if ($DB->delete_records('local_dept_instructor', array('id' => $id))) { /* ---start of vijaya--- */ $message = get_string('msg_del_ins_dept', 'local_departments', $conf); $userfrom = $DB->get_record('user', array('id' => $USER->id)); $userto = $DB->get_record('user', array('id' => $dept->instructorid)); /* Bug report #253 - Invoice Messages * @author hemalatha c arun <*****@*****.**> * Resolved - changed the message format */ $message_post_message = message_post_message($userfrom, $userto, $message, FORMAT_HTML); /* ---end of vijaya--- */ $options = array('style' => 'notifysuccess'); $suc_unassign_ins = get_string('success_unassign_ins', 'local_departments', $temp); $hier1->set_confirmation($suc_unassign_ins, $currenturl, $options); } else { $options = array('style' => 'notifyproblem'); $error_unassign_ins = get_string('error_unassign_ins', 'local_departments', $temp); $hier1->set_confirmation($error_unassign_ins, $currenturl, $options); } } } if ($id and $unassign and confirm_sesskey()) { $strheading = get_string('unassign_instructor', 'local_departments'); $PAGE->navbar->add($strheading); $PAGE->set_title($strheading); echo $OUTPUT->header(); $currenttab = 'display_instructor'; //$dept_ob->dept_tabs($currenttab); echo $OUTPUT->heading($strheading);
/** * @method classes_remove_criteria * @param int $exam Exam ID * @todo To delete the class completion */ public function classes_remove_criteria($exam, $id) { global $DB, $CFG; $hierarche = new hierarchy (); $currenturl = "{$CFG->wwwroot}/local/clclasses/examsetting.php?id={$id}"; $delete = $DB->delete_records('local_class_completion', array('id' => $exam)); if ($delete) $hierarche->set_confirmation(get_string('removedscuccess', 'local_clclasses'), $currenturl, array('style' => 'notifysuccess')); }
} if ($id > 0) { $strnavbar = get_string('editevent', 'local_academiccalendar'); } else { $strnavbar = get_string('Createevent', 'local_academiccalendar'); } $PAGE->navbar->add(get_string('pluginname', 'local_academiccalendar'), new moodle_url('/local/academiccalendar/index.php')); $PAGE->set_title($strheading); $editoroptions = array('maxfiles' => EDITOR_UNLIMITED_FILES, 'maxbytes' => $CFG->maxbytes, 'trusttext' => false, 'noclean' => true); /* Deleting unpublished Event activities */ if ($delete) { $PAGE->url->param('delete', 1); if ($confirm and confirm_sesskey()) { $acalendar->event_delete_instance($id); $options = array('style' => 'notifysuccess'); $hierarchy->set_confirmation(get_string('eventdeletedsuccess', 'local_academiccalendar'), $returnurl, $options); } $strheading = get_string('deleteevent', 'local_academiccalendar'); $PAGE->navbar->add($strheading); $PAGE->set_title($strheading); echo $OUTPUT->header(); echo $OUTPUT->heading($strheading); $yesurl = new moodle_url('/local/academiccalendar/edit_event.php', array('id' => $id, 'delete' => 1, 'confirm' => 1, 'sesskey' => sesskey())); $message = get_string('delconfirm', 'local_academiccalendar'); echo $OUTPUT->confirm($message, $yesurl, $returnurl); echo $OUTPUT->footer(); die; } $PAGE->navbar->add($strnavbar);
/** * @method unassign_users_instance * @todo To unassign the registrar to a school * @param int $id School id * @param int $userid User ID */ public function unassign_users_instance($id, $userid) { global $DB, $CFG, $USER; $hierarchy = new hierarchy (); $currenturl = "{$CFG->wwwroot}/local/collegestructure/assignusers.php"; /* ---start of vijaya--- */ $conf = new object(); $conf->username = $DB->get_field('user', 'username', array('id' => $userid)); $conf->schoolname = $DB->get_field('local_school', 'fullname', array('id' => $id)); /* ---end of vijaya--- */ $delete = $DB->delete_records('local_school_permissions', array('schoolid' => $id, 'userid' => $userid)); if ($delete) { /* ---start of vijaya--- */ $message = get_string('msg_del_reg_schl', 'local_collegestructure', $conf); $userfrom = $DB->get_record('user', array('id' => $USER->id)); $userto = $DB->get_record('user', array('id' => $userid)); $message_post_message = message_post_message($userfrom, $userto, $message, FORMAT_HTML); /* ---end of vijaya--- */ $hierarchy->set_confirmation(get_string('unassignedsuccess', 'local_collegestructure'), $currenturl, array('style' => 'notifysuccess')); } else { $hierarchy->set_confirmation(get_string('problemunassignedsuccess', 'local_collegestructure'), $currenturl, array('style' => 'notifyproblem')); } }
$temp = $tmobject->timetable_addscheduleclass_instance($data, $classtype); $DB->update_record('local_scheduleclass', $temp); }// end of foreach $semid = $data->semesterid; $classid = $data->classid; /* Bug report #331 - Classes management>Upcoming Semester>Scheduling Instructor * @author hemalatha c arun <*****@*****.**> * Resolved- if class not belongs to active semester, it redirect to view page. */ $returnurl = new moodle_url('/local/timetable/scheduleclassview.php'); $message = get_string('classsuccessschedule', 'local_clclasses'); $options = array('style' => 'notifysuccess'); $hierarchy->set_confirmation($message, $returnurl, $options); } else { $classtypes = $data->classtype; foreach ($classtypes as $classtype) { $temp = $tmobject->timetable_addscheduleclass_instance($data, $classtype); if ($temp == 0) { $message = get_string('classsuccessschedule_withsamedata', 'local_clclasses'); $options = array('style' => 'notifyproblem'); $hierarchy->set_confirmation($message, new moodle_url('/local/timetable/scheduleclassview.php'), $options); } $res = $DB->insert_record('local_scheduleclass', $temp); }// end of foreach $semid = $data->semesterid;
$DB->update_record('local_scheduleclass', $temp); }// end of foreach $semid = $data->semesterid; $classid = $data->classid; /* Bug report #331 - Classes management>Upcoming Semester>Scheduling Instructor * @author hemalatha c arun <*****@*****.**> * Resolved- if class not belongs to active semester, it redirect to view page. */ if ($activesemesterid == $semid) $returnurl = new moodle_url('/local/clclasses/enroluser.php', array('id' => $classid, 'semid' => $semid)); else $returnurl = new moodle_url('/local/clclasses/index.php'); $message = get_string('classsuccessschedule', 'local_clclasses'); $options = array('style' => 'notifysuccess'); $hierarchy->set_confirmation($message, $returnurl, $options); } else { $classtypes = $data->classtype; foreach ($classtypes as $classtype) { $temp = $tmobject->timetable_addscheduleclass_instance($data, $classtype); if ($temp == 0) { $message = get_string('classsuccessschedule_withsamedata', 'local_clclasses'); $options = array('style' => 'notifyproblem'); $hierarchy->set_confirmation($message, new moodle_url('/local/clclasses/index.php'), $options); } else $res = $DB->insert_record('local_scheduleclass', $temp); }// end of foreach ///* Bug-id#255 // * @author hemalatha c arun<*****@*****.**>
if ($system->is_cancelled()) { redirect($returnurl); } if ($data = $system->get_data()) { if ($data->id > 0) { $data->semid = -1; $data->timemodified = time(); $res = $DB->update_record('local_cobalt_gpasettings', $data); $global_ob->success_error_msg($res, 'success_update_gpa', 'error_update_gpa', $currenturl); } else { $exists_data = $DB->get_record('local_cobalt_gpasettings', array('schoolid' => $data->schoolid, 'sub_entityid' => $data->sub_entityid)); if ($exists_data) { $confirm_msg = get_string('already_sem_gpa', 'local_cobaltsettings'); $hier1->set_confirmation($confirm_msg, $currenturl); } $temp = new stdClass(); $temp->schoolid = $data->schoolid; $temp->sub_entityid = $data->sub_entityid; $temp->semid = -1; $temp->gpa = $data->gpa; $temp->cgpa = $data->cgpa; $temp->probationgpa = $data->probationgpa; $temp->dismissalgpa = $data->dismissalgpa; $temp->timecreated = time(); $temp->usermodified = $USER->id; $res = $DB->insert_record('local_cobalt_gpasettings', $temp); $global_ob->success_error_msg($res, 'success_add_gpa', 'error_add_gpa', $currenturl);
} if (!has_capability('local/semesters:manage', $systemcontext)) { print_error('You dont have permissions'); } $PAGE->set_url('/local/semesters/assign.php'); $PAGE->set_title(get_string('pluginname', 'local_semesters')); //Header and the navigation bar $PAGE->set_heading($SITE->fullname); $PAGE->navbar->add(get_string('pluginname', 'local_semesters'), new moodle_url('/local/semesters/index.php')); $returnurl = new moodle_url('/local/semesters/assign.php'); if ($unassign) { $DB->delete_records('local_school_semester', array('schoolid' => $schoolid, 'semesterid' => $semesterid)); $conf->school = $DB->get_field('local_school', 'fullname', array('id' => $schoolid)); $conf->semester = $DB->get_field('local_semester', 'fullname', array('id' => $semesterid)); $message = get_string('unassignedschool', 'local_semesters', $conf); $hierarchy->set_confirmation($message, $returnurl); } if ($schoolid) { $rec = new stdClass(); $rec->schoolid = $schoolid; $rec->semesterid = $semesterid; $DB->insert_record('local_school_semester', $rec); $conf->school = $DB->get_field('local_school', 'fullname', array('id' => $schoolid)); $conf->semester = $DB->get_field('local_semester', 'fullname', array('id' => $semesterid)); $message = get_string('assignedschool', 'local_semesters', $conf); $hierarchy->set_confirmation($message, $returnurl); } $PAGE->navbar->add(get_string('assignschool', 'local_collegestructure')); echo $OUTPUT->header(); //Heading of the page
//Adding the courses to the Curriculumplan if (!empty($moveto) and $data = data_submitted()) { $crs = array(); foreach ($data as $key => $value) { if (preg_match('/^c\d+$/', $key)) { $cuid = substr($key, 1); array_push($crs, $cuid); } } $currenturl = new moodle_url('/local/curriculum/assigncourses.php', array('id' => $id, 'mode' => $mode, 'cid' => $cid)); if ($flag) { //"Assign Module" is set, assign all the courses from the module to the Curriculum $conf->module = $DB->get_field('local_module', 'fullname', array('id' => $moduleid)); $cplan->assign_modules($id, $data->moveto, $moduleid); $hierarchy->set_confirmation(get_string('moduleassignedsuccess', 'local_curriculum', $conf), $currenturl, array('style' => 'notifysuccess')); } //If no courses are selected, show a message. if (empty($crs)) { $params = array('id' => $id, 'mode' => $mode, 'cid' => $cid, 'type' => $type); if ($moduleid) { $params['pid'] = $programid; $params['moduleid'] = $moduleid; } if ($departmentid) { $params['did'] = $departmentid; } $currenturl = new moodle_url('/local/curriculum/assigncourses.php', $params); $hierarchy->set_confirmation(get_string('pleaseselectcourse', 'local_curriculum'), $currenturl, array('style' => 'notifyproblem')); } if ($id)
echo $OUTPUT->header(); echo $OUTPUT->heading($strheading); if ($accept) { /* records with the status approved */ $student = $DB->get_record('local_request_idcard', array('id' => $id)); $userto = $DB->get_record('user', array('id' => $student->studentid)); $userfrom = $DB->get_record('user', array('id' => $USER->id)); $time = time(); if ($DB->set_field('local_request_idcard', 'reg_approval', 1, array('id' => $id))) { $message = get_string('successfully_approvedid', 'local_request'); $options = array('style' => 'notifysuccess'); } else { $message = get_string('errorin_approval', 'local_request'); $options = array('style' => 'notifyproblem'); } $hier->set_confirmation($message, null, $options); $DB->set_field('local_request_idcard', 'regapproved_date', $time, array('id' => $id)); $message = get_string('acceptmsg', 'local_request'); $message_post_message = message_post_message($userfrom, $userto, $message, FORMAT_HTML); } if ($reject) { $student = $DB->get_record('local_request_idcard', array('id' => $id)); $userto = $DB->get_record('user', array('id' => $student->studentid)); $userfrom = $DB->get_record('user', array('id' => $USER->id)); /* records with the status rejected */ if ($DB->set_field('local_request_idcard', 'reg_approval', 2, array('id' => $id))) { $message = get_string('successfully_rejectedidrequest', 'local_request'); $options = array('style' => 'notifysuccess'); } else { $message = get_string('errorin_approval', 'local_request');
$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; // Delete $dres = $exams->scheduleexam_delete_instance($id); //exit; if ($dres == 1) { $message = get_string('deletesuccess', 'local_scheduleexam', $msg); $options = array('style' => 'notifysuccess'); } $hierarchy->set_confirmation($message, $returnurl, $options); } $strheading = get_string('deletescheduleexam', 'local_scheduleexam'); $PAGE->navbar->add($strheading); $PAGE->set_title(get_string('pageheading', 'local_scheduleexam') . ': ' . $strheading); echo $OUTPUT->header(); echo $OUTPUT->heading($strheading); $check = $DB->get_records("local_user_examgrades", array("examid" => $id)); $message = get_string('message', 'local_scheduleexam'); if ($check) { $message = '<h3>' . $message . '</h3>'; echo '<div align="center">'; echo $OUTPUT->box($message); echo '<br/>'; echo $OUTPUT->continue_button($returnurl);
$time = time(); if ($approve) { /* records with the status approved */ if (insert_courseexemgrades($id, $_POST)) { $student = $DB->get_record('local_request_courseexem', array('id' => $id)); $userto = $DB->get_record('user', array('id' => $student->studentid)); $userfrom = $DB->get_record('user', array('id' => $USER->id)); $DB->set_field('local_request_courseexem', 'registrarapproval', 1, array('id' => $id)); $DB->set_field('local_request_courseexem', 'regapprovedon', $time, array('id' => $id)); $message = get_string('acceptmsgexem', 'local_request'); $message_post_message = message_post_message($userfrom, $userto, $message, FORMAT_HTML); } $style = array('style' => 'notifysuccess'); $approvesuccess = get_string('approvesuccess', 'local_request'); $hierarchy->set_confirmation($approvesuccess, $returnurl, $style); } if ($reject) { $student = $DB->get_record('local_request_courseexem', array('id' => $id)); $userto = $DB->get_record('user', array('id' => $student->studentid)); $userfrom = $DB->get_record('user', array('id' => $USER->id)); /* records with the status rejected */ $DB->set_field('local_request_courseexem', 'registrarapproval', 2, array('id' => $id)); $DB->set_field('local_request_courseexem', 'regapprovedon', $time, array('id' => $id)); $message = get_string('rejectmsgexem', 'local_request'); $message_post_message = message_post_message($userfrom, $userto, $message, FORMAT_HTML); $style = array('style' => 'notifyproblem'); $rejectsuccess = get_string('rejectsuccess', 'local_request'); $hierarchy->set_confirmation($rejectsuccess, $returnurl, $style); }