Example #1
0
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 */
require_once(dirname(__FILE__) . '/../../config.php');
require_once($CFG->dirroot . '/local/lib.php');
require_once($CFG->dirroot . '/local/cobaltsettings/lib.php');
require_once($CFG->dirroot . '/local/cobaltsettings/schoolsettings_form.php');
global $CFG, $DB, $USER;
$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();
$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();
Example #2
0
            //---------- this part only used for enroll to class----------------------------------
            //$status= get_student_course_status($plancourse->courseid,$semid_getclass,$plancourse->status);
            if (strip_tags($plancourse->status) == 'Not Enrolled') {
                //echo "not enrolled";
                //if ($semid_getclass > 0)
                //    echo $msg = retrieve_listofclclasses_ofcourse($plancourse->courseid, $semid_getclass, $schoolid);
                //else
                //    echo "Presently Course Registration Process Not started You Can't Enroll to Classes of This Course";
            }

            //------------------------------------------------------------------------------
            //echo $semid_getclass;


            if (empty($semid_withoutevents))
                print_cobalterror('notenrolledtoanysem', 'local_courseregistration');

            if (strip_tags($plancourse->status) == 'Completed') {
                //echo "completed";
                echo $msg = get_student_class($plancourse->courseid, $semid_withoutevents, $plancourse->status);
            }
            if (strip_tags($plancourse->status) == 'Rejected') {
                //echo "inprogress";
                echo $msg = get_student_class($plancourse->courseid, $semid_withoutevents, $plancourse->status);
            }
            if (strip_tags($plancourse->status) == 'Enrolled (Inprogress)') {
                //echo "inprogress";
                echo $msg = get_student_class($plancourse->courseid, $semid_withoutevents, $plancourse->status);
            }
            if (strip_tags($plancourse->status) == 'Waiting') {
                //echo "waiting";
Example #3
0
$currentcss = '/local/collegestructure/css/styles.css';
$PAGE->requires->css($currentcss);
$PAGE->set_url('/local/collegestructure/index.php');
/* ---Header and the navigation bar--- */
$PAGE->set_heading(get_string('manageschools', 'local_collegestructure'));
$PAGE->navbar->add(get_string('manageschools', 'local_collegestructure'), new moodle_url('/local/collegestructure/index.php'));
$PAGE->navbar->add(get_string('view', 'local_collegestructure'));
echo $OUTPUT->header();
/* ---Heading of the page--- */
echo $OUTPUT->heading(get_string('manageschools', 'local_collegestructure'));
$currenttab = 'view';
$school->print_collegetabs($currenttab, $id = NULL);
// error handling instead of showing empty table
$schoollist=$DB->get_records('local_school');
if(empty($schoollist)){
 print_cobalterror('schoolnotcreated','local_collegestructure',$CFG->wwwroot.'/local/collegestructure/school.php');   
}
echo '<div style="float:right;"><span><a href="index.php?flat=2"><img src="pix/grid.png" title="Grid View To display all programs and departments in a school" alt="Grid View"> </a> <span> <span><a href="index.php?flat=1"><img src="pix/normal.png" title="Just Displays all the schools and Subschools" alt="Normal View"></a> </span></div>';
/* ---Get the records from the database--- */
/* ---Moodle 2.2 and onwards--- */
if (isset($CFG->allowframembedding) and ! $CFG->allowframembedding) {
    echo $OUTPUT->box(get_string('allowframembedding', 'local_collegestructure'));
}

$flist = 0;
$perpage = 2;
if ($flat == 1 || $flat == 0) {
    /* ---showing the trew view ofthe school strecture--- */
    $school->treeview();
}
if ($flat == 2) {
Example #4
0
/**
 * @method get_assignedschools_inst
 * @Todo To get instructors data of schools
 * @return array of school(school instructor list)
 * */
function get_assignedschools_inst() {
    global $DB, $CFG, $USER;
    $items = array();
    $sql = "SELECT * FROM " . $CFG->prefix . "local_dept_instructor WHERE instructorid = {$USER->id}";
    //echo $sql;
    $schools = $DB->get_records_sql($sql);
    if(empty($schools))
       print_cobalterror('not_assigned_dept','local_gradesubmission');
    foreach ($schools as $school) {
        $items[] = $DB->get_record('local_school', array('id' => $school->schoolid, 'visible' => 1));
    }
    if (!empty($items)) {
        foreach ($items as $item) {
            //check the school is allowed to access the child school
            $list = array();
            if ($item->childpermission) {
                //get te child school upto only one level
                $childs = $DB->get_records('local_school', array('parentid' => $item->id, 'visible' => 1));
                foreach ($childs as $child) {
                    $list[] = $DB->get_record('local_school', array('id' => $child->id, 'visible' => 1));
                }
            }
        }
        $items = array_merge($items, $list);
    }
    return $items;
}
Example #5
0
echo $OUTPUT->header();
//Heading of the page
echo $OUTPUT->heading(get_string('courseapprovalstatus', 'local_courseregistration'));

// Moodle 2.2 and onwards
$currenttab = 'myapprovalstatus';
//adding tabs
print_studenttabs($currenttab);
if (isset($CFG->allowframembedding) and ! $CFG->allowframembedding) {
    echo $OUTPUT->box(get_string('myclasstabdes', 'local_courseregistration'));
}
$semester = student_semesters($USER->id, 'courseregistration');


if (empty($semester))
    print_cobalterror('nosemester_error', 'local_courseregistration');
echo '<div class="selfilterposition" style="text-align:center;margin:20px;">';
$select = new single_select(new moodle_url('/local/courseregistration/approvestatus.php'), 'semesterid', $semester, $semid, null);
$select->set_label(get_string('semestertranscript', 'local_semesters'));
echo $OUTPUT->render($select);
echo '</div>';

$today = date('Y-m-d');
if ($semid) {
    $query = "SELECT lc.*,cc.id AS courseid,
                     cc.fullname AS coursename,
                     c.registrarapproval AS rapproval,
                     c.mentorapproval AS mapproval,
                     c.studentapproval AS sapproval,
                     cc.credithours AS credithours,
                      (select Max(concat(FROM_UNIXTIME(lsc.startdate, '%d-%m-%Y'),'&nbsp; - &nbsp;',FROM_UNIXTIME(lsc.enddate, '%d-%b-%Y'))) FROM {local_scheduleclass} as lsc where lsc.classid=lc.id AND lsc.startdate>0 AND enddate>0 ) AS scheduledate,
Example #6
0
$PAGE->navbar->add(get_string('drop', 'local_adddrop'));
echo $OUTPUT->header();
/* ---Heading of the page--- */
echo $OUTPUT->heading(get_string('drop', 'local_adddrop'));
/* ---Moodle 2.2 and onwards--- */
$currenttab = 'myadddropstatus';
/* ---adding tabs--- */
print_adddroptabs($currenttab, 'student');
if (isset($CFG->allowframembedding) and ! $CFG->allowframembedding) {
    echo $OUTPUT->box(get_string('myclasstabdes', 'local_courseregistration'));
}
$context =context_user::instance($USER->id);
if (has_capability('local/clclasses:enrollclass', $context)) {
    $semester = student_semesters($USER->id,'adddrop');
    if(empty($semester))
        print_cobalterror('notenrolledanyclass','local_adddrop');
    echo '<div class="selfilterposition" style="text-align:center;margin:20px;">';
    $select = new single_select(new moodle_url('/local/adddrop/approvestatus.php'), 'semesterid', $semester, $semid, null);
    $select->set_label(get_string('semester', 'local_semesters'));
    echo $OUTPUT->render($select);
    echo '</div>';
    $today = date('Y-m-d');
    if ($semid) {
        $query = "SELECT lc.*,cc.id AS courseid,
                     cc.fullname AS coursename,
                     c.registrarapproval AS rapproval,
                     c.mentorapproval AS mapproval,
                     c.studentapproval AS sapproval,
                     cc.credithours AS credithours
                      
                FROM {local_course_adddrop} c JOIN {local_clclasses} lc ON c.classid=lc.id 
Example #7
0
$hierarchy = new hierarchy();
$schools = get_assignedschools_inst();
$schoolist = get_school_parent($schools);
echo '<br/><br/>';
echo '<div class="selfilterpos" id="school">';
$sch = new single_select(new moodle_url('/local/gradesubmission/instructor.php'), 'school', $schoolist, $school, null);
$sch->set_label(get_string('schoolid', 'local_collegestructure') . ':&nbsp&nbsp&nbsp&nbsp');
echo $OUTPUT->render($sch);
echo '</div>';

if (isset($school)) {

    $semesterslist = get_school_semesters_inst($school);
    $semcount=count($semesterslist);
    if($school && $semcount<=1)
    print_cobalterror('noactive_sem','local_gradesubmission');    
        
    echo '<div class="selfilterpos" id="semester">';
    $sem = new single_select(new moodle_url('/local/gradesubmission/instructor.php?school=' . $school), 'semester', $semesterslist, $semester, null);
    $sem->set_label(get_string('semester', 'local_semesters') . ':&nbsp&nbsp&nbsp');
    echo $OUTPUT->render($sem);
    echo '</div>';
}
$gradesub = grade_submission::getInstance();
if (isset($semester)) {
    global $USER;
    echo '<div class="selfilterpos" id="class" >';

    $clclasseslist = get_clclasseslist_gradesub_inst($school, $semester, $USER->id);
    $cls = new single_select(new moodle_url('/local/gradesubmission/instructor.php?school=' . $school . '&semester=' . $semester), 'class', $clclasseslist, $class, null);
    $cls->set_label(get_string('headername', 'local_clclasses') . ':&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp');
Example #8
0
<?php

require_once(dirname(__FILE__) . '/../../config.php');
global $CFG, $DB, $PAGE, $USER;
require_once($CFG->dirroot . '/local/classroomresources/lib.php');
$systemcontext = context_system::instance();
$PAGE->set_url('/local/classroomresources/viewfloor.php');
$PAGE->set_pagelayout('admin');
require_login();
if (!has_capability('local/classroomresources:view', $systemcontext)) {
    print_cobalterror('permissions_error','college_structure');
}
$PAGE->set_context($systemcontext);
$PAGE->set_heading(get_string('pluginname', 'local_classroomresources'));
$PAGE->navbar->add(get_string('pluginname', 'local_classroomresources'), new moodle_url('/local/classroomresources/viewfloor.php'));
$PAGE->navbar->add(get_string('viewfloor', 'local_classroomresources'));
echo $OUTPUT->header();

echo $OUTPUT->heading(get_string('manage', 'local_classroomresources'));
$hierarchy = new hierarchy();
$currenttab = 'viewfloor';
$resource = cobalt_resources::get_instance();
// error handling - while school not created yet 
$hierarchy->get_school_items();

$resource->floor_tabs($currenttab);

if (isset($CFG->allowframembedding) and ! $CFG->allowframembedding) {
    echo $OUTPUT->box(get_string('floorview', 'local_classroomresources'));
}
$floors = $resource->cobalt_floor();