function definition_after_data() { global $DB; $mform = $this->_form; $hierarchy = new hierarchy(); //$eid = $this->_customdata['temp']; // if ($eid->id < 0) { $school = $mform->getElementValue('schoolid'); $tools = array(); if ($school[0] > 0 || $school>0) { $fid = $school[0]; if(isset($school[0])) $schoolid=$school[0]; else $schoolid = $school; $hierarchy = new hierarchy(); $upcomingsemester = $hierarchy->get_upcoming_school_semesters($schoolid); // print_object($upcomingsemester); $activesemester = $hierarchy->get_allmyactivesemester(null, $schoolid); // print_object($activesemester); $active_upcomingsemester = $upcomingsemester + $activesemester; $newel = $mform->createElement('select', 'semesterid', get_string('selectsemester_timetable', 'local_timetable'), $active_upcomingsemester); $mform->insertElementBefore($newel, 'addsemesterlisthere'); $mform->addRule('semesterid', get_string('selectsemester_timetable', 'local_timetable'), 'required', null, 'client'); // $formatvalue2 [0]; } // } }
/** * @method cobalt_update_program * @todo Update the details of the existing Programs * @param $data(array) * */ function cobalt_update_program($data) { global $DB; $DB->update_record('local_program', $data); $hierarchy = new hierarchy(); $DB->delete_records('local_level_settings', array('levelid' => $data->id)); $hierarchy->entity_settings($data); }
function definition() { global $USER, $CFG, $DB, $PAGE; $mform = $this->_form; $mform->addElement('header', 'settingsheader', get_string('system_settings', 'local_cobaltsettings')); $hier1 = new hierarchy(); $schoolids = $hier1->get_assignedschools(); if (!empty($schoolids)) { $count = sizeof($schoolids); if ($count > 1) { $parents = $hier1->get_school_parent($schoolids, '', true); $attributes1 = 'style="height:25px; width:29%; "'; $mform->addElement('select', 'schoolid', get_string('schoolid', 'local_collegestructure'), $parents, $attributes1); $mform->addRule('schoolid', get_string('missingschool', 'local_collegestructure'), 'required', null, 'client'); } else { $schoolname = $DB->get_record('local_school', array('id' => $schoolids[0]->id)); $mform->addElement('static', 'sid', get_string('select', 'local_collegestructure'), $schoolname->fullname); $mform->addElement('hidden', 'schoolid', $schoolids[0]->id); } } $mform->addElement('advcheckbox', 'batch', null, 'Batch', array('group' => 1), array(0, 1)); $mform->addElement('html', '<div style=" margin-left:265px;" class="form-description"><p>' . get_string('enable_batch', 'local_cobaltsettings') . ' </p></div>'); $mform->addElement('advcheckbox', 'prefix_suffix', null, 'Prefix-Suffix', array('group' => 1), array(0, 1)); $mform->addElement('html', '<div style=" margin-left:265px;" class="form-description"><p>' . get_string('create_batch', 'local_cobaltsettings') . ' </p></div>'); $mform->addElement('advcheckbox', 'online_app', null, 'Online Applications', array('group' => 1), array(0, 1)); $mform->addElement('html', '<div style=" margin-left:265px; color:light-grey" class="form-description"><p>' . get_string('enable_online', 'local_cobaltsettings') . ' </p></div>'); $mform->addElement('advcheckbox', 'certificate', null, 'Issue certificates', array('group' => 1), array(0, 1)); /* start of vijaya jan-29 */ $mform->addElement('advcheckbox', 'onlinepayment', null, 'Online Payment', array('group' => 1), array(0, 1)); /* end of vijaya jan-29 */ $this->add_action_buttons(true, 'Submit'); }
/** * 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); }
public function definition() { global $USER, $CFG, $PAGE; $school = new school(); $mform = $this->_form; $id = $this->_customdata['id']; $schools = $this->_customdata['tool']; $editoroptions = $this->_customdata['editoroptions']; if ($id < 0) $mform->addElement('header', 'settingsheader', get_string('createschool', 'local_collegestructure')); else $mform->addElement('header', 'settingsheader', get_string('editschool', 'local_collegestructure')); $tools = array(); $hierarchy = new hierarchy(); $items = $hierarchy->get_school_items(true); $parents = $hierarchy->get_school_parent($items, $schools->id); if (count($parents) <= 1) { $mform->addElement('hidden', 'parentid', 0); $mform->setType('parentid', PARAM_RAW); } else { $mform->addElement('select', 'parentid', get_string('parent', 'local_collegestructure'), $parents); $mform->setType('parentid', PARAM_RAW); } $mform->addHelpButton('parentid', 'parent', 'local_collegestructure'); $mform->addElement('text', 'fullname', get_string('schoolname', 'local_collegestructure'), $tools); $mform->setType('fullname', PARAM_TEXT); $mform->addRule('fullname', get_string('missingschoolname', 'local_collegestructure'), 'required', null, 'client'); $mform->addElement('editor', 'description', get_string('description', 'local_collegestructure'), null, $editoroptions); $mform->setType('description', PARAM_RAW); $selecttype = array(); $selecttype['1'] = get_string('campus', 'local_collegestructure'); $selecttype['2'] = get_string('university', 'local_collegestructure'); $selecttype['3'] = get_string('location', 'local_collegestructure'); $mform->addElement('select', 'type', get_string('type', 'local_collegestructure'), $selecttype); $mform->addHelpButton('type', 'type', 'local_collegestructure'); $mform->setType('type', PARAM_RAW); $mform->addElement('hidden', 'id'); $mform->setType('id', PARAM_INT); $now = date("d-m-Y"); $now = strtotime($now); $mform->addElement('hidden', 'timecreated', $now); $mform->setType('timecreated', PARAM_RAW); $mform->addElement('hidden', 'usermodified', $USER->id); $mform->setType('usermodified', PARAM_RAW); $themelist = $school->cobalt_get_theme_list(); $mform->addElement('select', 'theme', get_string('theme', 'local_collegestructure'), $themelist); $mform->setType('theme', PARAM_RAW); $mform->addRule('theme', get_string('missingtheme', 'local_collegestructure'), 'required', null, 'client'); $submit = ($id > 0) ? get_string('update_school', 'local_collegestructure') : get_string('create', 'local_collegestructure'); $this->add_action_buttons('false', $submit); }
function user_download_xls($fields) { global $CFG, $DB; require_once("$CFG->libdir/excellib.class.php"); $filename = clean_filename(get_string('course', 'local_cobaltcourses') . '.xls'); $workbook = new MoodleExcelWorkbook('-'); $workbook->send($filename); $worksheet = array(); $worksheet[0] = $workbook->add_worksheet(''); $col = 0; foreach ($fields as $fieldname) { $worksheet[0]->write(0, $col, $fieldname); $col++; } $hierarchy = new hierarchy(); $schoollist = $hierarchy->get_assignedschools(); if (is_siteadmin()) { $schoollist = $hierarchy->get_school_items(); } $sheetrow = 1; foreach ($schoollist as $school) { $courses = $DB->get_records('local_cobaltcourses', array('schoolid' => $school->id)); foreach ($courses as $course) { $post = new stdclass(); $post->fullname = $course->fullname; $post->shortname = $course->shortname; $departmentname = $DB->get_field('local_department', 'fullname', array('id' => $course->departmentid)); $post->courselibraryname = $departmentname; $schoolname = $DB->get_field('local_school', 'fullname', array('id' => $course->schoolid)); $post->organizationname = $schoolname; $post->summary = $course->summary; $post->coursetype = ($course->coursetype == 0) ? 'General' : 'Elective'; $post->credithours = $course->credithours; $post->coursecost = $course->coursecost; $col = 0; foreach ($fields as $fieldname) { $worksheet[0]->write($sheetrow, $col, $post->$fieldname); $col++; } $sheetrow++; } } $workbook->close(); die; }
function definition() { global $USER, $CFG, $DB, $PAGE; $mform = $this->_form; $PAGE->requires->yui_module('moodle-local_cobaltsettings-cobaltsetting', 'M.local_cobaltsettings.init_cobaltsetting', array(array('formid' => $mform->getAttribute('id')))); /* ---used for editing purpose--- */ $eid = $this->_customdata['temp']; if ($eid->id <= 0) $mform->addElement('header', 'settingsheader', get_string('category_level_settings', 'local_cobaltsettings')); else $mform->addElement('header', 'settingsheader', get_string('editentity_level_settings', 'local_cobaltsettings')); $hier = new hierarchy(); $global_ob = global_settings::getInstance(); $global_ob->school_formelement_condition($mform); $aca_list = $hier->get_records_cobaltselect_menu('local_cobalt_entity', '', null, '', 'id,name', 'Select Category'); $mform->addElement('select', 'entityid', get_string('category', 'local_cobaltsettings'), $aca_list); $mform->addRule('entityid', get_string('category', 'local_cobaltsettings'), 'required', null, 'client'); $mform->setType('entityid', PARAM_INT); $mform->registerNoSubmitButton('updatecourseformat'); $mform->addElement('submit', 'updatecourseformat', get_string('courseformatudpate')); $mform->addElement('hidden', 'categorytypehere'); $mform->setType('categorytypehere', PARAM_TEXT); $mform->addElement('hidden', 'radiobuttonhere'); $mform->setType('radiobuttonhere', PARAM_INT); $radioarray = array(); $radioarray[] = & $mform->createElement('radio', 'level', 'SCH', get_string('schoollevel', 'local_collegestructure'), 'SL'); $radioarray[] = & $mform->createElement('radio', 'level', 'PCH', get_string('programlevel', 'local_programs'), 'PL'); $radioarray[] = & $mform->createElement('radio', 'level', 'CCH', get_string('curriculumlevel', 'local_curriculum'), 'CL'); $mform->addGroup($radioarray, 'radioarray', '', array(' '), false); $mform->addRule('radioarray', get_string('category', 'local_cobaltsettings'), 'required', null, 'client'); /* if($eid->id <= 0){ $mform->disabledIf('radioarray', 'radiobuttondisable', 'eq', 1); } */ $mform->addElement('hidden', 'id'); $mform->setType('id', PARAM_INT); $eid->id; if ($eid->id > 0) $string = get_string('updateentity', 'local_cobaltsettings'); else $string = get_string('createentity', 'local_cobaltsettings'); $this->add_action_buttons(true, $string); }
public function definition() { global $CFG, $DB; $mform = & $this->_form; $hierarchy = new hierarchy(); if (is_siteadmin()) { $scho = $hierarchy->get_school_items(); } else { $scho = $hierarchy->get_assignedschools(); } $count = count($scho); if ($count > 1) { $school = $hierarchy->get_school_parent($scho); $mform->addElement('select', 'schoolid', get_string('schoolid', 'local_collegestructure'), $school); $mform->addRule('schoolid', get_string('required'), 'required', null, 'client'); } else { $school = $DB->get_record('local_school', array('visible' => 1)); $mform->addElement('static', 'school', get_string('schoolid', 'local_collegestructure'), $school->fullname); $mform->setType('school', PARAM_RAW); $mform->addElement('hidden', 'schoolid', $school->id); $mform->setType('schoolidid', PARAM_INT); } for ($i = 0; $i <= 23; $i++) { $hours[$i] = sprintf("%02d", $i); } for ($i = 0; $i < 60; $i+=5) { $minutes[$i] = sprintf("%02d", $i); } $durtime = array(); $durtime[] = & $mform->createElement('select', 'starthours', get_string('hour', 'form'), $hours, false, true); $durtime[] = & $mform->createElement('select', 'startminutes', get_string('minute', 'form'), $minutes, false, true); $mform->addGroup($durtime, 'starttime', get_string('starttime', 'local_attendance'), array(' '), true); $durtimes = array(); $durtimes[] = & $mform->createElement('select', 'endhours', get_string('hour', 'form'), $hours, false, true); $durtimes[] = & $mform->createElement('select', 'endminutes', get_string('minute', 'form'), $minutes, false, true); $mform->addGroup($durtimes, 'endtime', get_string('orgendtime', 'local_attendance'), array(' '), true); $mform->addElement('hidden', 'id'); $mform->setType('id', PARAM_INT); $submit = ($this->_customdata['id'] > 0) ? 'Update' : 'Create'; $this->add_action_buttons('false', $submit); }
function user_download_xls($fields) { global $CFG, $DB; require_once("$CFG->libdir/excellib.class.php"); $filename = clean_filename(get_string('department', 'local_departments') . '.xls'); $workbook = new MoodleExcelWorkbook('-'); $workbook->send($filename); $worksheet = array(); $worksheet[0] = $workbook->add_worksheet(''); $col = 0; foreach ($fields as $fieldname) { $worksheet[0]->write(0, $col, $fieldname); $col++; } $hierarchy = new hierarchy(); /* Bug report #260 * Edited by hemalatha c arun <*****@*****.**> * resolved- If loggedin user is admin, downloading all the department */ if (is_siteadmin()) { $sql = "SELECT distinct(s.id),s.* FROM {local_school} s ORDER BY s.sortorder"; $schoollist = $DB->get_records_sql($sql); } else $schoollist = $hierarchy->get_assignedschools(); $sheetrow = 1; foreach ($schoollist as $school) { $departments = $DB->get_records('local_department', array('schoolid' => $school->id)); foreach ($departments as $department) { $post = new stdclass(); $post->shortname = $department->shortname; $post->fullname = $department->fullname; $schoolname = $DB->get_field('local_school', 'fullname', array('id' => $department->schoolid)); $post->schoolname = $schoolname; $post->summary = $department->description; $col = 0; foreach ($fields as $fieldname) { $worksheet[0]->write($sheetrow, $col, $post->$fieldname); $col++; } $sheetrow++; } } $workbook->close(); die; }
function user_download_xls($fields) { $hier = new hierarchy(); $schools = $hier->get_assignedschools(); global $CFG, $DB; require_once("$CFG->libdir/excellib.class.php"); $filename = clean_filename('Users.xls'); $workbook = new MoodleExcelWorkbook('-'); $workbook->send($filename); $worksheet = array(); $worksheet[0] = $workbook->add_worksheet(''); $col = 0; foreach ($fields as $fieldname) { $worksheet[0]->write(0, $col, $fieldname); $col++; } $sheetrow = 1; $myuser = users::getInstance(); $users = $DB->get_records_sql("SELECT u.id, u.username, u.email, u.firstname, u.lastname, u.city, u.country, u.lastaccess, u.confirmed, u.mnethostid, u.suspended FROM {user} u, {local_users} lu WHERE lu.userid = u.id "); foreach ($users as $user) { $rid = $myuser->get_rolename($user->id); $post = new stdclass(); $post->firstname = $user->firstname; $post->lastname = $user->lastname; $post->email = $user->email; $post->schoolname = $myuser->get_schoolnames($user); $post->roleid = $myuser->get_rolename($user->id); $col = 0; foreach ($fields as $fieldname) { $worksheet[0]->write($sheetrow, $col, $post->$fieldname); $col++; } $sheetrow++; } $workbook->close(); die; }
function user_download_xls($fields) { global $CFG, $DB; require_once("$CFG->libdir/excellib.class.php"); $filename = clean_filename(get_string('program', 'local_programs') . '.xls'); $workbook = new MoodleExcelWorkbook('-'); $workbook->send($filename); $worksheet = array(); $worksheet[0] = $workbook->add_worksheet(''); $col = 0; foreach ($fields as $fieldname) { $worksheet[0]->write(0, $col, $fieldname); $col++; } $hierarchy = new hierarchy(); $schoollist = $hierarchy->get_assignedschools(); $sheetrow = 1; foreach ($schoollist as $school) { $programs = $DB->get_records('local_program', array('schoolid' => $school->id)); foreach ($programs as $program) { $post = new stdclass(); $post->shortname = $program->shortname; $post->fullname = $program->fullname; $departmentname = $DB->get_field('local_department', 'fullname', array('id' => $program->departmentid)); $post->departmentname = $departmentname; $schoolname = $DB->get_field('local_school', 'fullname', array('id' => $program->schoolid)); $post->schoolname = $schoolname; $post->summary = $program->description; $post->type = ($program->type == 0) ? 'UnderGraduate' : 'PostGraduate'; $post->duration = $program->duration; $col = 0; foreach ($fields as $fieldname) { $worksheet[0]->write($sheetrow, $col, $post->$fieldname); $col++; } $sheetrow++; } } $workbook->close(); die; }
function definition() { global $USER, $CFG, $DB, $PAGE; $id = optional_param('id', -1, PARAM_INT); $hierarchy = new hierarchy(); $instance = new cobalt_examtype(); $mform = $this->_form; $editoroptions = $this->_customdata['editoroptions']; if ($id > 0) $mform->addElement('header', 'settingsheader', get_string('editexamtype', 'local_examtype')); else $mform->addElement('header', 'settingsheader', get_string('addeditexamtype', 'local_examtype')); $items = $hierarchy->get_school_items(); $school = $hierarchy->get_school_parent($items); if ($id < 0) { $mform->addElement('select', 'schoolid', get_string('schoolid', 'local_collegestructure'), $school); $mform->addRule('schoolid', get_string('missingschool', 'local_collegestructure'), 'required', null, 'client'); $mform->setType('schoolid', PARAM_RAW); } if ($id > 0) { $mform->addElement('static', 'school_name', get_string('schoolid', 'local_collegestructure')); $mform->addElement('hidden', 'schoolid'); $mform->setType('schoolid', PARAM_RAW); } $mform->addElement('text', 'examtype', get_string('examtype', 'local_examtype')); $mform->addRule('examtype', get_string('examtypereq', 'local_examtype'), 'required', null, 'client'); $mform->setType('examtype', PARAM_RAW); $mform->addElement('editor', 'description', get_string('description', 'local_examtype'), null, $editoroptions); $mform->setType('description', PARAM_RAW); $mform->addElement('hidden', 'id'); $mform->setType('id', PARAM_INT); if ($id < 0) $save = get_string('addeditexamtype', 'local_examtype'); else $save = get_string('updateexamtype', 'local_examtype'); $this->add_action_buttons(true, $save); }
function get_table($tools) { global $PAGE, $USER, $DB, $OUTPUT, $CFG; $PAGE->requires->js('/local/departments/js/dept_test.js'); $data = array(); $capabilities_array = array('local/departments:manage', 'local/departments:delete', 'local/departments:update', 'local/departments:visible'); foreach ($tools as $tool) { $line = array(); // $line[]=$tool->shortname; $linkcss = $tool->visible ? ' ' : 'class="dimmed" '; // $line[] = html_writer::tag('a', $tool->fullname, array('href' => ''.$CFG->wwwroot.'/local/departments/viewdept.php?id='.$tool->id.'')); $line[] = '<a ' . $linkcss . ' href="' . $CFG->wwwroot . '/local/departments/viewdept.php?id=' . $tool->id . '">' . format_string($tool->fullname) . '</a>'; $line[] = $tool->shortname; $schoolname = $DB->get_record('local_school', array('id' => $tool->schoolid)); $line[] = $schoolname->fullname; $hier = new hierarchy(); // ------------------- Edited by hema------------------------------ $systemcontext = context_system::instance(); if (has_any_capability($capabilities_array, $systemcontext)) { $buttons = $hier->get_actions('departments', 'departments', $tool->id, $tool->visible); $line[] = $buttons; } $data[] = $line; } echo "<div id='filter-box' >"; echo '<div class="filterarea"></div></div>'; //View Part starts //start the table $table = new html_table(); $table->id = 'depttable'; $table->head = array( get_string('deptfullname', 'local_departments'), get_string('deptid', 'local_departments'), get_string('schoolid', 'local_collegestructure')); // ------------------- Edited by hema------------------------------ if (has_any_capability($capabilities_array, $systemcontext)) { array_push($table->head, get_string('action')); } $table->size = array('15%', '15%', '15%', '15%'); $table->align = array('left', 'left', 'left', 'center'); $table->width = '99%'; $table->data = $data; echo html_writer::table($table); }
function definition_after_data() { global $DB, $PAGE, $USER, $hierarchy, $exams, $selected_class, $data; $hierarchy = new hierarchy(); $gradesub = new grade_submission(); $mform = $this->_form; $id = $this->_customdata['id']; $selected_school = $mform->getElementValue('schoolid'); $selected_program = array(); $disable = ($id > 0) ? 'disabled="disabled"' : ''; // for programs and semesters in a school if ($selected_school[0] > 0) { $programs_list = array(); $programs_list = $hierarchy->get_records_cobaltselect_menu('local_program', "schoolid=$selected_school[0] AND visible=1", null, '', 'id,fullname', '--Select--'); $programs_listdrop = $mform->createElement('select', 'programid', get_string('programslist', 'local_scheduleexam'), $programs_list, $disable); $mform->insertElementBefore($programs_listdrop, 'addprogramslisthere'); if ($id < 0) { $mform->addRule('programid', get_string('programreq', 'local_scheduleexam'), 'required', null, 'client'); } $selected_program = array(); $selected_program = $mform->getElementValue('programid'); } if ($selected_school[0] > 0 AND $selected_program[0] > 0) { $table = new html_table(); $table->head = array( get_string('studentid', 'local_graduation'), get_string('studentname', 'local_gradesubmission'), get_string('program', 'local_programs'), get_string('graduation', 'local_graduation')); $table->size = array('30%', '30%', '20%', '19%'); $table->align = array('left', 'left', 'left', 'center'); $table->width = '99%'; $table->data = $data; $tabledata = html_writer::table($table); $mform->addElement('html', $tabledata); } }
/** * @method get_users_listing * @todo to get user list of school based on condition * @param string $sort fieldname * @param string $dir specify the order to sort * @param int $page page number * @param int $recordsperpage records perpage * @param string $extraselect extra condition to select user * @param array $extraparams * @return array of objects , list of users */ function get_users_listing($sort = 'lastaccess', $dir = 'ASC', $page = 0, $recordsperpage = 0, $extraselect = '', array $extraparams = null, $extracontext = null) { global $DB, $CFG; $extraselect; $select = "deleted <> 1 AND id <> :guestid"; //$select = "deleted=0"; $params = array('guestid' => $CFG->siteguest); if ($extraselect) { $select .= " AND $extraselect"; $params = $params + (array) $extraparams; } // If a context is specified, get extra user fields that the current user // is supposed to see. $extrafields = ''; if ($extracontext) { $extrafields = get_extra_user_fields_sql($extracontext, '', '', array('id', 'username', 'email', 'firstname', 'lastname', 'city', 'country', 'lastaccess', 'confirmed', 'mnethostid')); } /* * ###Bugreport#183-Filters * @author Naveen Kumar<*****@*****.**> * (Resolved) Added $select parameters for conditions */ // warning: will return UNCONFIRMED USERS // print_object($params); $users = $DB->get_records_sql("SELECT * FROM {user} WHERE $select", $params); $hierarchy = new hierarchy(); $schoollist = $hierarchy->get_assignedschools(); $schoollist = $hierarchy->get_school_parent($schoollist, $selected = array(), $inctop = false, $all = false); if (is_siteadmin()) { $schoollist = $hierarchy->get_school_items(); } $schoolidin = implode(',', array_keys($schoollist)); if ($users && $schoollist) { $useridin = implode(',', array_keys($users)); return $DB->get_records_sql("select user.* from (SELECT u.id, u.username, u.email, u.firstname, u.lastname, u.city, u.country, u.lastaccess, u.confirmed, u.mnethostid, u.suspended FROM {user} u JOIN {local_users} lu ON lu.userid = u.id JOIN {local_school_permissions} sp ON sp.userid = u.id WHERE u.id in ($useridin) AND sp.schoolid IN ($schoolidin) UNION SELECT u.id, u.username, u.email, u.firstname, u.lastname, u.city, u.country, u.lastaccess, u.confirmed, u.mnethostid, u.suspended FROM {user} u JOIN {local_users} lu ON lu.userid = u.id JOIN {local_userdata} ud ON ud.userid = u.id WHERE u.id in ($useridin) AND ud.schoolid IN ($schoolidin)) user GROUP BY user.id ORDER BY user.$sort $dir LIMIT $page, $recordsperpage "); } }
$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/assignmentor/assign_mentor.php'); $PAGE->set_heading($SITE->fullname); //if (!has_capability('local/assignmentor:manage', $systemcontext)) { // print_error('You dont have permissions'); //} $PAGE->navbar->add(get_string('pluginname', 'local_assignmentor'), new moodle_url('/local/assignmentor/assign_mentor.php')); $PAGE->navbar->add(get_string('assign', 'local_assignmentor')); $currenturl = "{$CFG->wwwroot}/local/assignmentor/index.php"; echo $OUTPUT->header(); /* ----heading---- */ echo $OUTPUT->heading(get_string('pluginname', 'local_assignmentor')); $hier = new hierarchy(); /* ---adding tabs using prefix_tabs function--- */ $currenttab = 'assignmentor'; $assignee_ob = assign_mentortostudent::getInstance(); $assignee_ob->assignmentor_tabs($currenttab); if (isset($CFG->allowframembedding) and ! $CFG->allowframembedding) { echo $OUTPUT->box(get_string('desc_assign_mentor', 'local_assignmentor')); } /* ---description of the table --- */ echo $OUTPUT->box_start('generalbox boxaligncenter boxwidthwide'); echo $OUTPUT->box_end(); /* ---after selecting students and mentor(assigning mentor to department)---- */ $data = data_submitted(); if (!empty($mentorid) && !empty($data)) { if (!empty($data->check)) { $count = sizeof($data->check);
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(); ?>
* To change this template, choose Tools | Templates * and open the template in the editor. */ require_once(dirname(__FILE__) . '/../../config.php'); require_once($CFG->dirroot . '/local/cobaltcourses/lib.php'); require_once($CFG->dirroot . '/local/cobaltcourses/cobaltcourse_form.php'); require_once($CFG->dirroot . '/local/lib.php'); global $USER, $DB, $CFG; $id = optional_param('id', -1, PARAM_INT); $delete = optional_param('delete', 0, PARAM_BOOL); $confirm = optional_param('confirm', 0, PARAM_BOOL); $visible = optional_param('visible', -1, PARAM_INT); $hierarchy = new hierarchy(); $conf = new object(); $systemcontext = context_system::instance(); $PAGE->set_context($systemcontext); require_login(); if ($CFG->forcelogin) { require_login(); } else { user_accesstime_log(); } if (!has_capability('local/cobaltcourses:manage', $systemcontext)) { print_error('You dont have permissions'); } $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_url('/local/gradeletter/index.php'); //Header and the navigation bar $PAGE->set_heading($SITE->fullname); $PAGE->navbar->add(get_string('pluginheading', 'local_gradeletter')); $PAGE->navbar->add(get_string('view', 'local_gradeletter')); $PAGE->set_title(get_string('pluginheading', 'local_gradeletter') . ': ' . get_string('view', 'local_gradeletter')); echo $OUTPUT->header(); //Heading of the page echo $OUTPUT->heading(get_string('pluginheading', 'local_gradeletter')); $hierarchy = new hierarchy(); $schoollist = $hierarchy->get_assignedschools(); $schoollist = $hierarchy->get_school_parent($schoollist, $selected = array(), $inctop = false, $all = false); if (is_siteadmin()) { $schoollist = $hierarchy->get_school_items(); } $gletters->createtabview_gl($currenttab); // Moodle 2.2 and onwards if (isset($CFG->allowframembedding) and ! $CFG->allowframembedding) { echo $OUTPUT->box(get_string('allowframembedding', 'local_gradeletter')); } $schoolidin = implode(',', array_keys($schoollist)); $sql = "SELECT * FROM {$CFG->prefix}local_gradeletters WHERE schoolid IN ($schoolidin)"; $grade_letters = $DB->get_records_sql($sql);
function definition_after_data() { global $DB,$CFG; $mform = $this->_form; $formatvalue = $mform->getElementValue('schoolid'); $id = $this->_customdata['id']; $tools = array(); if ($formatvalue) { $hierarchy = new hierarchy(); $curricula = new curricula(); $formatvalue = $formatvalue[0]; $tools = $hierarchy->get_records_cobaltselect_menu('local_program', "schoolid=$formatvalue AND visible=1", null, '', 'id,fullname', '--Select--'); $checkentitysetting = array(); $checkentitysetting = $hierarchy->get_entitysetting('CL', $formatvalue); if ($formatvalue > 0) { if(array_key_exists($tools)) $newel = $mform->createElement('static', 'programid', get_string('program', 'local_programs'), $hierarchy->cobalt_navigation_msg('No program available yet, Click here ','Create Program',$CFG->wwwroot.'/local/programs/program.php')); else $newel = $mform->createElement('select', 'programid', get_string('program', 'local_programs'), $tools); $mform->insertElementBefore($newel, 'addprogramslisthere'); //$mform->setType('addprogramslisthere', PARAM_RAW); $mform->addRule('programid', get_string('missingfullname', 'local_programs'), 'required', null, 'client'); $mform->setType('id', PARAM_INT); /** curriculum settings like credithours are displayed here on selecting the school/university * get_entitysetting() function exect if credit hours are set at curriculum level */ if ($checkentitysetting) { foreach ($checkentitysetting as $settings) { $level = "CL"; $level = $mform->createElement('hidden', 'level', $level); $mform->insertElementBefore($level, 'addsettinglisthere'); if ($settings->entityid == 1) { $settingheading = $mform->createElement('header', 'moodle', get_string('settingone', 'local_curriculum')); $mform->insertElementBefore($settingheading, 'addsettinglisthere'); $entityids = 1; $entitys = $mform->createElement('hidden', 'entityids', $entityids); $mform->insertElementBefore($entitys, 'addsettinglisthere'); $subentitys = $mform->createElement('hidden', 'subentityidse', $entityids); $mform->insertElementBefore($subentitys, 'addsettinglisthere'); $credithours = $mform->createElement('text', 'mincrhour', get_string('minch', 'local_curriculum')); $mform->insertElementBefore($credithours, 'addsettinglisthere'); $mform->addRule('mincrhour', get_string('missingtotalch', 'local_curriculum'), 'required', null, 'client'); $mform->setType('mincrhour', PARAM_RAW); } if ($settings->entityid == 2) { $settingheading = $mform->createElement('header', 'moodle', get_string('settingtwo', 'local_curriculum')); $mform->insertElementBefore($settingheading, 'addsettinglisthere'); $entity = 2; $entity = $mform->createElement('hidden', 'entityid', $entity); $mform->insertElementBefore($entity, 'addsettinglisthere'); $subentity = $mform->createElement('hidden', 'subentityid', $entityids); $mform->insertElementBefore($subentity, 'addsettinglisthere'); $freshman = $mform->createElement('text', 'mincredithours[0]', get_string('freshmancrhr', 'local_curriculum')); $mform->insertElementBefore($freshman, 'addsettinglisthere'); $sophomore = $mform->createElement('text', 'mincredithours[1]', get_string('sophomorecrhr', 'local_curriculum')); $mform->insertElementBefore($sophomore, 'addsettinglisthere'); $junior = $mform->createElement('text', 'mincredithours[2]', get_string('juniorcrhr', 'local_curriculum')); $mform->insertElementBefore($junior, 'addsettinglisthere'); $senior = $mform->createElement('text', 'mincredithours[3]', get_string('seniorcrhr', 'local_curriculum')); $mform->insertElementBefore($senior, 'addsettinglisthere'); if ($id < 0) { $mform->setDefault('mincredithours[0]', NULL); $mform->setDefault('mincredithours[1]', NULL); $mform->setDefault('mincredithours[2]', NULL); $mform->setDefault('mincredithours[3]', NULL); } } } } /* * End of the curriculum settings * */ } } }
$PAGE->navbar->add(get_string('mycurriculum', 'local_curriculum')); $users = users::getInstance(); echo $OUTPUT->header(); /* ---Heading of the page--- */ echo $OUTPUT->heading(get_string('mycurriculum', 'local_curriculum')); /* ---Moodle 2.2 and onwards--- */ $currenttab = 'myplan'; /* ---adding tabs--- */ $exams->studentside_tabs($currenttab); if (isset($CFG->allowframembedding) and ! $CFG->allowframembedding) { echo $OUTPUT->box(get_string('mycurriculumdec', 'local_curriculum')); } // -----used get to cuurent active semesterid-------------------------------- $hier = new hierarchy(); $semesterid = $hier->get_allmyactivesemester($USER->id); foreach ($semesterid as $key => $value) $semid_getclass = $key; //-------------------------------------------------------------------------- //Assume only one curriculum $query = "SELECT cp.* FROM {local_userdata} u JOIN {local_curriculum} cp ON cp.id=u.curriculumid where u.userid={$USER->id}"; $list = $DB->get_record_sql($query); //foreach ($currlicList as $list) { $table = new html_table(); $table->head = array(get_string('course', 'local_cobaltcourses') . 's', get_string('status'), get_string('grades'), get_string('enrollsem', 'local_curriculum')); $table->size = array('40%', '20%', '20%', '20%'); $table->align = array('left', 'center', 'center', 'center'); $data = array(); $out = '';
</div> </nav> </header> <div id="page" class="container-fluid"> <div id="page-content" class="row-fluid"> <?php if ($hasnavbar) { ?> <div id="bnavbar"><div id="onavbar"><?php echo $OUTPUT->navbar(); ?></div> <nav class="breadcrumb-button"><?php echo $PAGE->button; ?></nav></div> <?php } ?> <div id="header-notifications"> <?php $hierarche=new hierarchy (); foreach ( $hierarche->get_confirmation() as $notice) { if (isset($notice['style'])) { notify($notice['message'], $notice['style']); } else { notify($notice['message']); } } unset($notice); ?> </div> <div class="span6"> <div id="region-pre" class="block-region"> <div class="region-content"> <?php echo $OUTPUT->blocks_for_region('side-pre'); ?>
* List the tool provided in a course * * @package local * @subpackage programs * @copyright 2013 Vinodkumar <*****@*****.**> * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ require_once(dirname(__FILE__) . '/../../config.php'); global $CFG, $PAGE, $DB; require_once($CFG->dirroot . '/local/onlinepayment/lib.php'); require_once($CFG->dirroot . '/local/onlinepayment/paytax_form.php'); require_once($CFG->dirroot . '/local/lib.php'); $fullname = optional_param('fullname', '', PARAM_TEXT); $orderid = optional_param('id', 0, PARAM_INT); $hierarchy = new hierarchy(); $systemcontext = context_system::instance(); //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(); if ($CFG->forcelogin) { require_login(); } else { user_accesstime_log(); } //If the loggedin user have the required capability allow the page //if (!has_capability('local/payment:createtax', $systemcontext)) { // print_error('You dont have permissions');
$capabilities_array = $mysemester->semester_capabilities(); if (!has_any_capability($capabilities_array, $systemcontext)) { print_error('You dont have permissions'); } $PAGE->set_url('/local/semesters/report.php'); $PAGE->set_title(get_string('semesters', 'local_semesters') . ': ' . get_string('report', 'local_semesters')); //Header and the navigation bar $PAGE->set_heading(get_string('semesters', 'local_semesters')); $PAGE->navbar->add(get_string('pluginname', 'local_semesters'), new moodle_url('/local/semesters/index.php')); $PAGE->navbar->add(get_string('report', 'local_semesters')); echo $OUTPUT->header(); //Heading of the page echo $OUTPUT->heading(get_string('pluginname', 'local_semesters')); $currenttab = 'report'; $mysemester->createtabview($currenttab); $hierarchy = new hierarchy(); $schoollist = $hierarchy->get_assignedschools(); if (is_siteadmin()) { $schoollist = $hierarchy->get_school_items(); } $parent = $hierarchy->get_school_parent($schoollist, '', false, false); $schoolid = implode(',', array_keys($parent)); //get the reports for the Current & Completed Semesters. $semesters = $mysemester->get_listofsemesters($currenttab, $schoolid); $data = array(); foreach ($semesters as $semester) { $line = array(); $line[] = $semester->fullname; $line[] = $DB->count_records('local_user_semester', array('semesterid' => $semester->id));
/* ---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/cobaltsettings/school_settings.php'); if (!has_capability('local/cobaltsettings:view', $systemcontext)) { print_cobalterror('permissions_error','local_collegestructure'); } $PAGE->navbar->add(get_string('global_settings', 'local_cobaltsettings'), new moodle_url('/local/cobaltsettings/school_settings.php')); echo $OUTPUT->header(); /* ---global settings--- */ echo $OUTPUT->heading(get_string('school_settings', 'local_cobaltsettings')); $currenturl = "{$CFG->wwwroot}/local/cobaltsettings/school_settings.php"; $hier1 = new hierarchy(); /* ---instance of school settings form--- */ $system = new schoolsettings_form(); /* ---adding tabs using cobalt_settings_tabs function--- */ $global_ob = global_settings::getInstance(); /* ---checking if login user is registrar or admin--- */ $schoolid = $global_ob->check_loginuser_registrar_admin(); try { /* ---description of the cobalt level settings table--- */ echo $des = get_string('des_slsettings', 'local_cobaltsettings'); /* ---used to fectching exists schoolids in cobalt settings table--- */ $tool = $DB->get_records('local_school_settings'); $temp1_cond = array_chunk($tool, 4);
$systemcontext = context_system::instance(); //check the context level of the user and check weather the user is login to the system or not $PAGE->set_context($systemcontext); $PAGE->set_url('/local/curriculum/assigncourses.php'); $PAGE->set_title(get_string('curriculum', 'local_curriculum') . ': ' . get_string('assigncourses', 'local_curriculum')); //Header and the navigation bar $PAGE->set_heading(get_string('curriculumplan', 'local_curriculum')); $PAGE->set_pagelayout('admin'); $cplan = curriculumplan::getInstance(); $conf = new object(); $returnurl = new moodle_url('/local/curriculum/assigncourses.php', array('id' => $id, 'mode' => $mode, 'cid' => $cid)); $hierarchy = new hierarchy(); //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);
$PAGE->set_url('/local/request/requestid.php'); $systemcontext = context_system::instance(); $PAGE->set_context($systemcontext); require_login(); if (!isloggedin() || isguestuser()) { print_error('You dont have permissions'); } $PAGE->set_heading($SITE->fullname); $strheading = get_string('requisitions_id', 'local_request'); $PAGE->navbar->add($strheading); $PAGE->navbar->add(get_string('newrequest', 'local_request')); $PAGE->set_title($strheading); $mform = new requestid_form(); $hierarchy = new hierarchy(); $nexturl = $CFG->wwwroot . '/local/request/request_id.php'; //Form processing and displaying is done here $x = optional_param('schoolid', 0, PARAM_INT); $requestid = new requests(); global $USER; if ($mform->is_cancelled()) { /* if click on cancel it redirects us to request_id.php file */ redirect($nexturl); } else if ($fromform = $mform->get_data()) { /* presence of data */ if (isset($fromform->school_name)) { $schoolid = $fromform->school_name; if (isset($fromform->program_name)) { $pro_id = $fromform->program_name; $semesters = $requestid->semester($fromform->school_name, $fromform->program_name);
* @subpackage scheduleexam * @copyright 2013 pramod <*****@*****.**> * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ require_once(dirname(__FILE__) . '/../../config.php'); require_once($CFG->dirroot . '/local/scheduleexam/lib.php'); require_once($CFG->dirroot . '/local/scheduleexam/edit_form.php'); require_once('../../course/lib.php'); require_once($CFG->dirroot . '/local/lib.php'); $systemcontext =context_system::instance(); if (!has_capability('local/scheduleexam:manage', $systemcontext)) { print_error('You dont have permissions'); } $hierarchy = new hierarchy(); global $exams; $exams = new schedule_exam(); $id = optional_param('id', -1, PARAM_INT); // user id; -1 if creating new tool $delete = optional_param('delete', 0, PARAM_BOOL); $confirm = optional_param('confirm', 0, PARAM_BOOL); $visible = optional_param('visible', -1, PARAM_INT); $currenttab = optional_param('mode', 'create', PARAM_RAW); if ($id > 0) { if (!($tool = $DB->get_record('local_scheduledexams', array('id' => $id)))) { print_error('invalidtoolid', 'local_scheduleexam'); } $tool->opendate = date("m/d/Y", $tool->opendate); } else {
if (!($tool = $DB->get_record('local_cobalt_gpasettings', array('id' => $id)))) { $e = get_string('invalidtoolid', 'local_prefix'); throw new Exception($e); } } else { $tool = new stdClass(); $tool->id = -1; } $PAGE->set_url('/local/cobaltsettings/gpa_settings.php'); $PAGE->navbar->add(get_string('global_settings', 'local_cobaltsettings'), new moodle_url('/local/cobaltsettings/school_settings.php')); if ($delete == 0) { $nav_subhead = ($id > 0 ? 'editgpasettings' : 'gpasettings'); $PAGE->navbar->add(get_string($nav_subhead, 'local_cobaltsettings')); } $currenturl = "{$CFG->wwwroot}/local/cobaltsettings/view_gpasettings.php"; $hier1 = new hierarchy(); $global_ob = global_settings::getInstance(); /* --- Start of delete code semester gpa settings--- */ if ($delete) { $PAGE->url->param('delete', 1); if ($confirm and confirm_sesskey()) { $res = $DB->delete_records('local_cobalt_gpasettings', array('id' => $id)); $global_ob->success_error_msg($res, 'success_del_semgpa', 'error_del_semgpa', $currenturl); } $strheading = get_string('delete_gpasettings', 'local_cobaltsettings'); $PAGE->navbar->add($strheading); $PAGE->set_title($strheading); echo $OUTPUT->header(); $currenttab = 'gpa_settings';