123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575 |
- <link rel="stylesheet" href="/fonts/zhuanzhang/iconfont.css" />
- <link rel="stylesheet" href="/css/toTransferPop.css" />
- <style>
- /*弹出层*/
- .confirmbox-mask {
- background: rgba(0, 0, 0, .7);
- left: 0;
- right: 0;
- top: 0;
- bottom: 0;
- z-index: 99;
- position: fixed;
- }
- .confirmbox-mask button {
- border: none;
- background: #2977ff;
- width: 80px;
- height: 26px;
- border-radius: 3px;
- font-size: 14px;
- color: #fff;
- outline: none;
- cursor: pointer;
- }
- .confirmbox-mask button.save {
- display: block;
- margin: 40px auto;
- }
- .confirmbox .confirmbox-btns {
- margin-top: 40px;
- }
- .class-modal {
- width: 700px;
- background: #fff;
- // border-radius: 5px;
- position: absolute;
- top: 50%;
- left: 50%;
- transform: translate(-50%, -50%);
- height:420px;
- }
- .class-modal-head {
- font-size: 14px;
- background:#2977ff;
- color:#fff;
- height:25px;
- line-height: 25px;
- padding: 0 0 0 15px;
- }
- .class-modal-body {
- margin-top: 5px;
- overflow: auto;
- padding:15px;
- min-height: 340px;
- }
- .class-modal-body .classes {
- margin-bottom: 20px;
- }
- .class-modal-body .classes > div {
- display: inline-block;
- max-width: 640px;
- vertical-align: top;
- }
- .class-modal-body .classes a {
- text-decoration: none;
- display: inline-block;
- margin: 0 5px 5px;
- color: #136bfb;
- font-size: 14px;
- }
- .class-modal-body .classes a.active {
- color: #fc091b;
- }
- .class-modal .icon-close{
- position: absolute;
- right: 20px;
- top: 2px;
- color:#fff;
- }
- .c-red {
- color: #CC3300
- }
- .avg{
- margin:0 10px;
- }
- .class_btn{
- text-align: center;
- }
- .confirmbox-mask p{
- word-wrap : break-word ;
- }
- .icon-close{
- cursor: pointer;
- }
- .model-input{
- border:1px solid #ccc;
- padding:5px;
- margin-top:10px;
- }
- .model-input label{
- margin:0 15px;
- }
- table{margin-top:5px;}
- .table_list{
- height:250px;
- overflow: auto;
- }
- .upload-box{
- position:relative;
- padding-left:106px;
- line-height: 28px;
- }
- .upload-div,.upload-ipt{
- position: absolute;
- left:0;
- top:0;
- width:100px!important;
- }
- .upload-div{
- height:28px;
- text-align: center;
- background: #eee;
- color: #333;
- border-radius: 3px;
- border:1px solid #ccc;
- }
- .upload-div:hover{
- background: #69d9a7;
- }
- .upload-ipt{
- z-index: 2;
- opacity: 0;
- }
- .bind_code_log{float: right;color:#69d9a7;cursor: pointer}
- </style>
- <div class="main-content-inner">
- <!-- 导航栏开始-->
- <?php include(Yii::app()->basePath.'/views/layouts/class_navigation.php');?>
- <!-- 导航栏结束-->
- <div class="page-content">
- <div class="row" style="margin:0px;">
- <div class="col-xs-12">
- <!-- PAGE CONTENT BEGINS -->
- <div class="class-detail-con">
- <img src="/images/u116.png" alt="" class="edit-class">
- <div class="edit-opts">
- <span class="dib pointer edit-opts-btns edit-cancel-btn">取消</span>
- <span class="dib pointer edit-opts-btns edit-save-btn">保存</span>
- <input type="hidden" name="class_id" value="<?php echo $cid?>">
- </div>
- <div class="class-name black-font"><?php if(isset($class_name)) echo $class_name?></div>
- <form id="teacher_form">
- <div class="class-adviser">
- <span class="gray-font dib cn-left-menu">班主任:</span>
- <input type="text" name="main-teacher" teacher_id="<?php if(isset($class_bzr_id)) echo $class_bzr_id?>" title="<?php if(isset($class_bzr) && $class_bzr) echo $class_bzr ?>" class="black-font dib read-only main-teacher" value="<?php if(isset($class_bzr) && $class_bzr){ echo $class_bzr ;}else{ echo "";} ?>" disabled="true">
- <ul class="name-con">
- </ul>
- </div>
- <div class="class-teachers flex">
- <span class="gray-font dib cn-left-menu">执教老师:</span>
- <div class="flex-one flex flex-wrap">
- <?php
- if($allSubject){
- foreach ($allSubject as $key => $val){
- ?>
- <div class="teacher-list">
- <input type="text" title="<?php if(isset($subject_teacher[$key]) && $subject_teacher[$key]) echo $subject_teacher[$key] ?>" data="<?php echo $key?>" teacher_id="<?php if(isset($subject_tid[$key])) echo $subject_tid[$key] ?>" class="black-font dib teacher-name-msg ellipsis read-only" disabled="true" value="<?php if(isset($subject_teacher[$key])){echo $subject_teacher[$key];}else{echo "";} ?>">
- <p class="gray-font"><?php echo $val?></p>
- <ul class="name-con">
- </ul>
- </div>
- <?php
- }
- }
- ?>
- </div>
- </div>
- </form>
- </div>
- <div class="parent-list">
- <span class="left-blue-border black-font parent-list-title">家长列表</span>
- <span class=" bind_code_log">绑定码日志</span>
- <table class="table table1 table-bordered table-hover dataTable no-footer" border="1">
- <thead>
- <tr>
- <td>序号</td>
- <td>学生姓名</td>
- <td>家长与学生关系</td>
- <td>家长手机号码</td>
- <td>家长绑定时间</td>
- <td>操作</td>
- </tr>
- </thead>
- <?php
- if(isset($students['rs'])){
- $i=1;
- $sid=1;
- $bgcolor=array('#F2F2F2','#FFF');
- foreach ($students['rs'] as $val){
- $rows=1;
- $color=$bgcolor[($i%2)];
- if($val['is_bind']==1 && isset($val['parents'])){
- $rows=count($val['parents']);
- $k=1;
- foreach ($val['parents'] as $v){
- $bindType='无验证监护人';
- if($v['bind_type']==1){
- $bindType='主监护人';
- }elseif($v['bind_type']==2){
- $bindType='副监护人';
- }
- echo '<tr bgcolor="'.$color.'">';
- if($k==1){
- echo '<td rowspan="'.$rows.'">'.$i.'</td>';
- echo '<td rowspan="'.$rows.'" class="realname">'.$val['realname'].'</td>';
- }
- echo '<td class="stype">'.$v['type'].'('.$bindType.')</td>';
- echo '<td class="mobile">'.$v['mobile'].'</td>';
- echo '<td class="time">'.$v['create_time'].'</td>';
- echo '<td><a class="blue-font pointer remove-bind" realname="'.$val['realname'].'" student_id="'.$val['student_id'].'" id="'.$sid.'" data="'.$v['parent_id'].'">解绑</a></td>';
- echo '</tr>';
- $k++;
- $sid++;
- }
- }else {
- ?>
- <tr bgcolor="<?php echo $color ?>">
- <td><?php echo $i ?></td>
- <td class="realname"><?php echo $val['realname'] ?></td>
- <td class="stype"></td>
- <td class="mobile"></td>
- <td class="time"></td>
- <td class="action">
- </td>
- </tr>
- <?php
- }
- $i++;
- }
- }
- ?>
- </table>
- <br>
- <?php if(!empty($page_total)):?>
- <div class="row">
- <div class="col-xs-7">
-
- </div>
- <div class="col-xs-5">
- <div class="dataTables_paginate paging_simple_numbers">
- <?php
- $this->widget('CLinkPager', array(
- 'header' => '',
- 'firstPageLabel'=> '首页',
- 'lastPageLabel' => '末页',
- 'prevPageLabel' => '上一页',
- 'nextPageLabel' => '下一页',
- 'pages' => $pages,
- 'maxButtonCount'=> 5,
- ));
- echo '共:'.$page_total.'条';
- ?>
- </div>
- </div>
- </div>
- <?php endif;?>
- </div>
- <div class="remove-bind-pop">
- <div class="bind-pop-con">
- <div class="bind-msg tac">确定要解绑“李晓玉”的家长?</div>
- <div class="bind-opt tac">
- <span class="dib bind-opt-btns cancel-btn pointer">取消</span>
- <span class="dib bind-opt-btns sure-btn pointer">确定</span>
- <input type="hidden" name="student_name" value="">
- <input type="hidden" name="parent_id" value="">
- <input type="hidden" name="student_id" value="">
- <input type="hidden" name="row_id" value="">
- </div>
- </div>
- </div>
- <!-- PAGE CONTENT ENDS -->
- </div>
- </div>
- </div>
- </div>
- <!--绑定码日志-->
- <div class="confirmbox-mask" style="display: none" id="fieldModal">
- <div class="class-modal">
- <i class="icon close_1 icon-close">×</i>
- <div class="class-modal-head"><?php echo date('Y-m-d').' 绑定日志'?></div>
- <div class="class-modal-body">
- <div class="table_list">
- <table id="dynamic-table" class="table table-striped table-bordered table-hover dataTable no-footer DTTT_selectable">
- </table>
- </div>
- </div>
- </div>
- </div>
- <script src="/js/layer/layer.js"></script>
- <script>
- // 解绑
- $('.remove-bind').click(function(){
- var realname=$(this).attr('realname');
- $('.remove-bind-pop').find('.bind-msg').html('确定要解绑“'+realname+'”的家长?');
- $('.remove-bind-pop').show();
- $('input[name=student_name]').val(realname);
- $('input[name=parent_id]').val($(this).attr('data'));
- $('input[name=student_id]').val($(this).attr('student_id'));
- $('input[name=row_id]').val($(this).attr('id'));
- })
- $('.cancel-btn').click(function(){
- $('.remove-bind-pop').hide()
- })
- //解绑功能
- $('.sure-btn').click(function(){
- $('.remove-bind-pop').hide()
- var parent_id=$('input[name=parent_id]').val();
- var student_id=$('input[name=student_id]').val();
- var row_id=$('input[name=row_id]').val();
- if(parent_id=='' || student_id==''){
- return false;
- }
- var ii=layer.msg('正在解绑,请稍候。。。',{time:0});
- $.ajax({
- url:'<?php echo $this->createUrl('parent/unbind')?>',
- type:'POST',
- dataType:'json',
- data:{'parent_id':parent_id,'student_id':student_id},
- success:function(res){
- layer.close(ii);
- if(res.status==1){
- layer.msg('操作成功');
- $('#'+row_id).closest('tr').find('.mobile').html('');
- $('#'+row_id).closest('tr').find('.time').html('');
- $('#'+row_id).closest('tr').find('.action').html('');
- $('#'+row_id).closest('tr').find('.stype').html('');
- }else{
- layer.msg('操作失败');
- }
- }
- });
- })
- // $('.teacher-name-msg').blur(function(){
- // $(this).attr('title',$(this).val())
- // })
- $('.edit-class').click(function(){
- $(this).hide();
- $('.edit-opts').show();
- $('.main-teacher').removeClass('read-only')
- $('.teacher-name-msg').removeClass('read-only')
- $('.main-teacher').attr('disabled',false)
- $('.teacher-name-msg').attr('disabled',false)
- })
- $('.edit-cancel-btn').click(function(){
- $('.edit-opts').hide();
- $('.edit-class').show()
- $('.main-teacher').addClass('read-only')
- $('.teacher-name-msg').addClass('read-only')
- $('.main-teacher').attr('disabled',true)
- $('.teacher-name-msg').attr('disabled',true)
- $('#teacher_form')[0].reset();
- })
- //保存修改
- $('.edit-save-btn').click(function(){
- var class_id=$('input[name=class_id]').val();
- var main_teacher=0;
- if($('input[name=main-teacher]').val()!='' && $('input[name=main-teacher]').val()!='-'){
- main_teacher=$('input[name=main-teacher]').attr('teacher_id');
- if(main_teacher=='' || main_teacher==undefined){
- layer.msg('班主任不存在或设置不正确');
- $('input[name=main-teacher]').val('-')
- return false;
- }
- }
- var teacher_subject=[];
- //console.log(main_teacher);return false;
- for(var i=0;i<$('.teacher-name-msg').length;i++){
- if($('.teacher-name-msg').eq(i).val()!='' && $('.teacher-name-msg').eq(i).val()!='-'){
- var subject=$('.teacher-name-msg').eq(i).attr('data');
- var teacher_id=$('.teacher-name-msg').eq(i).attr('teacher_id');
- if(teacher_id=='' || teacher_id==undefined){
- layer.msg('教师不存在或设置不正确');
- $('.teacher-name-msg').eq(i).val('-');
- return false;
- }
- teacher_subject[subject]=teacher_id;
- }
- }
- $.ajax({
- url:'<?php echo $this->createUrl('parent/saveClassTeacher')?>',
- type:'POST',
- dataType:'json',
- data:{'cid':class_id,'main_teacher':main_teacher,'teacher_subject':teacher_subject},
- success:function(res){
- if(res.status==0){
- if(res.msg!=undefined){
- layer.msg(res.msg);
- }else{
- layer.msg('保存失败');
- }
- }else{
- layer.msg('保存成功');
- $('.edit-opts').hide();
- $('.edit-class').show();
- $('.main-teacher').removeClass('read-only');
- $('.teacher-name-msg').removeClass('read-only');
- $('.main-teacher').attr('disabled',true);
- $('.teacher-name-msg').attr('disabled',true);
- }
- }
- });
- })
- $('.teacher-name-msg').bind('input propertychange', function() {
- // $(this).parent().find('.name-con').show();
- var obj_list=$(this).parent().find('.name-con');
- var keyword=$(this).val();
- var subject=$(this).attr('data');
- var class_id=$('input[name=class_id]').val();
- if(keyword==''){
- return false;
- }
- $(this).attr('teacher_id','');
- $.ajax({
- url:'<?php echo $this->createUrl('parent/loadTeacher')?>',
- type:'POST',
- dataType:'json',
- data:{'keyword':keyword,'subject':subject,'class_id':class_id},
- success:function(res){
- if(res.status==1){
- var html='';
- if(res.data.length>0){
- for(var i=0;i<res.data.length;i++){
- html+='<li class="name-list" id="'+res.data[i]['teacher_id']+'">'+res.data[i]['teacher_name']+'('+res.data[i]['subject_name']+')</li>';
- }
- obj_list.html(html);
- obj_list.show();
- }
- }
- }
- });
- });
- //加载班主任教师
- $('.main-teacher').bind('input propertychange', function() {
- var obj_list=$(this).parent().find('.name-con');
- var keyword=$(this).val();
- var class_id=$('input[name=class_id]').val();
- if(keyword==''){
- return false;
- }
- $(this).attr('teacher_id','');
- $.ajax({
- url:'<?php echo $this->createUrl('parent/loadTeacher')?>',
- type:'POST',
- dataType:'json',
- data:{'keyword':keyword,'class_id':class_id},
- success:function(res){
- if(res.status==1){
- var html='';
- if(res.data.length>0){
- for(var i=0;i<res.data.length;i++){
- html+='<li class="name-list" id="'+res.data[i]['teacher_id']+'">'+res.data[i]['teacher_name']+'('+res.data[i]['subject_name']+')</li>';
- }
- obj_list.html(html);
- obj_list.show();
- }
- }
- }
- });
- });
- $('.teacher-list').on('click','.name-list',function(){
- $(this).closest('.teacher-list').find('.teacher-name-msg').val($(this).html());
- $(this).closest('.teacher-list').find('.teacher-name-msg').attr('teacher_id',$(this).attr('id'));
- $(this).closest('.teacher-list').find('.teacher-name-msg').attr('title',$(this).html());
- $(this).closest('.teacher-list').find('.name-con').hide();
- })
- /*
- $('.main-teacher').on('blur', function() {
- $(this).parent().find('.name-con').hide();
- });
- $('.teacher-name-msg').on('blur', function() {
- $(this).parent().find('.name-con').hide();
- });
- */
- // 点击空白处下拉列表消失
- $(document).click(function(e){
- var targetNode = $(e.target).closest(".teacher-list");
- if (targetNode.length>0){
- return;
- }else{
- $(".name-con").hide();
- }
- });
- $('.class-adviser').on('click','.name-list',function(){
- $(this).closest('.class-adviser').find('.main-teacher').val($(this).html());
- $(this).closest('.class-adviser').find('.main-teacher').attr('teacher_id',$(this).attr('id'));
- $(this).closest('.class-adviser').find('.main-teacher').attr('title',$(this).html());
- $(this).closest('.class-adviser').find('.name-con').hide();
- })
- $('.bind_code_log').click(function(){
- $.ajax({
- url:'<?php echo $this->createUrl('parent/bindCodeLog')?>',
- type:'POST',
- dataType:'json',
- data:{cid:'<?php echo $cid?>'},
- success:function(res){
- if(res.status==1){
- html='<tr><td>时间</td><td>学生</td><td>手机号</td><td>绑定码</td></tr>';
- if(res.data.length>0){
- for(var i=0;i<res.data.length;i++){
- html+='<tr>';
- html+='<td>'+res.data[i]['time']+'</td>';
- html+='<td>'+res.data[i]['student_name']+'</td>';
- html+='<td>'+res.data[i]['mobile']+'</td>';
- html+='<td>'+res.data[i]['code']+'</td>';
- html+='</tr>';
- }
- }
- console.log(html);
- $('#dynamic-table').html(html);
- $('#fieldModal').show();
- }
- }
- });
- });
- $('.icon-close').click(function(){
- $('#fieldModal').hide();
- });
- </script>
|