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(); }