App/Lib/Action/Admin/ClassAction.class.php

(开头部分) 3KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

<?php

class ClassAction extends CommonAction {
	
	
    public function index() {
		if ($this->isAjax ()) {
			$Form = D ( 'ClassView' );
			import ( "ORG.Util.Page" );
			if (!empty($_REQUEST['query']))
				$where = $_REQUEST ['qtype'] . " LIKE '%" . $_REQUEST ['query'] . "%'";
			$count = $Form->where($where)->count ();
			$Page  = new Page ( $count, $_REQUEST['rp']);
			$Page->firstRow = $_REQUEST['rp'] * ($_REQUEST['page'] - 1);
			$list  = $Form->where($where)->order ( 'id DESC' )->limit ( $Page->firstRow . ',' . $Page->listRows )->select ();
			$json  = array (
					'page'  => $_REQUEST['page'],
					'total' => $count,
					'rows'  => array ()
			);
			$g = __GROUP__;
			foreach ( $list as $key => $value )
				$json ['rows'] [] = array (
						'id' => $list [$key] ['id'],
						'cell' => array (
								'id'         => $list [$key] ['id'],
								'k'          => $key + 1, // 序号
								'name'       => $list [$key] ['name'],
								'schoolYear' => $list [$key] ['schoolYear'],
								'specialty'  => $list [$key] ['specialty'],
								'teacher'    => $list [$key] ['teacher']
						)
				);
			// echo $Form->_sql();
			echo json_encode ( $json );
		} else {
			$this->toTemplate ( 'Class:index', '班级管理  > 所有班级 >' );
		}
	}

	public function insert() {
		if ($this->isPost()) {
			$Form = D ( 'Class' );
			$data['id']=$_POST['id'];
			//添加班级和课程的外键表
			/*$ct_list=$_POST['courses'];
				if(is_array($ct_list)&&count($ct_list)){
					for($i=0;$i<count($ct_list);$i++){
						$ccl['course_id']=$ct_list[$i];
						$ccl['class_id']=$data['id'];
                        $ccl['teacher_id']=$_POST['teacher_'.$ccl['course_id']];
						M('CourseClass')->add($ccl);
					}
				}*/
			$data['name']=$_POST['name'];
			$data['schoolYear']=$_POST['schoolYear'];
			$data['specialtyID']=$_POST['specialtyID'];
			$data['teacherID']=$_POST['teacherID'];
			//添加班级
			$result=$Form->add($data);
后面还有 76 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。