mirror of
https://gitee.com/zongzhige/shopxo.git
synced 2024-12-03 04:19:37 +08:00
youhau
This commit is contained in:
parent
5a604acad4
commit
37baf067fc
@ -1,481 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Home\Controller;
|
||||
|
||||
/**
|
||||
* 冒泡
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2017-03-02T22:48:35+0800
|
||||
*/
|
||||
class BubbleController extends CommonController
|
||||
{
|
||||
/**
|
||||
* [_initialize 前置操作-继承公共前置方法]
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2017-03-02T22:48:35+0800
|
||||
*/
|
||||
public function _initialize()
|
||||
{
|
||||
// 调用父类前置方法
|
||||
parent::_initialize();
|
||||
|
||||
// 登录校验
|
||||
$this->Is_Login();
|
||||
}
|
||||
|
||||
/**
|
||||
* [Index 冒泡]
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2017-03-02T22:48:35+0800
|
||||
*/
|
||||
public function Index()
|
||||
{
|
||||
// 条件
|
||||
$where = array();
|
||||
if(I('type') == 'own')
|
||||
{
|
||||
$where['u.id'] = $this->user['id'];
|
||||
}
|
||||
|
||||
// 模型
|
||||
$m = M('Mood');
|
||||
|
||||
// 分页
|
||||
$number = 10;
|
||||
$page_param = array(
|
||||
'number' => $number,
|
||||
'total' => $m->alias('m')->join('__USER__ AS u ON m.user_id=u.id')->where($where)->count(),
|
||||
'where' => $_GET,
|
||||
'url' => U('Home/Bubble/Index'),
|
||||
);
|
||||
$page = new \My\Page($page_param);
|
||||
|
||||
// 查询字段
|
||||
$field = array('m.id', 'm.user_id', 'm.content', 'm.visible', 'm.add_time', 'u.nickname');
|
||||
|
||||
// 数据处理
|
||||
$data = $this->MoodDataHandle($m->alias('m')->join('__USER__ AS u ON m.user_id=u.id')->field($field)->where($where)->limit($page->GetPageStarNumber(), $number)->order('m.id desc')->select());
|
||||
$this->assign('data', $data);
|
||||
|
||||
// 分页
|
||||
$this->assign('page_html', $page->GetPageHtml());
|
||||
|
||||
// 基础数据
|
||||
$this->assign('common_user_visible_list', L('common_user_visible_list'));
|
||||
$this->assign('bubble_nav_list', L('bubble_nav_list'));
|
||||
|
||||
$this->display('Index');
|
||||
}
|
||||
|
||||
/**
|
||||
* [MoodDataHandle 说说数据处理]
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2017-04-08T20:14:19+0800
|
||||
* @param [array] $data [需要处理的数据]
|
||||
* @return [array] [处理好的说说数据]
|
||||
*/
|
||||
private function MoodDataHandle($data)
|
||||
{
|
||||
if(!empty($data) && is_array($data))
|
||||
{
|
||||
$mp = M('MoodPraise');
|
||||
$mc = M('MoodComments');
|
||||
foreach($data as $k=>&$v)
|
||||
{
|
||||
// 昵称
|
||||
if(empty($v['nickname']))
|
||||
{
|
||||
$v['nickname'] = L('common_bubble_mood_nickname');
|
||||
}
|
||||
|
||||
// 发表时间
|
||||
$v['add_time'] = date('m-d H:i', $v['add_time']);
|
||||
|
||||
// 点赞
|
||||
$v['praise_count'] = $mp->where(array('mood_id'=>$v['id']))->count();
|
||||
|
||||
// 用户是否已点赞过
|
||||
$v['is_praise'] = ($mp->where(array('mood_id'=>$v['id'], 'user_id'=>$this->user['id']))->getField('id') > 0) ? 'ok' : 'no';
|
||||
|
||||
// 评论总数
|
||||
$v['comments_count'] = $mc->where(array('mood_id'=>$v['id']))->count();
|
||||
|
||||
// 评论列表
|
||||
$v['comments'] = $this->GetMoodComments($v['id']);
|
||||
}
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* [UserIsStateCheck 用户状态校验]
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2017-04-12T15:29:45+0800
|
||||
*/
|
||||
private function UserIsStateCheck()
|
||||
{
|
||||
$state = M('User')->where(array('id'=>$this->user['id']))->getField('state');
|
||||
if($state > 0)
|
||||
{
|
||||
$this->ajaxReturn(L('common_user_state_list')[$state]['tips'], -10);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* [GetMoodComments 获取说说评论]
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2017-04-10T14:38:00+0800
|
||||
* @param [int] $mood_id [说说id]
|
||||
* @return [array] [评论列表]
|
||||
*/
|
||||
private function GetMoodComments($mood_id)
|
||||
{
|
||||
// 参数
|
||||
if(empty($mood_id))
|
||||
{
|
||||
return array();
|
||||
}
|
||||
|
||||
// 评论列表
|
||||
$m = M('MoodComments');
|
||||
$field = array('mc.id', 'mc.user_id', 'mc.content', 'mc.reply_id', 'mc.add_time', 'u.nickname');
|
||||
$where = array('m.id'=>$mood_id, 'mc.reply_id'=>0);
|
||||
$data = $m->alias('mc')->join('__MOOD__ AS m ON mc.mood_id=m.id')->join('__USER__ AS u ON mc.user_id=u.id')->field($field)->where($where)->order('mc.id asc')->select();
|
||||
|
||||
// 回复列表
|
||||
if(!empty($data))
|
||||
{
|
||||
$u = M('User');
|
||||
foreach($data as &$v)
|
||||
{
|
||||
// 评论时间
|
||||
$v['add_time'] = date('m-d H:i', $v['add_time']);
|
||||
|
||||
// 评论内容
|
||||
$v['content'] = str_replace("\n", "<br />", $v['content']);
|
||||
|
||||
$item_where = array('m.id'=>$mood_id, 'mc.parent_id'=>$v['id'], 'reply_id'=>array('gt', 0));
|
||||
$item = $m->alias('mc')->join('__MOOD__ AS m ON mc.mood_id=m.id')->join('__USER__ AS u ON mc.user_id=u.id')->field($field)->where($item_where)->order('mc.id asc')->select();
|
||||
if(!empty($item))
|
||||
{
|
||||
foreach($item as &$vs)
|
||||
{
|
||||
// 评论时间
|
||||
$vs['add_time'] = date('m-d H:i', $vs['add_time']);
|
||||
|
||||
// 评论内容
|
||||
$vs['content'] = str_replace("\n", "<br />", $vs['content']);
|
||||
|
||||
// 被回复的用户
|
||||
if($vs['reply_id'] > 0)
|
||||
{
|
||||
$uid = $m->where(array('id'=>$vs['reply_id']))->getField('user_id');
|
||||
if(!empty($uid))
|
||||
{
|
||||
$user = $u->field(array('id AS reply_user_id', 'nickname AS reply_nickname'))->find($uid);
|
||||
if(empty($user['reply_nickname']))
|
||||
{
|
||||
$user['reply_nickname'] = L('common_bubble_mood_nickname');
|
||||
}
|
||||
$vs = array_merge($vs, $user);
|
||||
}
|
||||
}
|
||||
}
|
||||
$v['item'] = $item;
|
||||
}
|
||||
}
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* [MoodSave 说说保存]
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2017-04-08T13:21:34+0800
|
||||
*/
|
||||
public function MoodSave()
|
||||
{
|
||||
// 是否ajax请求
|
||||
if(!IS_AJAX)
|
||||
{
|
||||
$this->error(L('common_unauthorized_access'));
|
||||
}
|
||||
|
||||
// 用户状态校验
|
||||
$this->UserIsStateCheck();
|
||||
|
||||
// 说说模型
|
||||
$m = D('Mood');
|
||||
|
||||
// 编辑
|
||||
if($m->create($_POST, 1) !== false)
|
||||
{
|
||||
$m->user_id = $this->user['id'];
|
||||
$m->content = I('content');
|
||||
$m->add_time = time();
|
||||
|
||||
// 开启事务
|
||||
$m->startTrans();
|
||||
|
||||
// 更新用户签名
|
||||
if(I('is_sign') == 1)
|
||||
{
|
||||
$data = array(
|
||||
'signature' => $m->content,
|
||||
'upd_time' => time(),
|
||||
);
|
||||
$user_state = (M('User')->where(array('id'=>$this->user['id']))->save($data) !== false);
|
||||
} else {
|
||||
$user_state = true;
|
||||
}
|
||||
|
||||
// 添加历史签名
|
||||
$mood_state = $m->add();
|
||||
|
||||
// 状态
|
||||
if($user_state && $mood_state > 0)
|
||||
{
|
||||
// 提交事务
|
||||
$m->commit();
|
||||
|
||||
// 更新用户session数据
|
||||
if(I('is_sign') == 1)
|
||||
{
|
||||
$this->UserLoginRecord($this->user['id']);
|
||||
}
|
||||
|
||||
$this->ajaxReturn(L('common_operation_publish_success'));
|
||||
} else {
|
||||
|
||||
// 回滚事务
|
||||
$m->rollback();
|
||||
$this->ajaxReturn(L('common_operation_publish_error'), -100);
|
||||
}
|
||||
} else {
|
||||
$this->ajaxReturn($m->getError(), -1);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* [MoodDelete 说说删除]
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2016-12-25T22:36:12+0800
|
||||
*/
|
||||
public function MoodDelete()
|
||||
{
|
||||
// 是否ajax请求
|
||||
if(!IS_AJAX)
|
||||
{
|
||||
$this->error(L('common_unauthorized_access'));
|
||||
}
|
||||
|
||||
// 参数
|
||||
$m = M('Mood');
|
||||
$id = I('id');
|
||||
|
||||
// 只能删除自己的说说
|
||||
$user_id = $m->where(array('id'=>$id))->getField('user_id');
|
||||
if($user_id != $this->user['id'])
|
||||
{
|
||||
$this->ajaxReturn(L('bubble_mood_delete_error'), -2);
|
||||
}
|
||||
|
||||
// 开启事务
|
||||
$m->startTrans();
|
||||
|
||||
// 数据删除[说说,点赞,评论]
|
||||
$mood_state = $m->where(array('id'=>$id, 'user_id'=>$this->user['id']))->delete();
|
||||
$praise_state = M('MoodPraise')->where(array('mood_id'=>$id))->delete();
|
||||
$comments_state = M('MoodComments')->where(array('mood_id'=>$id))->delete();
|
||||
if($mood_state !== false && $praise_state !== false && $comments_state !== false)
|
||||
{
|
||||
// 提交事务
|
||||
$m->commit();
|
||||
|
||||
$this->ajaxReturn(L('common_operation_delete_success'));
|
||||
} else {
|
||||
// 回滚事务
|
||||
$m->rollback();
|
||||
|
||||
$this->ajaxReturn(L('common_operation_delete_error'), -100);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* [MoodCommentsDelete 说说评论删除]
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2016-12-25T22:36:12+0800
|
||||
*/
|
||||
public function MoodCommentsDelete()
|
||||
{
|
||||
// 是否ajax请求
|
||||
if(!IS_AJAX)
|
||||
{
|
||||
$this->error(L('common_unauthorized_access'));
|
||||
}
|
||||
|
||||
// 模型
|
||||
$m = M('MoodComments');
|
||||
|
||||
// 只能删除自己的评论
|
||||
$user_id = $m->where(array('id'=>I('id')))->getField('user_id');
|
||||
if($user_id != $this->user['id'])
|
||||
{
|
||||
$this->ajaxReturn(L('bubble_comments_delete_error'), -2);
|
||||
}
|
||||
|
||||
// 开启事务
|
||||
$m->startTrans();
|
||||
|
||||
// 数据删除
|
||||
$state = $m->where(array('id'=>I('id'), 'user_id'=>$this->user['id']))->delete();
|
||||
$item_state = $m->where(array('parent_id'=>I('id')))->delete();
|
||||
$reply_state = $m->where(array('reply_id'=>I('id')))->delete();
|
||||
if($state !== false && $item_state !== false && $reply_state !== false)
|
||||
{
|
||||
// 提交事务
|
||||
$m->commit();
|
||||
|
||||
$this->ajaxReturn(L('common_operation_delete_success'));
|
||||
} else {
|
||||
// 回滚事务
|
||||
$m->rollback();
|
||||
|
||||
$this->ajaxReturn(L('common_operation_delete_error'), -100);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* [MoodPraise 说说点赞]
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2017-04-09T12:24:24+0800
|
||||
*/
|
||||
public function MoodPraise()
|
||||
{
|
||||
// 是否ajax请求
|
||||
if(!IS_AJAX)
|
||||
{
|
||||
$this->error(L('common_unauthorized_access'));
|
||||
}
|
||||
|
||||
// 用户状态校验
|
||||
$this->UserIsStateCheck();
|
||||
|
||||
// 参数
|
||||
if(empty($_POST['id']))
|
||||
{
|
||||
$this->ajaxReturn(L('common_param_error'), -1);
|
||||
}
|
||||
$id = I('id');
|
||||
|
||||
// 不能点赞自己的说说
|
||||
$mood = M('Mood')->field(array('id', 'user_id'))->find($id);
|
||||
if(empty($mood))
|
||||
{
|
||||
$this->ajaxReturn(L('bubble_mood_no_exist_error'), -2);
|
||||
} else {
|
||||
if($mood['user_id'] == $this->user['id'])
|
||||
{
|
||||
$this->ajaxReturn(L('bubble_mood_praise_error'), -3);
|
||||
}
|
||||
}
|
||||
|
||||
// 查询数据
|
||||
$m = M('MoodPraise');
|
||||
$where = array('user_id'=>$this->user['id'], 'mood_id'=>$id);
|
||||
$temp = $m->where($where)->getField('id');
|
||||
|
||||
// 数据存在删除, 则添加
|
||||
if(empty($temp))
|
||||
{
|
||||
$data = array(
|
||||
'mood_id' => $id,
|
||||
'user_id' => $this->user['id'],
|
||||
'add_time' => time(),
|
||||
);
|
||||
$state = ($m->add($data) > 0);
|
||||
} else {
|
||||
$state = ($m->where($where)->delete() !== false);
|
||||
}
|
||||
|
||||
// 状态
|
||||
if($state)
|
||||
{
|
||||
$this->ajaxReturn(L('common_operation_success'));
|
||||
} else {
|
||||
$this->ajaxReturn(L('common_operation_error'), -100);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* [MoodComments 说说评论]
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2017-04-09T18:52:32+0800
|
||||
*/
|
||||
public function MoodComments()
|
||||
{
|
||||
// 是否ajax请求
|
||||
if(!IS_AJAX)
|
||||
{
|
||||
$this->error(L('common_unauthorized_access'));
|
||||
}
|
||||
|
||||
// 用户状态校验
|
||||
$this->UserIsStateCheck();
|
||||
|
||||
// 说说评论模型
|
||||
$m = D('MoodComments');
|
||||
|
||||
// 编辑
|
||||
if($m->create($_POST, 1) !== false)
|
||||
{
|
||||
// 不能回复自己的评论
|
||||
if($m->reply_id > 0)
|
||||
{
|
||||
$user_id = $m->where(array('id'=>$m->reply_id))->getField('user_id');
|
||||
if($user_id == $this->user['id'])
|
||||
{
|
||||
$this->ajaxReturn(L('bubble_comments_reply_error'), -2);
|
||||
}
|
||||
}
|
||||
|
||||
// 额外数据处理
|
||||
$m->add_time = time();
|
||||
$m->content = I('content');
|
||||
$m->user_id = $this->user['id'];
|
||||
|
||||
// 写入数据库
|
||||
if($m->add())
|
||||
{
|
||||
$this->ajaxReturn(L('common_operation_comments_success'));
|
||||
} else {
|
||||
$this->ajaxReturn(L('common_operation_comments_error'), -100);
|
||||
}
|
||||
} else {
|
||||
$this->ajaxReturn($m->getError(), -1);
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
@ -1,480 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Home\Controller;
|
||||
|
||||
/**
|
||||
* 学生
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2017-03-02T22:48:35+0800
|
||||
*/
|
||||
class StudentController extends CommonController
|
||||
{
|
||||
/**
|
||||
* [_initialize 前置操作-继承公共前置方法]
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2017-03-02T22:48:35+0800
|
||||
*/
|
||||
public function _initialize()
|
||||
{
|
||||
// 调用父类前置方法
|
||||
parent::_initialize();
|
||||
|
||||
// 登录校验
|
||||
$this->Is_Login();
|
||||
}
|
||||
|
||||
/**
|
||||
* [Index 首页]
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2017-02-22T16:50:32+0800
|
||||
*/
|
||||
public function Index()
|
||||
{
|
||||
// 获取列表
|
||||
$where = array('us.user_id'=>$this->user['id']);
|
||||
$list = $this->StudentSetDataHandle(M('UserStudent')->alias('AS us')->join('__STUDENT__ AS s ON s.id=us.student_id ')->field('s.*, us.id AS user_student_id,us.add_time AS bundled_time')->where($where)->select());
|
||||
|
||||
// 数据列表
|
||||
$this->assign('list', $list);
|
||||
$this->display('Index');
|
||||
}
|
||||
|
||||
/**
|
||||
* [StudentSetDataHandle 数据处理]
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2016-12-29T21:27:15+0800
|
||||
* @param [array] $data [学生数据]
|
||||
* @return [array] [处理好的数据]
|
||||
*/
|
||||
private function StudentSetDataHandle($data)
|
||||
{
|
||||
$result = array();
|
||||
if(!empty($data))
|
||||
{
|
||||
$c = M('Class');
|
||||
$r = M('Region');
|
||||
$s = M('Semester');
|
||||
foreach($data as $k=>$v)
|
||||
{
|
||||
if(!isset($result[$v['semester_id']]))
|
||||
{
|
||||
// 学期
|
||||
$result[$v['semester_id']]['id'] = $v['semester_id'];
|
||||
$result[$v['semester_id']]['name'] = $s->where(array('id'=>$v['semester_id']))->getField('name');
|
||||
}
|
||||
|
||||
// 班级
|
||||
$tmp_class = $c->field(array('pid', 'name'))->find($v['class_id']);
|
||||
if(!empty($tmp_class))
|
||||
{
|
||||
$p_name = ($tmp_class['pid'] > 0) ? $c->where(array('id'=>$tmp_class['pid']))->getField('name') : '';
|
||||
$v['class_name'] = empty($p_name) ? $tmp_class['name'] : $p_name.'-'.$tmp_class['name'];
|
||||
} else {
|
||||
$v['class_name'] = '';
|
||||
}
|
||||
|
||||
// 地区
|
||||
$v['region_name'] = $r->where(array('id'=>$v['region_id']))->getField('name');
|
||||
|
||||
// 学期
|
||||
$v['semester_text'] = $result[$v['semester_id']]['name'];
|
||||
|
||||
// 出生
|
||||
$v['birthday'] = date('Y-m-d', $v['birthday']);
|
||||
|
||||
// 报名时间
|
||||
$v['add_time'] = date('Y-m-d H:i:s', $v['add_time']);
|
||||
|
||||
// 更新时间
|
||||
$v['upd_time'] = date('Y-m-d H:i:s', $v['upd_time']);
|
||||
|
||||
// 绑定时间
|
||||
$v['bundled_time'] = date('Y-m-d H:i:s', $v['bundled_time']);
|
||||
|
||||
// 性别
|
||||
$v['gender'] = L('common_gender_list')[$v['gender']]['name'];
|
||||
|
||||
// 状态
|
||||
$v['state'] = L('common_student_state_list')[$v['state']]['name'];
|
||||
|
||||
// 缴费状态
|
||||
$v['tuition_state_text'] = L('common_tuition_state_list')[$v['tuition_state']]['name'];
|
||||
|
||||
$result[$v['semester_id']]['item'][] = $v;
|
||||
}
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* [ScoreInfo 成绩查询]
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2017-03-22T22:39:04+0800
|
||||
*/
|
||||
public function ScoreInfo()
|
||||
{
|
||||
$id = I('id');
|
||||
if(!empty($id))
|
||||
{
|
||||
$field = array('s.username', 's.class_id', 'f.score', 'f.subject_id', 'f.score_id', 'f.comment', 'f.add_time');
|
||||
$where = array('us.user_id'=>$this->user['id'], 'us.id'=>$id);
|
||||
$data = $this->ScoreSetDataHandle(M('UserStudent')->alias('AS us')->join('__STUDENT__ AS s ON us.student_id=s.id')->join('__FRACTION__ AS f ON s.id=f.student_id')->where($where)->field($field)->order('f.score_id ASC')->select());
|
||||
$this->assign('data', $data);
|
||||
$this->assign('student_score_title_list', L('student_score_title_list'));
|
||||
}
|
||||
$this->display('ScoreInfo');
|
||||
}
|
||||
|
||||
/**
|
||||
* [ScoreSetDataHandle 数据处理]
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2016-12-29T21:27:15+0800
|
||||
* @param [array] $data [学生数据]
|
||||
* @return [array] [处理好的数据]
|
||||
*/
|
||||
private function ScoreSetDataHandle($data)
|
||||
{
|
||||
$result = array();
|
||||
if(!empty($data))
|
||||
{
|
||||
$score = M('Score');
|
||||
$subject = M('Subject');
|
||||
$class = M('Class');
|
||||
$score_level = L('common_fraction_level_list');
|
||||
foreach($data as $k=>$v)
|
||||
{
|
||||
// 基础资料
|
||||
if(!isset($result['username']))
|
||||
{
|
||||
// 姓名
|
||||
$result['username'] = $v['username'];
|
||||
|
||||
// 班级
|
||||
$tmp_class = $class->field(array('pid', 'name'))->find($v['class_id']);
|
||||
if(!empty($tmp_class))
|
||||
{
|
||||
$p_name = ($tmp_class['pid'] > 0) ? $class->where(array('id'=>$tmp_class['pid']))->getField('name') : '';
|
||||
$result['class_name'] = empty($p_name) ? $tmp_class['name'] : $p_name.'-'.$tmp_class['name'];
|
||||
}
|
||||
}
|
||||
|
||||
// 学期key
|
||||
$score_key = $v['score_id'];
|
||||
|
||||
// 成绩期号
|
||||
if(!isset($result['item'][$score_key]))
|
||||
{
|
||||
$result['item'][$score_key]['name'] = $score->where(array('id'=>$v['score_id']))->getField('name');
|
||||
}
|
||||
|
||||
// 科目
|
||||
$v['subject_name'] = $subject->where(array('id'=>$v['subject_id']))->getField('name');
|
||||
|
||||
// 成绩等级
|
||||
foreach($score_level as $level)
|
||||
{
|
||||
if($v['score'] >= $level['min'] && $v['score'] <= $level['max'])
|
||||
{
|
||||
$v['score_level'] = $level['name'];
|
||||
}
|
||||
}
|
||||
if(!isset($v['score_level']))
|
||||
{
|
||||
$v['score_level'] = '';
|
||||
}
|
||||
|
||||
// 添加时间
|
||||
$v['add_time'] = date('Y-m-d', $v['add_time']);
|
||||
|
||||
unset($v['username'], $v['class_id'], $v['subject_id'], $v['score_id']);
|
||||
$result['item'][$score_key]['item'][] = $v;
|
||||
}
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* [PolyInfo 学生关联-页面]
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2017-03-15T11:22:33+0800
|
||||
*/
|
||||
public function PolyInfo()
|
||||
{
|
||||
$this->display('PolyInfo');
|
||||
}
|
||||
|
||||
/**
|
||||
* [Delete 学生关联-解除]
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2016-12-25T22:36:12+0800
|
||||
*/
|
||||
public function Delete()
|
||||
{
|
||||
if(!IS_AJAX)
|
||||
{
|
||||
$this->error(L('common_unauthorized_access'));
|
||||
}
|
||||
|
||||
// 数据删除
|
||||
if(M('UserStudent')->where(array('id'=>I('id'), 'user_id'=>$this->user['id']))->delete())
|
||||
{
|
||||
$this->ajaxReturn(L('common_operation_delete_success'));
|
||||
} else {
|
||||
$this->ajaxReturn(L('common_operation_delete_error'), -100);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* [Poly 学生关联]
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2017-03-22T16:47:29+0800
|
||||
*/
|
||||
public function Poly()
|
||||
{
|
||||
// 是否ajax请求
|
||||
if(!IS_AJAX)
|
||||
{
|
||||
$this->error(L('common_unauthorized_access'));
|
||||
}
|
||||
|
||||
// 参数是否有误
|
||||
if(empty($_POST['id']) || empty($_POST['accounts']) || empty($_POST['verify']))
|
||||
{
|
||||
$this->ajaxReturn(L('common_param_error'), -1);
|
||||
}
|
||||
|
||||
// 账户是否存在
|
||||
$accounts = I('accounts');
|
||||
$field = $this->StudentPolyAccountsCheck($accounts);
|
||||
|
||||
// 验证码校验
|
||||
$verify_param = array(
|
||||
'key_prefix' => 'student_poly',
|
||||
'expire_time' => MyC('common_verify_expire_time'),
|
||||
'time_interval' => MyC('common_verify_time_interval'),
|
||||
);
|
||||
if($field == 'email')
|
||||
{
|
||||
$obj = new \My\Email($verify_param);
|
||||
|
||||
} else {
|
||||
$obj = new \My\Sms($verify_param);
|
||||
}
|
||||
// 是否已过期
|
||||
if(!$obj->CheckExpire())
|
||||
{
|
||||
$this->ajaxReturn(L('common_verify_expire'), -10);
|
||||
}
|
||||
// 是否正确
|
||||
if(!$obj->CheckCorrect(I('verify')))
|
||||
{
|
||||
$this->ajaxReturn(L('common_verify_error'), -11);
|
||||
}
|
||||
|
||||
// 查询用户数据
|
||||
$where = array('id'=>I('id'), $field=>$accounts, 'semester_id'=>MyC('admin_semester_id'));
|
||||
$student_id = M('Student')->where($where)->getField('id');
|
||||
if(!empty($student_id))
|
||||
{
|
||||
$data = array(
|
||||
'student_id' => $student_id,
|
||||
'user_id' => $this->user['id'],
|
||||
'add_time' => time(),
|
||||
);
|
||||
if(M('UserStudent')->add($data))
|
||||
{
|
||||
// 清除验证码
|
||||
$obj->Remove();
|
||||
|
||||
$this->ajaxReturn(L('common_operation_join_success'));
|
||||
}
|
||||
$this->ajaxReturn(L('common_operation_join_error'), -100);
|
||||
}
|
||||
$this->ajaxReturn(L('common_student_no_exist_error'), -1000);
|
||||
}
|
||||
|
||||
/**
|
||||
* [PolyQuery 学生关联-数据查询]
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2017-03-17T16:58:26+0800
|
||||
*/
|
||||
public function PolyQuery()
|
||||
{
|
||||
// 是否ajax请求
|
||||
if(!IS_AJAX)
|
||||
{
|
||||
$this->error(L('common_unauthorized_access'));
|
||||
}
|
||||
|
||||
// 参数是否有误
|
||||
if(empty($_POST['username']) || empty($_POST['student_number']) || empty($_POST['id_card']))
|
||||
{
|
||||
$this->ajaxReturn(L('common_param_error'), -1);
|
||||
}
|
||||
|
||||
// 查询用户数据
|
||||
$where = array('username'=>I('username'), 'number'=>I('student_number'), 'id_card'=>I('id_card'), 'semester_id'=>MyC('admin_semester_id'));
|
||||
$data = M('Student')->field(array('id', 'my_mobile', 'parent_mobile', 'email'))->where($where)->find();
|
||||
if(!empty($data))
|
||||
{
|
||||
// 是否已关联过
|
||||
$temp = M('UserStudent')->where(array('student_id'=>$data['id'], 'user_id'=>$this->user['id']))->getField('id');
|
||||
if(!empty($temp))
|
||||
{
|
||||
$this->ajaxReturn(L('student_join_accounts_exist_tips'), -2);
|
||||
}
|
||||
|
||||
// 封装返回数据
|
||||
$result = array('id' => $data['id'], 'contact_list' => array());
|
||||
if(!empty($data['my_mobile']))
|
||||
{
|
||||
$result['contact_list'][] = $data['my_mobile'];
|
||||
}
|
||||
if(!empty($data['parent_mobile']))
|
||||
{
|
||||
$result['contact_list'][] = $data['parent_mobile'];
|
||||
}
|
||||
if(!empty($data['email']))
|
||||
{
|
||||
$result['contact_list'][] = $data['email'];
|
||||
}
|
||||
$this->ajaxReturn(L('common_operation_success'), 0, $result);
|
||||
}
|
||||
$this->ajaxReturn(L('common_student_no_exist_error'), -1000);
|
||||
}
|
||||
|
||||
/**
|
||||
* [PolyVerifyEntry 学生关联-验证码显示]
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2017-03-05T15:10:21+0800
|
||||
*/
|
||||
public function PolyVerifyEntry()
|
||||
{
|
||||
$this->CommonVerifyEntry(I('type', 'student_poly'));
|
||||
}
|
||||
|
||||
/**
|
||||
* [PolyVerifySend 学生关联-验证码发送]
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2017-03-10T17:35:03+0800
|
||||
*/
|
||||
public function PolyVerifySend()
|
||||
{
|
||||
// 是否ajax请求
|
||||
if(!IS_AJAX)
|
||||
{
|
||||
$this->error(L('common_unauthorized_access'));
|
||||
}
|
||||
|
||||
// 参数
|
||||
$accounts = I('accounts');
|
||||
if(empty($accounts))
|
||||
{
|
||||
$this->ajaxReturn(L('common_param_error'), -10);
|
||||
}
|
||||
|
||||
// 账户是否存在
|
||||
$type = $this->StudentPolyAccountsCheck($accounts);
|
||||
|
||||
// 验证码公共基础参数
|
||||
$verify_param = array(
|
||||
'key_prefix' => 'student_poly',
|
||||
'expire_time' => MyC('common_verify_expire_time'),
|
||||
'time_interval' => MyC('common_verify_time_interval'),
|
||||
);
|
||||
|
||||
// 是否开启图片验证码
|
||||
$verify = $this->CommonIsImaVerify($verify_param);
|
||||
|
||||
// 验证码
|
||||
$code = GetNumberCode(6);
|
||||
|
||||
// 邮箱
|
||||
if($type == 'email')
|
||||
{
|
||||
$obj = new \My\Email($verify_param);
|
||||
$email_param = array(
|
||||
'email' => $accounts,
|
||||
'content' => MyC('home_email_user_student_binding'),
|
||||
'title' => MyC('home_site_name').' - '.L('student_operation_binding_text'),
|
||||
'code' => $code,
|
||||
);
|
||||
$state = $obj->SendHtml($email_param);
|
||||
|
||||
// 短信
|
||||
} else {
|
||||
$obj = new \My\Sms($verify_param);
|
||||
$state = $obj->SendText($accounts, MyC('home_sms_user_student_binding'), $code);
|
||||
}
|
||||
|
||||
// 状态
|
||||
if($state)
|
||||
{
|
||||
// 清除验证码
|
||||
if(isset($verify) && is_object($verify))
|
||||
{
|
||||
$verify->Remove();
|
||||
}
|
||||
|
||||
$this->ajaxReturn(L('common_send_success'));
|
||||
} else {
|
||||
$this->ajaxReturn(L('common_send_error').'['.$obj->error.']', -100);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* [StudentPolyAccountsCheck 学生是否存在]
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2017-03-22T17:39:56+0800
|
||||
* @param [string] $accounts [my_mobile, parent_mobile, email]
|
||||
* @return [string] [表字段名称 my_mobile, parent_mobile, email]
|
||||
*/
|
||||
private function StudentPolyAccountsCheck($accounts)
|
||||
{
|
||||
$field = array('my_mobile', 'parent_mobile', 'email');
|
||||
$where = array(
|
||||
array(
|
||||
'my_mobile' => $accounts,
|
||||
'parent_mobile' => $accounts,
|
||||
'email' => $accounts,
|
||||
'_logic' => 'OR',
|
||||
),
|
||||
'semester_id' => MyC('admin_semester_id'),
|
||||
);
|
||||
$data = M('Student')->field($field)->where($where)->find();
|
||||
if(!empty($data))
|
||||
{
|
||||
$key = array_search($accounts, $data);
|
||||
return ($key === false) ? '' : $key;
|
||||
} else {
|
||||
$this->ajaxReturn(L('common_student_no_exist_error'), -1000);
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
@ -1,133 +0,0 @@
|
||||
<include file="Public/Header" />
|
||||
|
||||
<!-- header nav start -->
|
||||
<include file="Public/HeaderNav" />
|
||||
<!-- header nav end -->
|
||||
|
||||
<div class="am-cf user-main" <if condition="!empty($max_width_style)">style="{{$max_width_style}}"</if>>
|
||||
<!-- user menu start -->
|
||||
<include file="Public/UserMenu" />
|
||||
<!-- user menu end -->
|
||||
|
||||
<!-- content start -->
|
||||
<div class="user-content">
|
||||
<div class="user-content-body p-10">
|
||||
<include file="Mood" />
|
||||
<include file="Nav" />
|
||||
|
||||
<!-- list start -->
|
||||
<if condition="!empty($data)">
|
||||
<div id="mood-list">
|
||||
<foreach name="data" item="v">
|
||||
<div class="am-panel am-panel-default am-radius list-content data-list-mood-{{$v.id}}">
|
||||
<div class="am-panel-bd">
|
||||
<div class="list-title o-h">
|
||||
<img src="__PUBLIC__/Common/Images/user-img-sm.gif" class="am-circle am-fl" width="48" height="48" />
|
||||
<div class="am-fl m-l-10 m-t-5">
|
||||
<span class="block">
|
||||
<a href="javascript:;">{{$v.nickname}}</a>
|
||||
</span>
|
||||
<span class="block cr-999">{{$v.add_time}}</span>
|
||||
</div>
|
||||
<if condition="$v['user_id'] eq $user['id']">
|
||||
<div class="am-fr">
|
||||
<i class="am-icon-trash-o c-p cr-999 submit-delete" data-am-popover="{content: '{{:L('common_operation_delete')}}', trigger: 'hover focus'}" data-id="{{$v.id}}" data-url="{{:U('Home/Bubble/MoodDelete')}}" data-list-tag=".data-list-mood-{{$v.id}}"></i>
|
||||
</div>
|
||||
</if>
|
||||
</div>
|
||||
<div class="m-t-5">{{$v.content}}</div>
|
||||
<div class="m-t-5 o-h">
|
||||
<span class="am-fr cr-999">{{$v.comments_count}}</span>
|
||||
<i class="am-icon-commenting am-icon-sm am-fr m-l-30 c-p cr-999 comments-submit" data-id="{{$v.id}}" data-uid="{{$v.user_id}}"></i>
|
||||
<span class="am-fr cr-999">{{$v.praise_count}}</span>
|
||||
<i class="am-icon-thumbs-up am-icon-sm am-fr c-p praise-submit <if condition="$v['is_praise'] eq 'ok'">cr-blue<else />cr-999</if>" data-id="{{$v.id}}" data-uid="{{$v.user_id}}" data-url="{{:U('Home/Bubble/MoodPraise')}}"></i>
|
||||
</div>
|
||||
<if condition="!empty($v['comments'])">
|
||||
<div class="o-h data-list-mood-{{$v.id}}">
|
||||
<hr data-am-widget="divider" class="am-divider am-divider-dashed m-t-10 m-b-10" />
|
||||
<foreach name="v.comments" item="vc">
|
||||
<div class="o-h m-t-10 am-radius comments-user data-comments-{{$v.id}}-{{$vc.id}}">
|
||||
<img src="__PUBLIC__/Common/Images/user-img-sm.gif" class="am-circle user-portrait" width="30" height="30" />
|
||||
<a href="javascript:;">{{$vc.nickname}}</a>
|
||||
<span class="cr-999">{{$vc.add_time}}</span>
|
||||
<div class="am-fr comments-item-tools">
|
||||
<if condition="$vc['user_id'] neq $user['id']">
|
||||
<span class="c-p cr-999 reply-submit" data-id="{{$v.id}}" data-reply-id="{{$vc.id}}" data-parent-id="{{$vc.id}}" data-nickname="{{$vc.nickname}}">
|
||||
<i class="am-icon-mail-reply"></i> {{:L('common_operation_reply')}}
|
||||
</span>
|
||||
</if>
|
||||
<if condition="$vc['user_id'] eq $user['id']">
|
||||
<span class="c-p cr-999 m-l-20 submit-delete" data-id="{{$vc.id}}" data-url="{{:U('Home/Bubble/MoodCommentsDelete')}}" data-list-tag=".data-comments-{{$v.id}}-{{$vc.id}}">
|
||||
<i class="am-icon-trash-o"></i>{{:L('common_operation_delete')}}
|
||||
</span>
|
||||
</if>
|
||||
</div>
|
||||
<div>{{$vc.content}}</div>
|
||||
</div>
|
||||
<if condition="!empty($vc['item'])">
|
||||
<foreach name="vc.item" item="vcs">
|
||||
<div class="o-h m-t-10 am-radius comments-user m-l-30 data-comments-{{$v.id}}-{{$vc.id}} data-comments-{{$v.id}}-{{$vc.id}}-{{$vcs.id}} <if condition="$vcs['reply_id'] gt 0">data-comments-reply-{{$v.id}}-{{$vcs.reply_id}}</if>">
|
||||
<img src="__PUBLIC__/Common/Images/user-img-sm.gif" class="am-circle user-portrait" width="30" height="30" />
|
||||
<a href="javascript:;">{{$vcs.nickname}}</a>
|
||||
<span>{{:L('common_operation_reply')}}</span>
|
||||
<a href="javascript:;">{{$vcs.reply_nickname}}</a>
|
||||
<span class="cr-999">{{$vcs.add_time}}</span>
|
||||
<div class="am-fr comments-item-tools">
|
||||
<if condition="$vcs['user_id'] neq $user['id']">
|
||||
<span class="c-p cr-999 reply-submit" data-reply-id="{{$vcs.id}}" data-id="{{$v.id}}" data-parent-id="{{$vc.id}}" data-nickname="{{$vcs.nickname}}">
|
||||
<i class="am-icon-mail-reply"></i> {{:L('common_operation_reply')}}
|
||||
</span>
|
||||
</if>
|
||||
<if condition="$vcs['user_id'] eq $user['id']">
|
||||
<span class="c-p cr-999 m-l-20 submit-delete" data-id="{{$vcs.id}}" data-url="{{:U('Home/Bubble/MoodCommentsDelete')}}" data-list-tag=".data-comments-{{$v.id}}-{{$vc.id}}-{{$vcs.id}}, .data-comments-reply-{{$v.id}}-{{$vcs.id}}">
|
||||
<i class="am-icon-trash-o"></i>{{:L('common_operation_delete')}}
|
||||
</span>
|
||||
</if>
|
||||
</div>
|
||||
<div>{{$vcs.content}}</div>
|
||||
</div>
|
||||
</foreach>
|
||||
</if>
|
||||
</foreach>
|
||||
</div>
|
||||
</if>
|
||||
</div>
|
||||
</div>
|
||||
</foreach>
|
||||
</div>
|
||||
|
||||
<!-- page start -->
|
||||
{{$page_html}}
|
||||
<!-- page end -->
|
||||
|
||||
<!-- comments win start -->
|
||||
<div class="am-modal am-modal-prompt" tabindex="-1" id="bubble-comments" data-url="{{:U('Home/Bubble/MoodComments')}}" data-mood-praise-msg="{{:L('bubble_mood_praise_error')}}" data-mood-comments-msg="{{:L('bubble_mood_comments_error')}}">
|
||||
<div class="am-modal-dialog am-radius">
|
||||
<div class="am-modal-hd"></div>
|
||||
<div class="am-modal-bd">
|
||||
<textarea rows="3" minlength="1" maxlength="255" class="am-radius am-modal-prompt-input" placeholder="{{:L('bubble_comments_placeholder')}}" data-validation-message="{{:L('bubble_comments_format')}}"></textarea>
|
||||
</div>
|
||||
<div class="am-modal-footer">
|
||||
<span class="am-modal-btn" data-am-modal-cancel>{{:L('common_operation_cancel')}}</span>
|
||||
<span class="am-modal-btn" data-am-modal-confirm>{{:L('common_operation_comments')}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- comments win end -->
|
||||
|
||||
<else />
|
||||
<include file="Public/NoData" />
|
||||
</if>
|
||||
<!-- list start -->
|
||||
</div>
|
||||
</div>
|
||||
<!-- content end -->
|
||||
</div>
|
||||
|
||||
<!-- layuot common module start -->
|
||||
<include file="Public/CommonModule" />
|
||||
<!-- layuot common module end -->
|
||||
|
||||
<!-- footer start -->
|
||||
<include file="Public/Footer" />
|
||||
<!-- footer end
|
@ -1,27 +0,0 @@
|
||||
<!-- form start -->
|
||||
<form class="am-form form-validation" action="{{:U('Home/Bubble/MoodSave')}}" method="POST" request-type="ajax-reload" request-value="">
|
||||
<div class="am-form-group am-input-group am-input-group-primary m-b-0">
|
||||
<textarea minlength="1" maxlength="168" name="content" class="mood-textarea" placeholder="{{:L('bubble_mood_placeholder')}}" data-validation-message="{{:L('bubble_mood_format')}}"></textarea>
|
||||
<span class="am-input-group-btn">
|
||||
<button class="am-btn am-btn-primary mood-button" type="submit" data-am-loading="{loadingText:'{{:L('common_form_loading_tips')}}'}">{{:L('common_operation_publish')}}</button>
|
||||
</span>
|
||||
</div>
|
||||
<div class="am-panel am-panel-default mood-tools m-t-0">
|
||||
<div class="am-fr tools-visible">
|
||||
<span>{{:L('bubble_visible_text')}}</span>
|
||||
<select name="visible" data-am-selected>
|
||||
<foreach name="common_user_visible_list" item="v">
|
||||
<if condition="isset($v['is_show']) and $v['is_show'] eq 1">
|
||||
<option value="{{$v.value}}">{{$v.name}}</option>
|
||||
</if>
|
||||
</foreach>
|
||||
</select>
|
||||
</div>
|
||||
<span class="am-fr cr-ccc m-l-10 m-r-10">|</span>
|
||||
<label class="c-p am-fr" data-am-popover="{content: '{{:L('bubble_is_sign_hover')}}', trigger: 'hover focus'}">
|
||||
<input type="checkbox" name="is_sign" value="1" class="none" checked />
|
||||
<i class="am-icon-user am-icon-btn am-primary sign-submit"></i>
|
||||
</label>
|
||||
</div>
|
||||
</form>
|
||||
<!-- form end -->
|
@ -1,22 +0,0 @@
|
||||
<!-- nav start -->
|
||||
<div class="bubble-nav o-h m-b-10">
|
||||
<ul class="am-nav am-nav-pills am-fl">
|
||||
<foreach name="bubble_nav_list" item="v">
|
||||
<if condition="I('type', 'all') eq $v['type']">
|
||||
<li class="am-active" data-type="{{$v.type}}">
|
||||
<a href="javascript:;">{{$v.name}}</a>
|
||||
</li>
|
||||
<else />
|
||||
<li data-type="{{$v.type}}">
|
||||
<a href="{{$v.url}}">{{$v.name}}</a>
|
||||
</li>
|
||||
</if>
|
||||
</foreach>
|
||||
</ul>
|
||||
<div class="am-fr m-r-10">
|
||||
<a href="">
|
||||
<i class="am-icon-repeat c-p submit-repeat" data-am-popover="{content: '{{:L('common_operation_refresh')}}', trigger: 'hover focus'}"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<!-- nav end -->
|
@ -1,151 +0,0 @@
|
||||
<include file="Public/Header" />
|
||||
|
||||
<!-- header nav start -->
|
||||
<include file="Public/HeaderNav" />
|
||||
<!-- header nav end -->
|
||||
|
||||
<div class="am-cf user-main" <if condition="!empty($max_width_style)">style="{{$max_width_style}}"</if>>
|
||||
<!-- user menu start -->
|
||||
<include file="Public/UserMenu" />
|
||||
<!-- user menu end -->
|
||||
|
||||
<!-- content start -->
|
||||
<div class="user-content">
|
||||
<div class="user-content-body p-10">
|
||||
<!-- operation start -->
|
||||
<div class="am-g ">
|
||||
<a href="{{:U('Home/Student/PolyInfo')}}" class="am-btn am-btn-secondary am-radius am-btn-xs am-icon-plus"> {{:L('student_operation_binding_text')}}</a>
|
||||
</div>
|
||||
<!-- operation end -->
|
||||
|
||||
<if condition="!empty($list)">
|
||||
<section data-am-widget="accordion" class="am-accordion am-accordion-default student-accordion" data-am-accordion='{ "multiple": true }'>
|
||||
<foreach name="list" item="v">
|
||||
<dl class="am-accordion-item am-active">
|
||||
<dt class="am-accordion-title">{{$v.name}}</dt>
|
||||
<dd class="am-accordion-bd am-collapse am-in">
|
||||
<!-- list start -->
|
||||
<table class="am-table am-table-striped am-table-hover am-text-middle m-b-0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{:L('student_username_name')}}</th>
|
||||
<th class="am-hide-sm-only">{{:L('common_view_student_number_text')}}</th>
|
||||
<th>{{:L('common_view_gender_name')}}</th>
|
||||
<th class="am-hide-sm-only">{{:L('student_class_text')}}</th>
|
||||
<th class="am-hide-sm-only">{{:L('common_view_student_state_name')}}</th>
|
||||
<th>{{:L('common_more_name')}}</th>
|
||||
<th>{{:L('common_operation_name')}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<if condition="!empty($v.item)">
|
||||
<foreach name="v.item" item="vs">
|
||||
<tr id="data-list-{{$vs.user_student_id}}">
|
||||
<td>{{$vs.username}}</td>
|
||||
<td class="am-hide-sm-only">{{$vs.number}}</td>
|
||||
<td>{{$vs.gender}}</td>
|
||||
<td class="am-hide-sm-only">{{$vs.class_name}}</td>
|
||||
<td class="am-hide-sm-only">{{$vs.state}}</td>
|
||||
<td>
|
||||
<span class="am-icon-caret-down c-p" data-am-modal="{target: '#my-popup{{$vs.user_student_id}}'}"> {{:L('common_see_more_name')}}</span>
|
||||
<div class="am-popup am-radius" id="my-popup{{$vs.user_student_id}}">
|
||||
<div class="am-popup-inner">
|
||||
<div class="am-popup-hd">
|
||||
<h4 class="am-popup-title">{{:L('common_detail_content')}}</h4>
|
||||
<span data-am-modal-close class="am-close">×</span>
|
||||
</div>
|
||||
<div class="am-popup-bd">
|
||||
<dl class="dl-content">
|
||||
<dt>{{:L('student_username_name')}}</dt>
|
||||
<dd>{{$vs.username}}</dd>
|
||||
|
||||
<dt>{{:L('common_view_student_number_text')}}</dt>
|
||||
<dd>{{$vs.number}}</dd>
|
||||
|
||||
<dt>{{:L('common_view_id_card_text')}}</dt>
|
||||
<dd>{{$vs.id_card}}</dd>
|
||||
|
||||
<dt>{{:L('common_address_text')}}</dt>
|
||||
<dd>{{$vs.region_name}} {{$vs.address}}</dd>
|
||||
|
||||
<dt>{{:L('common_view_gender_name')}}</dt>
|
||||
<dd>{{$vs.gender}}</dd>
|
||||
|
||||
<dt>{{:L('student_birthday_text')}}</dt>
|
||||
<dd>{{$vs.birthday}}</dd>
|
||||
|
||||
<dt>{{:L('common_view_tel_name')}}</dt>
|
||||
<dd>{{$vs.tel}}</dd>
|
||||
|
||||
<dt>{{:L('student_my_mobile_name')}}</dt>
|
||||
<dd>{{$vs.my_mobile}}</dd>
|
||||
|
||||
<dt>{{:L('common_view_parent_mobile_name')}}</dt>
|
||||
<dd>{{$vs.parent_mobile}}</dd>
|
||||
|
||||
<dt>{{:L('common_email_name')}}</dt>
|
||||
<dd>{{$vs.email}}</dd>
|
||||
|
||||
<dt>{{:L('student_class_text')}}</dt>
|
||||
<dd>{{$vs.class_name}}</dd>
|
||||
|
||||
<dt>{{:L('student_semester_text')}}</dt>
|
||||
<dd>{{$vs.semester_text}}</dd>
|
||||
|
||||
<dt>{{:L('student_tuition_state_text')}}</dt>
|
||||
<dd>{{$vs.tuition_state_text}}</dd>
|
||||
|
||||
<dt>{{:L('common_view_student_state_name')}}</dt>
|
||||
<dd>{{$vs.state}}</dd>
|
||||
|
||||
<dt>{{:L('student_sign_up_name')}}</dt>
|
||||
<dd>{{$vs.add_time}}</dd>
|
||||
|
||||
<dt>{{:L('common_upd_time_name')}}</dt>
|
||||
<dd>{{$vs.upd_time}}</dd>
|
||||
|
||||
<dt>{{:L('common_bundled_time_name')}}</dt>
|
||||
<dd>{{$vs.bundled_time}}</dd>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="view-operation">
|
||||
<a href="{{:U('Home/Student/ScoreInfo', array('id'=>$vs['user_student_id']))}}">
|
||||
<button class="am-btn am-btn-default am-btn-xs am-radius am-icon-mortar-board" data-am-popover="{content: '{{:L('student_score_text')}}', trigger: 'hover focus'}"></button>
|
||||
</a>
|
||||
<button class="am-btn am-btn-default am-btn-xs am-radius am-icon-cut submit-delete" data-url="{{:U('Home/Student/Delete')}}" data-am-popover="{content: '{{:L('common_operation_cut')}}', trigger: 'hover focus'}" data-id="{{$vs.user_student_id}}"></button>
|
||||
</td>
|
||||
</tr>
|
||||
</foreach>
|
||||
<else />
|
||||
<tr><td colspan="10" class="table-no">{{:L('common_not_data_tips')}}</td></tr>
|
||||
</if>
|
||||
</tbody>
|
||||
</table>
|
||||
<!-- list end -->
|
||||
</dd>
|
||||
</dl>
|
||||
</foreach>
|
||||
</section>
|
||||
<else />
|
||||
<include file="Public/NoData" />
|
||||
</if>
|
||||
<!-- page start -->
|
||||
<if condition="!empty($list)">
|
||||
{{$page_html}}
|
||||
</if>
|
||||
<!-- page end -->
|
||||
</div>
|
||||
</div>
|
||||
<!-- content end -->
|
||||
</div>
|
||||
|
||||
<!-- layuot common module start -->
|
||||
<include file="Public/CommonModule" />
|
||||
<!-- layuot common module end -->
|
||||
|
||||
<!-- footer start -->
|
||||
<include file="Public/Footer" />
|
||||
<!-- footer end -->
|
@ -1,148 +0,0 @@
|
||||
<include file="Public/Header" />
|
||||
|
||||
<!-- header nav start -->
|
||||
<include file="Public/HeaderNav" />
|
||||
<!-- header nav end -->
|
||||
|
||||
<div class="am-cf user-main" <if condition="!empty($max_width_style)">style="{{$max_width_style}}"</if>>
|
||||
<!-- user menu start -->
|
||||
<include file="Public/UserMenu" />
|
||||
<!-- user menu end -->
|
||||
|
||||
<!-- content start -->
|
||||
<div class="user-content">
|
||||
<div class="user-content-body p-10">
|
||||
<!-- form start -->
|
||||
<form class="am-form form-validation view-save" action="{{:U('Home/Student/PolyQuery')}}" method="POST" request-type="ajax-fun" request-value="StudentPolyWin">
|
||||
<legend>
|
||||
<span class="fs-16">{{:L('student_operation_binding_text')}}</span>
|
||||
<a href="{{:U('Home/Student/Index')}}" class="fr fs-14 m-t-5 am-icon-mail-reply"> {{:L('common_operation_back')}}</a>
|
||||
</legend>
|
||||
<div class="am-form-group">
|
||||
<label>{{:L('student_username_text')}}</label>
|
||||
<input type="text" name="username" placeholder="{{:L('student_username_text')}}" minlength="2" maxlength="16" data-validation-message="{{:L('student_username_format')}}" class="am-radius" required />
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label>{{:L('common_view_student_number_text')}}</label>
|
||||
<input type="text" name="student_number" placeholder="{{:L('common_view_student_number_text')}}" data-validation-message="{{:L('student_student_number_format')}}" class="am-radius" required />
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label>{{:L('common_view_id_card_text')}}</label>
|
||||
<input type="text" name="id_card" placeholder="{{:L('common_view_id_card_text')}}" pattern="{{:L('common_regex_id_card')}}" data-validation-message="{{:L('common_view_id_card_format')}}" class="am-radius" required />
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<button type="submit" class="am-btn am-btn-primary am-radius btn-loading-example am-btn-sm w100" data-am-loading="{loadingText:'{{:L('common_form_loading_tips')}}'}">{{:L('common_operation_query')}}</button>
|
||||
</div>
|
||||
</form>
|
||||
<!-- form end -->
|
||||
|
||||
<!-- win start -->
|
||||
<div class="am-popup am-radius" id="student-poly-win">
|
||||
<div class="am-popup-inner">
|
||||
<div class="am-popup-hd">
|
||||
<h4 class="am-popup-title">{{:L('student_operation_binding_text')}}</h4>
|
||||
<span data-am-modal-close class="am-close">×</span>
|
||||
</div>
|
||||
<div class="am-popup-bd">
|
||||
<form class="am-form form-validation-win" action="{{:U('Home/Student/Poly')}}" method="POST" request-type="ajax-url" request-value="{{:U('Home/Student/Index')}}">
|
||||
<div class="am-form-group">
|
||||
<label>{{:L('student_username_text')}}</label>
|
||||
<input type="text" name="username" placeholder="{{:L('student_username_text')}}" class="am-radius" disabled required />
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label>{{:L('common_view_student_number_text')}}</label>
|
||||
<input type="text" name="student_number" placeholder="{{:L('common_view_student_number_text')}}" class="am-radius" disabled required />
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label>{{:L('common_view_id_card_text')}}</label>
|
||||
<input type="text" name="id_card" placeholder="{{:L('common_view_id_card_text')}}" class="am-radius" disabled required />
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label>{{:L('student_accounts_text')}}</label>
|
||||
<select name="accounts"></select>
|
||||
</div>
|
||||
<label>{{:L('common_verify_text')}}</label>
|
||||
<div class="am-input-group am-input-group-sm am-form-group">
|
||||
<input type="number" name="verify" class="am-radius" placeholder="{{:L('common_verify_text')}}" minlength="6" maxlength="6" data-validation-message="{{:L('common_verify_tips')}}" required />
|
||||
<span class="am-input-group-btn">
|
||||
<button class="am-btn am-btn-default am-radius btn-loading-example verify-submit" type="button" data-am-loading="{spinner:'circle-o-notch', loadingText:'{{:L('common_send_tips')}}'}" data-url="{{:U('Home/Student/PolyVerifySend')}}" data-verify="{{:MyC('home_img_verify_state')}}" data-text="{{:L('common_get_verify_text')}}" data-send-text="{{:L('common_send_time_tips')}}" data-time="{{:MyC('common_verify_time_interval', 30, true)}}">{{:L('common_get_verify_text')}}</button>
|
||||
</span>
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<input type="hidden" name="id" value="" />
|
||||
<button type="submit" class="am-btn am-btn-primary am-radius btn-loading-example am-btn-sm w100" data-am-loading="{loadingText:'{{:L('common_form_loading_tips')}}'}">{{:L('common_operation_confirm')}}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- win end -->
|
||||
|
||||
<!-- verify win start -->
|
||||
<div class="am-modal am-modal-no-btn" tabindex="-1" id="verify-win">
|
||||
<div class="am-modal-dialog am-radius">
|
||||
<div class="am-modal-hd">
|
||||
<a href="javascript:;" class="am-close am-close-spin" data-am-modal-close>×</a>
|
||||
</div>
|
||||
<div class="am-modal-bd o-h">
|
||||
<div class="o-h m-t-15">
|
||||
<input type="text" placeholder="{{:L('common_img_verify_text')}}" maxlength="6" id="verify-img-value" data-validation-message="{{:L('common_img_verify_tips')}}" class="am-form-field am-radius" />
|
||||
<div class="fl">
|
||||
<img src="{{:U('Home/Student/PolyVerifyEntry')}}" class="am-radius c-p" id="verify-img" onClick='this.src="{{:U('Home/Student/PolyVerifyEntry')}}"' />
|
||||
<a href="javascript:;" class="fs-12 c-p" onClick="document.getElementById('verify-img').src='{{:U('Home/Student/PolyVerifyEntry')}}'">{{:L('common_img_verify_submit_text')}}</a>
|
||||
</div>
|
||||
</div>
|
||||
<button type="button" class="am-btn am-btn-secondary am-radius am-btn-sm block m-t-20 btn-loading-example verify-submit-win" data-am-loading="{spinner:'circle-o-notch', loadingText:'{{:L('common_send_tips')}}'}" data-win="1">{{:L('common_operation_confirm')}}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- verify win end -->
|
||||
</div>
|
||||
</div>
|
||||
<!-- content end -->
|
||||
</div>
|
||||
|
||||
<!-- layuot common module start -->
|
||||
<include file="Public/CommonModule" />
|
||||
<!-- layuot common module end -->
|
||||
|
||||
<!-- footer start -->
|
||||
<include file="Public/Footer" />
|
||||
<!-- footer end -->
|
||||
|
||||
<script>
|
||||
/**
|
||||
* [StudentPolyWin 学生关联数据查询回调方法(公共表单方法校验需要放在这里,不能校验其它文件的方法)]
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2017-02-11T21:46:50+0800
|
||||
* @param {[object]} result [回调数据]
|
||||
*/
|
||||
function StudentPolyWin(result)
|
||||
{
|
||||
if(result.code == 0)
|
||||
{
|
||||
var $form = $('.form-validation');
|
||||
var $form_win = $('.form-validation-win');
|
||||
$form_win.find('input[name="username"]').val($form.find('input[name="username"]').val());
|
||||
$form_win.find('input[name="student_number"]').val($form.find('input[name="student_number"]').val());
|
||||
$form_win.find('input[name="id_card"]').val($form.find('input[name="id_card"]').val());
|
||||
$form_win.find('input[name="id"]').val(result.data.id);
|
||||
if(result.data.contact_list.length > 0)
|
||||
{
|
||||
var html = '';
|
||||
for(var i in result.data.contact_list)
|
||||
{
|
||||
html += '<option value="'+result.data.contact_list[i]+'">'+result.data.contact_list[i]+'</option>';
|
||||
}
|
||||
$form_win.find('select[name="accounts"]').html(html);
|
||||
}
|
||||
$('#student-poly-win').modal('open');
|
||||
} else {
|
||||
Prompt(result.msg);
|
||||
}
|
||||
$.AMUI.progress.done();
|
||||
$('.form-validation').find('button[type="submit"]').button('reset');
|
||||
}
|
||||
</script>
|
@ -1,62 +0,0 @@
|
||||
<include file="Public/Header" />
|
||||
|
||||
<!-- header nav start -->
|
||||
<include file="Public/HeaderNav" />
|
||||
<!-- header nav end -->
|
||||
|
||||
<div class="am-cf user-main" <if condition="!empty($max_width_style)">style="{{$max_width_style}}"</if>>
|
||||
<!-- user menu start -->
|
||||
<include file="Public/UserMenu" />
|
||||
<!-- user menu end -->
|
||||
|
||||
<!-- content start -->
|
||||
<div class="user-content">
|
||||
<div class="user-content-body p-10">
|
||||
<legend>
|
||||
<span class="fs-16">{{:L('student_operation_score')}}</span>
|
||||
<a href="{{:U('Home/Student/Index')}}" class="fr fs-14 m-t-5 am-icon-mail-reply"> {{:L('common_operation_back')}}</a>
|
||||
</legend>
|
||||
|
||||
<!-- table start -->
|
||||
<if condition="!empty($data)">
|
||||
<table class="am-table am-table-bordered am-table-centered am-radius score-table">
|
||||
<tr>
|
||||
<th>{{$data.username}}</th>
|
||||
<foreach name="student_score_title_list" item="title">
|
||||
<th rowspan="2" class="am-text-middle">{{$title}}</th>
|
||||
</foreach>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="class-name">{{$data.class_name}}</th>
|
||||
</tr>
|
||||
<foreach name="data.item" item="v">
|
||||
<foreach name="v.item" key="k" item="vs">
|
||||
<tr>
|
||||
<if condition="$k eq 0">
|
||||
<td rowspan="{{:count($v['item'])}}" class="am-text-middle">{{$v.name}}</td>
|
||||
</if>
|
||||
<td>{{$vs.subject_name}}</td>
|
||||
<td>{{$vs.score}}</td>
|
||||
<td>{{$vs.score_level}}</td>
|
||||
<td>{{$vs.add_time}}</td>
|
||||
<td>{{$vs.comment}}</td>
|
||||
</tr>
|
||||
</foreach>
|
||||
</foreach>
|
||||
</table>
|
||||
<else />
|
||||
<include file="Public/NoData" />
|
||||
</if>
|
||||
<!-- table end -->
|
||||
</div>
|
||||
</div>
|
||||
<!-- content end -->
|
||||
</div>
|
||||
|
||||
<!-- layuot common module start -->
|
||||
<include file="Public/CommonModule" />
|
||||
<!-- layuot common module end -->
|
||||
|
||||
<!-- footer start -->
|
||||
<include file="Public/Footer" />
|
||||
<!-- footer end -->
|
@ -353,7 +353,7 @@ text-align: center;float:none}
|
||||
.member-login{overflow: hidden;height:25px;text-align: center;}
|
||||
.member-logout { position: absolute; top: 33px; left: 60px; font-size: 12px; color: #f4546b; }
|
||||
.member-center { overflow: hidden; }
|
||||
.member-center a {float: left;margin-left: -1px;width:50px;text-align: center;border-left: 1px solid #EEE;font-size: 12px; }
|
||||
.member-center a {float: left;margin-left: -1px;width:50px;text-align: center;border-left: 1px solid #EEE;font-size: 12px; text-decoration: none; }
|
||||
.member-center a strong {height: 18px;display: block;font-size: 14px;color: #F40;}
|
||||
|
||||
/*第二套各类活动*/
|
||||
|
@ -121,8 +121,8 @@ $(function()
|
||||
{
|
||||
if($(window).width() > 625)
|
||||
{
|
||||
// 防止导航浮动
|
||||
$('.nav-search').css('position','relative');
|
||||
$('body').css('padding-top','0');
|
||||
}
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user