public function __construct()
 {
     parent::__construct();
     if (Session::user_exist()) {
         $this->admin = new User_Model();
         $this->signatory_model = new Signatory_Model();
         $this->signatoriallist_model = new SignatorialList_Model();
         $this->template = new Template();
         $this->template->setPageName('Settings');
         $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->assign('email_add', Session::get_emailAdd());
         $this->template->set_account_type(Session::get_Account_type());
         $this->template->set_photo(Session::get_photo());
         $this->template->assign('user_type', Session::get_Account_type());
         if (Session::get_Account_type() == "Signatory") {
             $this->template->set_account_type(Session::get_Account_type() . " in Charge");
             $this->template->assign('assign_sign', ", " . Session::get_AssignSignatory());
             $ug_listOfsignatory = $this->signatory_model->getListofSignatoryName();
             $g_listOfsignatory = $this->signatory_model->getListofSignatoryName();
             //$listOfKeysFromSignatories = $this->signatoriallist_model->getKeyListofSignatory();
             $this->template->assign('ug_signatories', $ug_listOfsignatory);
             $this->template->assign('g_signatories', $g_listOfsignatory);
             $this->template->assign('current_assignSign', Session::get_AssignSignatory());
             //$this->template->assign('sign_status', Session::get_signatory_usability());
         } else {
             if (Session::get_Account_type() == "Student") {
                 $this->student_model = new Student_Model();
                 $this->student_model->queryStudent_Info(Session::get_user());
                 $stud_deptName = $this->student_model->getStud_DeptName();
                 $stud_course = $this->student_model->getStud_Course();
                 $this->template->set_account_type($stud_course);
                 $this->template->assign('assign_sign', ", " . $stud_deptName);
             } else {
                 $this->template->assign('assign_sign', '');
             }
         }
         $this->template->setContent('settings.tpl');
     } else {
         header('Location: ' . HOST);
         exit;
     }
 }
 public function __construct()
 {
     parent::__construct();
     if (Session::user_exist() && Session::get_Account_type() == "Signatory") {
         $this->template = new Template();
         $this->user_model = new User_Model();
         $this->schoolYearSem_model = new SchoolYearSem_Model();
         $this->signatorialList_model = new SignatorialList_Model();
         $this->signatory_model = new Signatory_Model();
         $this->bulletin_model = new Bulletin_Model();
         $listOfSchoolYear = $this->schoolYearSem_model->getSchool_Year();
         $currentSemester = $this->schoolYearSem_model->getCurSemester();
         $currentSchool_Year = $this->schoolYearSem_model->getCurSchool_Year();
         $this->template->setPageName('Bulletin Page');
         $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(Session::get_Account_type() . " in Charge -");
         $this->template->set_photo(Session::get_photo());
         $this->template->setContent('UploadSignaturePage.tpl');
         $this->template->setCalendar('Calendar.tpl');
         $this->template->setSchool_YearSemContent('SchoolYear_Sem.tpl');
         $this->template->assign('assign_sign', ", " . Session::get_AssignSignatory());
         $this->template->assign('mySchool_Year', $listOfSchoolYear);
         $this->template->assign('currentSemester', $currentSemester);
         $this->template->assign('currentSchool_Year', $currentSchool_Year);
         $this->signatoryID = $this->user_model->getAssignSignatory_SigIDOnly(Session::get_user());
         $sigIm = $this->signatory_model->getSignature($this->signatoryID);
         if (is_null($sigIm)) {
             $this->template->assign('signatureImage', HOST . "/photos/default_signature.jpg");
             $this->template->assign('hasImageSet', '0');
         } else {
             $this->template->assign('signatureImage', $sigIm);
             $this->template->assign('hasImageSet', '1');
         }
     } else {
         header('Location: /SOCS/');
     }
 }
 public function viewPosted_Bulletin($key)
 {
     $this->template->setPageName('View Already Posted Bulletin Page');
     $this->template->setContent('ViewPostedBulletin.tpl');
     $sign_id = $this->signatorialList_model->getSignId(Session::get_AssignSignatory());
     $this->bulletin_model->ViewBulletin($key, $sign_id);
     $message = $this->bulletin_model->getMessages();
     $date = $this->getDate($this->bulletin_model->getPostDate());
     $time = $this->bulletin_model->getPostTime();
     $this->template->assign('message', $message);
     $this->template->assign('date', $date);
     $this->template->assign('time', $time);
 }
 public function viewStudent_Detail($stud_id, $sy_sem_id)
 {
     $this->student_model->queryStudent_Info($stud_id);
     $stud_name = $this->student_model->getStud_Name();
     $stud_course = $this->student_model->getStud_Course();
     $stud_dept = $this->student_model->getStud_DeptName();
     $stud_gender = $this->student_model->getStud_Gender();
     $stud_yr_level = $this->student_model->getStud_Yearlevel();
     $stud_program = $this->student_model->getStud_Program();
     $stud_section = $this->student_model->getStud_Section();
     $stud_photo = $this->student_model->getStud_Photo();
     $stud_status = $this->student_model->getStud_Status();
     $thisSig = $this->signatorialList_model->getSignId(Session::get_AssignSignatory());
     $stud_overall_status = $this->clearanceStatus_model->getOverallSignatoryClearanceStatus($stud_id, $thisSig, $sy_sem_id);
     $this->template->setPageName("Student Detailed Page");
     $this->template->setContent("Student_Detailed.tpl");
     $this->template->assign('student_name', $stud_name);
     $this->template->assign('course_name', $stud_course);
     $this->template->assign('dept_name', $stud_dept);
     $this->template->assign('stud_gender', $stud_gender);
     $this->template->assign('stud_yr_level', $stud_yr_level);
     $this->template->assign('stud_program', $stud_program);
     $this->template->assign('stud_section', $stud_section);
     $this->template->assign('stud_photo', $stud_photo);
     $this->template->assign('stud_status', $stud_status);
     $this->template->assign('stud_overall_status', $stud_overall_status);
 }
 public function viewEdit_Requirements_submit($id)
 {
     $school_year = $_POST['school_year'];
     $semester = $_POST['semester'];
     $sy_sem = $this->schoolYearSem_model->getSy_ID($school_year, $semester);
     var_dump($sy_sem);
     $requirement_title = $_POST['requirement_title'];
     $requirement_desc = $_POST['requirement_description'];
     $requirement_type = $_POST['requirement_type'];
     if ($requirement_type == "Textual") {
         $signatory = "NULL";
     } else {
         $signatory = $_POST['signatory'];
     }
     $thisSignantory = $this->signatorialList_model->getSignId(Session::get_AssignSignatory());
     $requirement_application = $_POST['req_appliesTo'];
     $department = "NULL";
     $courses = "NULL";
     $year_level = "NULL";
     $program = "NULL";
     switch ($requirement_application) {
         case "By Department":
             $department = $_POST['Departments'];
             break;
         case "By Course":
             $courses = $_POST['Courses'];
             break;
         case "By Year Level":
             $year_level = $_POST['Year_level'];
             break;
         case "By Program":
             $program = $_POST['Program'];
             break;
     }
     /*
     var_dump("sy-sem:'$sy_sem' title:'$requirement_title' desc:'$requirement_desc' type:'$requirement_type' sig:'$signatory' ".
              "appl:'$requirement_application' department:'$department' course:'$courses' yearlevel:'$year_level' program:'$program'");
     */
     //$this->requirement_model->addRequirement($requirement_title, $requirement_desc, $thisSignantory, $sy_sem, $requirement_application, $department, $courses, $year_level, $program, $requirement_type, $signatory);
     $this->requirement_model->editRequirement($id, $requirement_title, $requirement_desc, $thisSignantory, $sy_sem, $requirement_application, $department, $courses, $year_level, $program, $requirement_type, $signatory);
     header("location:requirements.php");
 }