123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503 |
- <link type="text/css" rel="stylesheet" href="/css/needDetail.css" />
- <link type="text/css" rel="stylesheet" href="/js/select/select2.min.css" />
- <style>
- .addborder{border:1px solid #ccc}
- .addheight{height:30px;border-radius:2px;}
- .addheight:focus{border-color: #66afe9;box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075) inset, 0 0 8px rgba(102, 175, 233, 0.6);outline: 0 none;}
- .ace{position:relative;top:0px !important;left:0px !important;}
- label{font-weight:100 !important;}
- /* #coach_id-error{position: absolute;right:-80px;top:5px;}
- #level_name-error{position: absolute;right:-80px;top:5px;}
- #material_id-error{position: absolute;right:-110px;top:5px;}
- #class_name-error{margin: 6px 0px 0px 18px;font-size:13px;} */
- .clearfix:after {
- content: "";
- display: block;
- visibility: hidden;
- height: 0;
- clear: both;
- }
- .clearfix {
- zoom: 1;
- }
- .fl {
- float: left;
- }
- .fr {
- float: right;
- }
- em{
- color: #FF000C;
- margin-right: 4px;
- }
- .bm-name{
- width: 100px;
- text-align: right;
- // border: 1px solid #000;
- }
- .bm-inp-con{
- width: 170px;
- }
- .basic-message select{
- width: 160px;
- height: 26px;
- }
- .basic-message input{
- width: 156px;
- height: 22px;
- }
- .basic-message{
- padding: 10px 0;
- }
- .th-describe{
- margin-top: 10px;
- }
- .th-describe span{
- color: #FF000C;
- }
- table{
- width: 800px;
- border-color: #fff;
- text-align: center;
- font-size: 14px;
- margin-top: 10px;
- }
- thead{
- background: #F2F2F2;
- }
- .serial{
- width: 80px;
- }
- .operation{
- width: 100px;
- }
- .subject,.teacher,.remarks{
- width: 180px;
- }
- .teacher{
- }
- .remarks{
- }
- td{
- height: 40px;
- }
- table input,table select{
- width: 80%;
- height: 86%;
- text-indent: 10px;
- }
- .opration-con{
- font-size: 23px;
- font-weight: bold;
- }
- .opration-con > span{
- color: #2977ff;
- cursor: pointer;
- }
- .types-con{
- margin-top: 25px;
- }
- .getscore-type{
- margin-left: 60px;
- }
- .types-con input {
- margin-left: 10px;
- cursor: pointer;
- }
- .submit{
- width: 100px;
- height: 30px;
- background: #01B677;
- color: #fff;
- border: none;
- margin-top: 50px;
- }
- .title_msg{
- padding-top:30px;
- padding-left:20px
- }
- </style>
- <div class="main-content-inner">
- <!-- 导航栏开始-->
- <?php include(Yii::app()->basePath.'/views/layouts/class_navigation.php');?>
- <!-- 导航栏结束-->
- <!--新版增加班级-->
- <div class="page-content" style="margin-top:15px;">
- <div class="row" style="margin:0px">
- <div class="col-xs-12 fontSize1">
- <!-- PAGE CONTENT BEGINS -->
- <section class="anc-top flex status_1" >
- <div class="flex-one flex">
- <p class="anc-title">教学班</p>
- <p class="title_msg">当前学年:<?php echo $thisSemester["school_year"];?>学年 当前学期:<?php echo $thisSemester["semester_name"];?></p>
- </div>
- </section>
- <form class="form-horizontal" action="<?php echo $this->createUrl('classes/addClass');?>" method="post" id="classAdd">
- <div class="col-xs-12 col-sm-12">
- <div class="form-group col-xs-12 col-sm-4">
- <label class="control-label col-xs-12 col-sm-3 no-padding-right">班级名称<span class="errorMessage">*</span>:</label>
- <div class="col-sm-9 mtCentent">
- <input type="text" id="class_name" name="class_name" class="col-xs-10 col-sm-4 addborder addheight marginLeftNo" />
- </div>
- </div>
- <div class="form-group col-xs-12 col-sm-4">
- <label class="control-label col-xs-12 col-sm-3 no-padding-right">年级<span class="errorMessage">*</span>:</label>
- <div class="col-sm-9">
- <select id="grade" name="grade">
- <option value="1">高一</option>
- <option value="2">高二</option>
- <option value="3">高三</option>
- </select>
- </div>
- </div>
- <div class="form-group col-xs-12 col-sm-4">
- <label class="control-label col-xs-12 col-sm-3 no-padding-right">层级:</label>
- <div class="col-xs-12 col-sm-9">
- <div class="clearfix">
- <select class="input-medium" id="level_name" name="level_name">
- <option value="">请选择</option>
- <?php if($classLevels):foreach($classLevels as $classLevel):?>
- <option value="<?php echo $classLevel[0];?>"><?php echo $classLevel[0];?>层</option>
- <?php endforeach;endif;?>
- </select>
- </div>
- </div>
- <input type="hidden" name="class_array" id="class_array">
- </div>
- </div>
- <p class="th-describe"><em>*</em>执教老师:(<span>点击"+"添加列,点击"-"删除列</span>) <span class=" add" style="color:#2977ff;font-size: 23px;font-weight: bold">+</span></p>
- <table id="teacher_list" class="" cellpadding="0" cellspacing="0" border="1">
- <thead>
- <td class="serial">序号</td>
- <td class="operation">操作</td>
- <td class="subject">学科组</td>
- <td class="teacher">老师(岗位)</td>
- </thead>
- </table>
- <div class="clearfix form-actions mt15">
- <div class="col-md-offset-3 col-md-9">
- <button class="btn btn-success btn-sm" type="submit" id="schoolSubmit">
- <i class="ace-icon fa fa-check bigger-110"></i> 提交
- </button>
- <!--
- <button class="btn" type="reset">
- <i class="ace-icon fa fa-undo bigger-110"></i>
- 重填
- </button>-->
- </div>
- </div>
- </form>
- <!-- PAGE CONTENT ENDS -->
- </div>
- </div>
- </div>
- <!--新版添加班级结束-->
- </div>
- <style>
- .model-score input{padding-left: 5px; height: 30px;width: 230px;border:1px solid #ccc;outline: none;}
- .model-score input:focus{border-color: #50d2c2;box-shadow: 0 0 5px #50d2c2;}
- .modal-btn{text-align: center;margin:10px 0;}
- .modal-btn a{display: inline-block;margin:0 5px; width: 100px; line-height: 40px;background: #50d2c2;color: #fff;}
- .modal-content{position: absolute;left: 50%;top: 50%;padding-top: 40px; width: 500px;background: #fff; transform: translate(-50%,-50%);}
- .modal-title{position: absolute;top: 0;left: 0;padding-left: 20px; width: 100%;height: 40px;line-height: 40px;background: #009965;color:#fff;}
- .modal-title em{width: 40px;height: 40px;text-align: center;font-size: 20px;cursor: pointer;}
- .model-score1 input{padding-left: 5px; height: 30px;width: 230px;border:1px solid #ccc;outline: none;}
- .model-score1 input:focus{border-color: #50d2c2;box-shadow: 0 0 5px #50d2c2;}
- .modal-btn{text-align: center;margin:10px 0;}
- .modal-btn a{display: inline-block;margin:0 5px; width: 100px; line-height: 40px;background: #50d2c2;color: #fff;}
- .model-score2 input{padding-left: 5px; height: 30px;width: 230px;border:1px solid #ccc;outline: none;}
- .model-score2 input:focus{border-color: #50d2c2;box-shadow: 0 0 5px #50d2c2;}
- .modal-btn{text-align: center;margin:10px 0;}
- .modal-btn a{display: inline-block;margin:0 5px; width: 100px; line-height: 40px;background: #009965;color: #fff;}
- .modal-btn .close3{display: inline-block;margin:0 5px; width: 100px; line-height: 40px;background: #fff;color: #000;border:1px solid #555;border-radius: 3px;}
- .modal1_multi{position: fixed;top: 0;left: 0;width: 100%;height: 100%;font-size:14px;display:none ;background: rgba(0,0,0,.4)}
- .model-rule{width:80%;margin:15px auto;text-align: center;font-size:18px;}
- .modal1_multi .model-score1{width:80%;margin:10px auto;text-align: left}
- .modal1_multi .model-score-m{width:80%;margin:5px auto;}
- .modal1_multi .model-score-m label{margin:5px 0;font-size: 12px;color:red;font-weight: initial}
- .modal1_multi em{color:#fff;}
- </style>
- <!-- 重置提示框 -->
- <div class="modal1_multi">
- <div class="modal-shadow"></div>
- <div class="modal-content">
- <div class="modal-title clearfix">
- 提示<em class="fr close3">×</em>
- </div>
- <div class="model-rule">
- </div>
- <div class="model-score-m">
- </div>
- <div class="modal-btn">
- <a href="javascript:;" class="sumbit3">取消隐藏</a>
- <a href="javascript:;" class="close3 chameleon">关闭</a>
- <input type="hidden" name="hideClassId" value="0">
- </div>
- </div>
- </div>
- <script src="/js/jquery.validate.min.js"></script>
- <script src="/js/birthday.js" type="text/javascript" charset="utf-8"></script>
- <script src="/js/xsgl.js"></script>
- <script src="/js/select/select2.min.js"></script>
- <script>
- $(document).ready(function(){
- var subjectIds = [];
- $('#grade').change(function(){
- var grade=$(this).val();
- getClass(grade);
- });
- $('#grade').val(1);
- getClass(1);
- function getClass(grade){
- $('.subject_teacher').remove();
- $.ajax({
- url:'<?php echo $this->createUrl('classes/getClassSubjectByGrade')?>',
- type:'POST',
- dataType:'json',
- data:{grade:grade},
- success:function(res){
- if(res.status==1){
- subjectIds=res.data;
- }
- }
- })
- }
- selectCount=1;
- $(document).on("click",".add",function () {
- if(subjectIds.length==0){
- layer.msg('请设置走班学科');
- return false;
- }
- var index=$('.subject_teacher').length;
- var data = {'grade':$('#grade').val()};
- var obj = $(this);
- selectCount++;
- var selectClass='projSelect'+selectCount;
- var str = '';
- str += '<tr class="subject_teacher"><td>'+(index+1)+'</td>';
- str+='<td class="opration-con"><span class="add">+</span> <span class="redus">-</span></td>'
- str+='<td><select name="subject_ids[]" id="subject_ids" class="subject_ids"><option value="0">选择学科</option>'
- $.each(subjectIds,function(index,val){
- str += '<option value="'+index+'">'+val+'</option>';
- });
- str += '</select></td>';
- str += '<td><select name="teacher_ids[]" id="teacher_ids" class="teacher_ids '+selectClass+'">';
- str += '<select></td></tr>';
- //$.post("<?php //echo Yii::app()->createUrl('classes/getAllTeachers')?>//",data,function(flags){
- // var m = JSON.parse(flags);
- // if(m.status==0)
- // {
- // alert('没有教师');
- // }else
- // {
- // str += '<td><select name="teacher_ids[]" id="teacher_ids" class="teacher_ids">';
- // $.each(m.result,function(index,val){
- // str += '<option value="'+index+'">'+val+'</option>';
- // });
- // str += '<select></td></tr>';
- // $('#teacher_list').append(str);
- //
- // }
- //});
- $('#teacher_list').append(str);
- });
- $(document).on("click",".redus",function () {
- var index = $(this).parent().parent().index();
- for (var i=index+1;i<$('tbody tr').length;i++) {
- var tNum = parseInt($('tbody tr').eq(i).find('td').eq(0).text())-1;
- $('tbody tr').eq(i).find('td').eq(0).text(tNum);
- }
- if ($('tbody tr').length>1) {
- $(this).parent().parent().remove();
- } else{
- alert("最后一行不能删除了哦");
- }
- });
- $('body').on("change",".subject_ids",function(){
- var data= {
- 'subject_id': $(this).val(),
- 'grade': $('#grade').val()
- };
- var str ='';
- var _this = $(this);
- $.post("<?php echo Yii::app()->createUrl('classes/get_subject_teachers')?>",data,function(flags){
- var m = JSON.parse(flags);
- if(m.status==0)
- {
- alert('没有教师');
- }else
- {
- $.each(m.result,function(index,val){
- str += '<option value="'+index+'">'+val+'</option>'
- });
- }
- _this.parent().next().children('select').html(str);
- _this.parent().next().children('select').select2();
- });
- });
- });
- </script>
- <script language="javascript">
- $(function(){
- //加载班主任教师
- $('#main-teacher').bind('input propertychange', function() {
- var obj_list=$(this).parent().find('.name-con');
- var keyword=$(this).val();
- if(keyword==''){
- return false;
- }
- $(this).attr('teacher_id','');
- $('#bzr_id').val(0);
- $.ajax({
- url:'<?php echo $this->createUrl('classes/loadTeacher')?>',
- type:'POST',
- dataType:'json',
- data:{'keyword':keyword},
- 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']+'</li>';
- }
- obj_list.html(html);
- obj_list.show();
- }
- }
- }
- });
- });
- $('.mtCentent').on('click','.name-list',function(){
- $(this).closest('.mtCentent').find('#main-teacher').val($(this).html());
- $(this).closest('.mtCentent').find('#main-teacher').attr('teacher_id',$(this).attr('id'));
- $(this).closest('.mtCentent').find('#main-teacher').attr('title',$(this).html());
- $('#bzr_id').val($(this).attr('id'));
- $(this).closest('.mtCentent').find('.name-con').hide();
- })
- //提交保存
- $('#schoolSubmit').click(function(){
- var className=$('input[name=class_name]').val();
- if(className==''){
- layer.msg('请输入班级名称');
- return false;
- }
- if(className.length>10){
- layer.msg('班级名称不能超过10个字符');
- return false;
- }
- //校验是否有隐藏同名班级
- $.ajax({
- url:'<?php echo $this->createUrl('classes/checkClassNameOnSameSemester')?>',
- type:'POST',
- dataType:'json',
- data:{class_name:className},
- success:function(res){
- if(res.status==1){
- $('.model-rule').html('班级名称与学校已隐藏班级“'+className+'”重复,若要恢复班级,请点击“取消隐藏”');
- $('.modal1_multi').show();
- $('input[name=hideClassId]').val(res.data);
- return false;
- }else{
- var teacher_ids=$('#teacher_ids');
- if(teacher_ids.length==0){
- layer.msg('请选择执教教师');
- return false;
- }
- $('.form-horizontal').submit();
- return true;
- }
- }
- });
- return false;
- });
- $('.close3').click(function(){
- $('.modal1_multi').hide();
- });
- $('.sumbit3').click(function(){
- var classId=$('input[name=hideClassId]').val();
- if(classId==0 || classId==undefined || classId==''){
- alert('参数错误');
- }
- $.ajax({
- url:'<?php echo $this->createUrl('classes/recoverClass')?>',
- type:'POST',
- dataType:'json',
- data:{classId:classId},
- success:function(res){
- if(res.status==1){
- layer.msg('班级已成功恢复',{
- icon: 1
- }, function(){
- window.location.href='<?php echo $this->createUrl('classes/index')?>';
- });
- }else{
- layer.msg('操作失败')
- }
- }
- });
- });
- })
- </script>
|