public function showTeachers($pageNo = 1, $pageSize = 10)
 {
     $instId = session('instId');
     if (!$instId) {
         return;
     }
     $start = ($pageNo - 1) * $pageSize;
     $model = new \Home\Model\TeacherModel();
     $teacherList = $model->showTeachers($instId, $start, $pageSize);
     $totals = $model->total($instId);
     $total = $totals[0]['total'];
     $this->assign('teacherList', $teacherList);
     $this->assign('total', $total);
     $this->assign('pageNo', $pageNo);
     $this->assign('pageSize', $pageSize);
     $this->assign("howMangPages", ceil($total / $pageSize - 1) + 1);
     $this->assign('num', 1);
     //记录编号
     layout(true);
     $this->display();
 }
 public function showEditSA()
 {
     $instId = session('instId');
     $isSuperAdmin = session('isSuperAdmin');
     if ($isSuperAdmin != 1) {
         echo TO_HACKERS;
     }
     $operator = new \Home\Model\OperatorModel();
     $result = $operator->showSuperAdmin($instId);
     $this->assign('superAdmin', $result[0]);
     $teacher = new \Home\Model\TeacherModel();
     $teacherList = $teacher->showTeachers($instId, 0, 50);
     $this->assign("teacherList", $teacherList);
     $tnum = 0;
     $this->assign("tnum", $tnum);
     layout(true);
     $this->display();
 }
 public function showClassesDaily($teacherId = 0, $teacherName, $ymd, $nextday)
 {
     if ($teacherId == 0) {
         $teacherId = session('teacherId');
     }
     if ($ymd == null) {
         $ymd = date('Y-m-d');
     }
     if ($nextday != null && $nextday != '') {
         if ($nextday == 'bw') {
             $ymd = date('Y-m-d', strtotime("{$ymd} - 1 day"));
         }
         if ($nextday == 'fw') {
             $ymd = date('Y-m-d', strtotime("{$ymd} + 1 day"));
         }
     }
     $tId = session('instId');
     $teacher = new \Home\Model\TeacherModel();
     $teacherList = $teacher->showTeachers($tId, 0, 50);
     if (session('isSuperAdmin') == 1) {
         $this->assign("teacherList", $teacherList);
     }
     if ($teacherName == null || $teacherName == '') {
         for ($i = 0; $i < count($teacherList); $i++) {
             if ($teacherList[$i]['teacher_id'] == $teacherId) {
                 $teacherName = $teacherList[$i]['name'];
                 break;
             }
         }
     }
     $class = new \Home\Model\ClassModel();
     $result = $class->showDailyClassesByTeacher($tId, $ymd, $teacherId);
     $this->assign("dailyClasses", $result);
     $this->assign('isSuperAdmin', session('isSuperAdmin'));
     $this->assign('teacherId', $teacherId);
     $this->assign('teacherName', $teacherName);
     $this->assign("ymd", $ymd);
     $this->assign('week', date('w', strtotime($ymd)));
     layout(true);
     $this->display();
 }