public function listAction()
 {
     $lop = new Model_Lophoc();
     $classes = new Model_Classes();
     $listHocky = $classes->listschoolyears();
     $this->view->listHocky = $listHocky;
     $giangvien = new Model_Giangvien();
     $monhoc = new Model_Monhoc();
     $listGiangvien = $giangvien->findAllGiangvien();
     $listMonhoc = $monhoc->findAllMon();
     $schoolyears = $classes->listschoolyears();
     $this->view->schoolyears = $schoolyears;
     $this->view->listGiangvien = $listGiangvien;
     $this->view->listMonhoc = $listMonhoc;
     if ($this->_request->isPost()) {
         $data = $this->_getParam('searchParam');
         $this->sessionGlobal->dataFind = $data;
         $this->view->dataFind = $this->sessionGlobal->dataFind;
         $listLop = $classes->findAllClassesByData($data);
     } else {
         $listLop = $classes->findAllClasses();
     }
     $this->view->listlop2 = $listLop;
     foreach ($listLop as $a) {
         $idlop = $a->classes_id;
         $sb[$idlop] = $lop->dembuoi($idlop);
     }
     $this->view->sb = $sb;
 }
 public function listAction()
 {
     $lecturer_id = $this->sessionGlobal->lecturer_id;
     $classes = new Model_Classes();
     $listHocky = $classes->listschoolyears();
     $this->view->listHocky = $listHocky;
     // $listClass = $classes->findClassesByLecturer($lecturer_id);
     //$this->view->listClass = $listClass;
     if ($this->_request->isPost()) {
         $params = $this->_getParam('searchParam');
         $semester = $params['semester'];
         $schoolyears_id = $params['schoolyears_id'];
         $this->view->semester = $semester;
         $schoolyears_name = $classes->findOneschoolyears($schoolyears_id);
         $this->view->schoolyears_name = $schoolyears_name;
         $listClass = $classes->findClassesOpeningByLecturer($lecturer_id, $semester, $schoolyears_id);
         $this->view->listClass = $listClass;
     }
 }
 public function lecturerAction()
 {
     $classes = new Model_Classes();
     $lecturer = new Model_Giangvien();
     $listHocky = $classes->listschoolyears();
     $this->view->listHocky = $listHocky;
     $listGiangvien = $lecturer->findGiangvien();
     $this->view->listGiangvien = $listGiangvien;
     if ($this->_request->isPost()) {
         $data = $this->_getParam('searchParam');
         $lecturer_id = $data['lecturer_id'];
         $schoolyears_id = $data['schoolyears_id'];
         $semester = $data['semester'];
         $this->view->semester = $semester;
         $schoolyears_name = $classes->findOneschoolyears($schoolyears_id);
         $this->view->schoolyears_name = $schoolyears_name;
         $listDetail = $classes->findAllClassesByLecturerID($lecturer_id, $semester, $schoolyears_id);
         $solopgiangday = count($listDetail);
         $this->view->solopgiangday = $solopgiangday;
         $this->view->listDetail = $listDetail;
     }
 }
 public function updateAction()
 {
     $classes_id = $_GET['classes_id'];
     $classes = new Model_Classes();
     $findOne = $classes->findOneClasses($classes_id);
     $this->view->findOne = $findOne;
     $giangvien = new Model_Giangvien();
     $monhoc = new Model_Monhoc();
     $listGiangvien = $giangvien->findAllGiangvien();
     $listMonhoc = $monhoc->findAllMon();
     $schoolyears = $classes->listschoolyears();
     $this->view->schoolyears = $schoolyears;
     $this->view->listGiangvien = $listGiangvien;
     $this->view->listMonhoc = $listMonhoc;
     if ($this->_request->isPost()) {
         $data = $this->_getParam('searchParam');
         $classes->updateClasses($classes_id, $data);
         echo '<script>alert("Cập nhật thành công");</script>';
         header("Refresh:0");
     }
 }