用jquery实现隐藏列表表单的显示关闭切换以及Ajax方式改动提交相应的那一行的改动内容。
2021-07-20 20:04
//检查学生 public function checkstuAction(){ $stu_id=$this->getRequest()->getParam("stu_id"); $student = new Student(); $res = $student->getStudent($stu_id); $studentchange = new Studentchange(); $res3 = $studentchange->getStuchange($stu_id); $beforeclass_id = $this->getRequest()->getParam('beforeclass_id'); $class_id = $this->getRequest()->getParam('class_id'); $classes = new Classes(); $res1 = $classes->getClassid($beforeclass_id); $res2 = $classes->getClassid($class_id); if(count($res)==0&&count($res3)!=0){ echo '此学号不存在,或在学籍异动中该学生已经存在'; exit(); }elseif(count($res1)==0||count($res2)==0){ echo '班级格式错误或不存在。请检查!'; exit(); }else{ echo 'ok'; exit(); } } //改动 public function updateAction(){ //取值 $student_id1 = $this->getRequest()->getParam('student_id1'); $date1 = $this->getRequest()->getParam('date1'); $beforeclass_id1 = $this->getRequest()->getParam('beforeclass_id1'); $class_id1 = $this->getRequest()->getParam('class_id1'); $type1 = $this->getRequest()->getParam('type1'); $remark1 = $this->getRequest()->getParam('remark1'); //转化班级名为ID $classes = new Classes(); $res1 = $classes->getClassid($beforeclass_id1); $res2 = $classes->getClassid($class_id1); if(count($res1)==0||count($res2)==0){ echo '班级格式错误或不存在。请检查!'; exit(); } $data = array( 'student_id'=>$student_id1, 'date'=>$date1, 'beforeclass_id'=>$res1[0]['id'], 'class_id'=>$res2[0]['id'], 'type'=>$type1, 'remark'=>$remark1 ); $studentchange = new Studentchange(); $db = $studentchange->getAdapter(); $where = $db->quoteInto('student_id=?',$student_id1); $flag=$studentchange->update($data, $where); // $date1 = array( // 'class_id'=>$res2[0]['id'] // ); // $student = new Student(); // $db1 = $student->getAdapter(); // $where1 = $db1->quoteInto('id=?
',$student_id1); // $flag1 = $student->update($data1, $where1); if(count($flag)==0){ echo '您未改动内容或填写格式错误,请检查!'; exit(); }else{ echo '改动成功。'; exit(); } }
下一篇:json串技术
文章标题:用jquery实现隐藏列表表单的显示关闭切换以及Ajax方式改动提交相应的那一行的改动内容。
文章链接:http://soscw.com/index.php/essay/106723.html