//get the admin layout $PAGE->set_pagelayout('admin'); //check the context level of the user and check weather the user is login to the system or not $PAGE->set_context($systemcontext); require_login(); $PAGE->set_url('/local/departments/info.php'); //Header and the navigation bar $PAGE->set_title(get_string('manage_dept', 'local_departments')); $PAGE->navbar->add(get_string('manage_dept', 'local_departments'), new moodle_url('/local/departments/index.php')); $PAGE->navbar->add(get_string('help', 'local_departments')); echo $OUTPUT->header(); //-------------manage_dept heading------------------------ echo $OUTPUT->heading(get_string('dept_heading', 'local_departments')); //adding tabs using prefix_tabs function $currenttab = 'help'; $dept_ob = manage_dept::getInstance(); $dept_ob->dept_tabs($currenttab); //get_string('helpinfo', 'local_departments') //echo $OUTPUT->box(); $content = get_string('info_help', 'local_departments'); echo '<div class="help_cont">' . $content . '<div>'; echo $OUTPUT->footer(); ?>
$existingclass2->usermodified = $USER->id; $existingclass2->timemodified = time(); $DB->update_record('local_scheduleclass', $existingclass2); $classsupdated++; } else { $classsuptodate++; } } else { $data = new stdclass(); $hier = new hierarchy(); $schools = $hier->get_assignedschools(); if (is_siteadmin()) { $schools = $hier->get_school_items(); } $classs = manage_dept::getInstance(); /* ---check schools--- */ $fac = trim($class->schoolname); $scid = $DB->get_field('local_school', 'id', array('fullname' => $fac)); if (empty($scid)) { echo '<h3 style="color:red;">Invalid school "' . $class->schoolname . '" entered at line no. "' . $linenum . '" of uploaded excelsheet.</h3>'; goto loop; } $c = 0; foreach ($schools as $school) { if ($school->id == $scid) { ++$c; break; } } if ($c == 0) {
public static function getInstance() { if (!self::$_singleton) { self::$_singleton = new manage_dept(); } return self::$_singleton; }
$existingexam->usermodified = $USER->id; $DB->update_record('local_scheduledexams', $existingexam); $examsupdated++; } else { // no exam information changed $examsuptodate++; } } else { // else start for [!empty($existingexam] // save the new exam to the database $data = new stdclass(); $hier = new hierarchy(); $schools = $hier->get_assignedschools(); if (is_siteadmin()) { $schools = $hier->get_school_items(); } $exams = manage_dept::getInstance(); // check schools $fac = $exam->schoolname; $scid = $DB->get_field('local_school', 'id', array('fullname' => "$fac")); if (!$scid) { echo '<h3 style="color:red;">Invalid school "' . $exam->schoolname . '" entered at line no. "' . $linenum . '" of uploaded excelsheet.</h3>'; goto loop; } $c = 0; foreach ($schools as $school) { if ($school->id == $scid) { ++$c; break; } } if ($c == 0) {