Example #1
0
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) {
    /* ---showing the grid view of the school structure--- */
    $school->collegegrid($page, $flist, $perpage);
}


echo $OUTPUT->footer();