示例#1
0
 public function edit()
 {
     $this->login_check(1);
     $user = public_user_id();
     //查询部门数据
     $model_sel = M('bs_kt_sel');
     $rs_sel = $model_sel->field('v')->where("k='dep'")->select();
     $this->assign('dep', $rs_sel[0]);
     $model_user = M('user_teacher');
     $r = -1;
     if (count(I('post.'))) {
         //更新数据
         if ($model_user->where("user='******'")->save(I('post.'))) {
             $r = 1;
         } else {
             $r = 0;
         }
     }
     $this->assign('r', $r);
     $rs_user = $model_user->where("user='******'")->select();
     $rs_user[0]['status'] = $rs_user[0]['status']['status'];
     //ord($rs_user[0]['status']);//转化mysql的bit(1)
     $this->assign('user', $rs_user[0]);
     $ttype = public_user_ttype();
     $this->assign("ttype", $ttype);
     $this->display();
 }
示例#2
0
 public function history()
 {
     $this->login_check(1);
     $user = public_user_id();
     $this->assign('user', $user);
     $ttype = public_user_ttype();
     $this->assign("ttype", $ttype);
     $this->display();
 }
示例#3
0
 public function index()
 {
     $this->login_check(1);
     $user = public_user_id();
     $model_user = M('user_teacher');
     $rs_user = $model_user->field('pic,name')->where("user='******'")->select();
     $this->assign('user', $rs_user[0]);
     $ttype = public_user_ttype();
     $this->assign("ttype", $ttype);
     $this->display();
 }
示例#4
0
 public function xt()
 {
     $this->login_check(1);
     $user = public_user_id();
     $model_user = M('user_teacher');
     $rs_user = $model_user->field('pic,name')->where("user='******'")->select();
     $this->assign('user', $rs_user[0]);
     $Model = new \Think\Model();
     $sql = "select bs_xt.time,bs_kt.id as bid,bs_kt.name,user_student.name as sname,user_student.user,bs_kt.status from bs_xt right join bs_kt on bs_kt.id=bs_xt.bid left join user_student on user_student.user=bs_xt.sid where bs_kt.teacher='{$user}'";
     $rs_xt = $Model->query($sql);
     $this->assign('xt', $rs_xt);
     $ttype = public_user_ttype();
     $this->assign("ttype", $ttype);
     $this->display('xt');
 }