public function User() { $course_id = $_GET['id']; $course = new CourseModel(); $zhang = new ZhangModel(); $zhanglist = $zhang->where("course_id='{$course_id}'")->select(); $result = $course->where("course_id='{$course_id}'")->find(); $username = Cookie::get('username'); $userid = Cookie::get('userid'); $usertype = Cookie::get('usertype'); $this->assign('course', $result); $this->assign('zhanglist', $zhanglist); $this->assign('username', $username); $this->assign('userid', $userid); $this->assign('usertype', $usertype); $this->display(); }
public function index() { $course_id = $_GET['id']; $course = new CourseModel(); $zhang = new ZhangModel(); $vedio = new VedioModel(); $zhanglist = $zhang->where("course_id ='{$course_id}'")->select(); $result = $course->where("course_id='{$course_id}'")->find(); $username = Cookie::get('username'); $userid = Cookie::get('userid'); $usertype = Cookie::get('usertype'); $this->assign('course', $result); $this->assign('zhanglist', $zhanglist); $this->assign('username', $username); $this->assign('userid', $userid); $this->assign('usertype', $usertype); if ($usertype === 'Teacher') { $urlturn = 'teacherindex'; } else { $urlturn = 'studentindex'; } $this->assign('urlturn', $urlturn); $this->display(); }
public function studentresult() { $zhang_id = $_GET['id']; $username = Cookie::get('username'); $userid = Cookie::get('userid'); $usertype = Cookie::get('usertype'); $test = new TestModel(); $testlist = $test->where("zhang_id='{$zhang_id}'")->select(); $student_test = new Student_testModel(); $student_testlist = $student_test->where("user_id='{$userid}'")->find(); $zhang = new ZhangModel(); $zhanglist = $zhang->where("zhang_id='{$zhang_id}'")->find(); $course_id = $zhanglist['course_id']; $course = new CourseModel(); $courselist = $course->where("course_id='{$course_id}'")->find(); $this->assign('username', $username); $this->assign('userid', $userid); $this->assign('usertype', $usertype); $this->assign('zhang', $zhanglist); $this->assign('student_test', $student_testlist); $this->assign('testlist', $testlist); $this->assign('course', $courselist); $this->display(); }