本文整理汇总了PHP中hierarchy类的典型用法代码示例。如果您正苦于以下问题:PHP hierarchy类的具体用法?PHP hierarchy怎么用?PHP hierarchy使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了hierarchy类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: definition_after_data
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];
}
// }
}
开发者ID:anilch,项目名称:Personel,代码行数:31,代码来源:setacademiyear_form.php
示例2: cobalt_update_program
/**
* @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);
}
开发者ID:anilch,项目名称:Personel,代码行数:12,代码来源:lib.php
示例3: definition
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');
}
开发者ID:anilch,项目名称:Personel,代码行数:34,代码来源:schoolsettings_form.php
示例4: success_error_msg
/**
* 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'));
}
开发者ID:anilch,项目名称:Personel,代码行数:17,代码来源:lib.php
示例5: success_error_msg
/**
* 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);
}
开发者ID:anilch,项目名称:Personel,代码行数:20,代码来源:lib.php
示例6: definition
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);
}
开发者ID:anilch,项目名称:Personel,代码行数:52,代码来源:school_form.php
示例7: user_download_xls
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;
}
开发者ID:anilch,项目名称:Personel,代码行数:50,代码来源:download_all.php
示例8: definition
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);
}
开发者ID:anilch,项目名称:Personel,代码行数:49,代码来源:settings_form.php
示例9: definition
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);
}
开发者ID:anilch,项目名称:Personel,代码行数:47,代码来源:mod_form.php
示例10: user_download_xls
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 <[email protected]>
* 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;
}
开发者ID:anilch,项目名称:Personel,代码行数:47,代码来源:download_all.php
示例11: definition
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);
}
开发者ID:anilch,项目名称:Personel,代码行数:36,代码来源:edit_form.php
示例12: get_table
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);
}
开发者ID:anilch,项目名称:Personel,代码行数:46,代码来源:index.php
示例13: definition_after_data
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);
}
}
开发者ID:anilch,项目名称:Personel,代码行数:36,代码来源:graduation_form.php
示例14: get_users_listing
/**
* @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<[email protected]>
* (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 ");
}
}
开发者ID:anilch,项目名称:Personel,代码行数:63,代码来源:lib.php
示例15: require_login
$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);
开发者ID:anilch,项目名称:Personel,代码行数:31,代码来源:assign_mentor.php
示例16: require_once
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();
?>
开发者ID:anilch,项目名称:Personel,代码行数:30,代码来源:reject.php
示例17: require_once
* 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--- */
开发者ID:anilch,项目名称:Personel,代码行数:31,代码来源:cobaltcourse.php
示例18: get_string
$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);
开发者ID:anilch,项目名称:Personel,代码行数:30,代码来源:index.php
示例19: definition_after_data
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->setDef
|
请发表评论