$list['id'] = $usersem->semesterid; $list['fullname'] = $DB->get_field('local_semester', 'fullname', array('id' => $usersem->semesterid)); $semstart = $DB->get_field('local_semester', 'startdate', array('id' => $usersem->semesterid)); $list['semstrdate'] = $semstart; $list['semdate'] = date('Y', $semstart); $semlist[] = $list; } } $val = $usersem->semesterid; } } } } else { die("no records found"); } $schoolslist = $re->array_unique_multidimensional($schoollist); $input = $re->array_unique_multidimensional($semlist); if ($acivitylev != 'Global') { foreach ($schoolslist as $schoolkey => $myschools) { if ($schoolkey == 0) { $topheader = "<h3 style=\"text-align:center;color:#fc4705\">" . strtoupper($schoolslist[$schoolkey]['fullname']) . "</h3>"; if ($acivitylev == 'Program') { $htable2 = "<br><table><tr><th style=\"text-align:center;color:#0f44d6\"><b>PROGRAM EVENTS</b></th></tr></table><br>"; }if ($acivitylev == 'School') { $htable3 = "<br><table><tr><th style=\"text-align:center;color:#0f44d6\"><b>SCHOOL EVENTS</b></th></tr></table><br>"; } } else { if ($schoolslist[$schoolkey - 1]['fullname'] == $schoolslist[$schoolkey]['fullname']) { $topheader = ""; $htable2 = "";