public function __construct() { parent::__construct(); if (Session::user_exist() && Session::get_Account_type() == "Student") { $this->template = new Template(); $this->schoolYearSem_model = new SchoolYearSem_Model(); $this->student_model = new Student_Model(); $this->signatoialList = new SignatorialList_Model(); $this->signatory_model = new Signatory_Model(); $this->bulletin_model = new Bulletin_Model(); $this->clearanceStatus_model = new ClearanceStatus(); $this->department_model = new Department_Model(); $this->courses_model = new Course_Model(); $this->student_model->queryStudent_Info(Session::get_user()); $stud_sy_sem = $this->student_model->get_last_attended_sy_sem(); $currentSchool_Year = $this->schoolYearSem_model->getSchool_Year_by_id($stud_sy_sem); $currentSemester = $this->schoolYearSem_model->getSem_by_id($stud_sy_sem); $listOfSchoolYear = $this->schoolYearSem_model->getSchool_Year(); // $currentSemester = $this->schoolYearSem_model->getCurSemester(); // $currentSchool_Year = $this->schoolYearSem_model->getCurSchool_Year(); $currentSemester2 = $this->schoolYearSem_model->getCurSemester(); $currentSchool_Year2 = $this->schoolYearSem_model->getCurSchool_Year(); $this->template->assign('most_current_sem', $currentSemester2); $this->template->assign('most_current_sy', $currentSchool_Year2); $sy_attended = $this->schoolYearSem_model->getSchool_Year_by_id($stud_sy_sem); $sem_attended = $this->schoolYearSem_model->getSem_by_id($stud_sy_sem); // $this->template->assign('sy_attended', $sy_attended); $this->template->assign('sem_attended', $sem_attended); $sy_id2 = $this->schoolYearSem_model->getSy_ID($currentSchool_Year2, $currentSemester2); Session::setSY_SEM_ID($sy_id2); Session::setSchoolYear($currentSchool_Year); Session::setSemester($currentSemester); if (isset($_POST['GO'])) { $arr_sem = array("First", "Second", "Summer"); if (array_search($_POST['semester'], $arr_sem) <= array_search($sem_attended, $arr_sem)) { $sy_id = $this->schoolYearSem_model->getSy_ID(trim($_POST['school_year']), trim($_POST['semester'])); $this->template->assign('currentSemester', trim($_POST['semester'])); } else { $sy_id = $this->schoolYearSem_model->getSy_ID(trim($_POST['school_year']), $sem_attended); $this->template->assign('currentSemester', $sem_attended); } $this->template->assign('currentSchool_Year', trim($_POST['school_year'])); } else { $sy_id = $this->schoolYearSem_model->getSy_ID($currentSchool_Year, $currentSemester); $this->template->assign('currentSemester', $currentSemester); $this->template->assign('currentSchool_Year', $currentSchool_Year); } // $this->student_model->queryStudent_Info(Session::get_user()); $stud_course = $this->student_model->getStud_Course(); $stud_deptName = $this->student_model->getStud_DeptName(); $stud_deptID = $this->student_model->getStud_DeptID(); $stud_status = $this->student_model->getStud_Status(); // $stud_sy_sem = $this->student_model->get_last_attended_sy_sem(); $this->signatoialList->getListofSignatoryByDept($stud_deptID, $stud_status); $listOfSign_underDeptName = $this->signatoialList->getSign_Name(); $listOfSignID_underDeptName = $this->signatoialList->getSign_ID(); $listOfClearanceStatus = $this->getListofClearanceStatus($listOfSignID_underDeptName, $sy_id, Session::get_user()); $this->template->setPageName('Student Clearance Page'); $this->template->setContent('StudentDashboard.tpl'); $this->template->setSchool_YearSemContent('SchoolYear_Sem.tpl'); $this->template->set_username(Session::get_user()); $this->template->set_surname(Session::get_Surname()); $this->template->set_firstname(Session::get_Firstname()); $this->template->set_middlename(Session::get_Middlename()); $this->template->set_account_type($stud_course); $this->template->assign('mySchool_Year', $listOfSchoolYear); $this->template->assign('assign_sign', ", " . $stud_deptName); $this->template->assign('myListOfSign_underDeptName', $listOfSign_underDeptName); $this->template->assign('myKey_signID', $listOfSignID_underDeptName); $this->template->assign('myStudent_ClearanceStatus', $listOfClearanceStatus); $this->template->assign('sy_sem_id', $sy_id); $stud_status = $stud_status == "Graduate" ? "Grad" : "U_Grad"; $this->template->assign('status', $stud_status); $this->template->set_photo(Session::get_photo()); if (isset($_GET['editSuccess'])) { $this->template->setAlert("Account has successfully updated!!... ", Template::ALERT_SUCCESS); } } else { header('Location: /SOCS/index.php'); } }