123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582 |
- <script type="text/javascript">
- jQuery(document).ready(function(){
- jQuery(".changeSemester").click(function(){
- document.semesterId = jQuery(this).attr("semesterId");
- document.semesterName = jQuery(this).parent().parent().siblings(".semesterName").html();
- $('#examModal').fadeIn();
- });
- $('.close_1').click(function(){
- $('#examModal').fadeOut();
- $('input[name=Graduation]').attr('checked',false);
- });
- $('.sumbit').click(function(){
- var RetainClass=$('input[name=RetainClass]').is(':checked');
- var Graduation=$('input[name=Graduation]').is(':checked');
- var classUp=$('input[name=classUp]').is(':checked');
- var gradeDirector=$('input[name=gradeDirector]:checked').val();
- if(RetainClass==true){
- RetainClass=1;
- }else{
- RetainClass=0
- }
- if(Graduation==true){
- Graduation=1;
- }else{
- Graduation=0
- }
- classNameArr=[];
- if(classUp==true){
- classUp=1;
- //读取班级改名
- classNameObj=$('.new_class_name');
- classNameCheck=[];
- for(var i=0;i<classNameObj.length;i++){
- oldName=classNameObj.eq(i).attr('old_name');
- newName=classNameObj.eq(i).val();
- if(newName==''){
- layer.msg('班级名称不能为空');
- return false;
- }
- if(oldName==newName){
- layer.msg(oldName+':升班后名称没有变化,请重新编辑');
- return false;
- }
- if($.inArray(newName,classNameCheck)!=-1){
- layer.msg(newName+':名称重复,请重新编辑');
- return false;
- }
- classNameCheck.push(newName);
- classNameArr.push(classNameObj.eq(i).attr('id')+'///'+newName);
- }
- }else{
- classUp=0
- }
- semesterId=document.semesterId;
- if(Graduation==1){
- layer.confirm('注意,当前操作勾选了【删除毕业生】,切换学期以后会删除毕业班学生,请注意数据备份。\n' +
- '可通过“导出学生”功能备份学生数据。', {
- btn: ['确定', '取消'] //按钮
- },function(){
- $(this).attr('disabled',true);
- changeSemester(semesterId,RetainClass,Graduation,classUp,classNameArr,gradeDirector)
- })
- }else{
- if(classUp==1){
- layer.confirm('注意,当前操作勾选了【批量升班】,没有勾选【存了毕业学期】,确定继续吗?', {
- btn: ['确定', '取消'] //按钮
- }, function () {
- $(this).attr('disabled',true);
- changeSemester(semesterId,RetainClass,Graduation,classUp,classNameArr,gradeDirector)
- })
- }else{
- $(this).attr('disabled',true);
- changeSemester(semesterId,RetainClass,Graduation,classUp,classNameArr,gradeDirector)
- }
- }
- function changeSemester(semesterId,RetainClass,Graduation,classUp,classNameArr,gradeDirector){
- layer.msg('正在切换,请稍候。。。',{"time": 0});
- $.ajax({
- url:'<?php echo $this->createUrl('semester/changesemesteract')?>',
- type:'POST',
- data:{'semesterId':semesterId,'RetainClass':RetainClass,'Graduation':Graduation,'classUp':classUp,classNameArr:classNameArr,gradeDirector:gradeDirector},
- dataType:'json',
- success:function(res){
- if(res.code==2001){
- layer.msg('不能切换之前的学期');
- }else if(res.code==2002){
- layer.msg('不在可切换的学期范围');
- }else if(res.code==2003){
- layer.msg('班级创建失败');
- }else if(res.code==1002){
- layer.msg('切换学期失败');
- }else if(res.code==3001){
- layer.msg('切换学期失败,数据表重复,请联系技术支持处理')
- }else if(res.code==0){
- layer.msg('切换学期成功');
- window.location.href='<?php echo $this->createUrl('semester/change')?>';
- }else{
- layer.msg('切换学期失败');
- }
- }
- });
- }
- });
- });
- </script>
- <div class="main-content-inner">
- <!-- 导航栏开始-->
- <?php include(Yii::app()->basePath.'/views/layouts/class_navigation.php');?>
- <!-- 导航栏结束-->
- <div class="page-content" tyle="margin-top:15px;">
- <div class="row" style="margin:0px;">
- <div class="col-xs-12">
- <!-- PAGE CONTENT BEGINS -->
- <div id="dynamic-table_wrapper" class="dataTables_wrapper form-inline no-footer">
- <div class="row" style="margin-bottom: 10px;">
- <div class="dataTables_length" style="margin: 6px 0px;">
- <div class="col-xs-12">
- <form action="">
- <input class="form-control input-sm" type="text" name="word" value="<?php echo $word;?>" placeholder="输入学期名称或学年搜索" />
- <!--<input type="submit" value="搜索" />-->
- <button class="label-primary-s bth-s" id="search" style="padding:4px 12px;">搜索</button>
- </form>
- </div>
- </div>
- </div>
- <table id="dynamic-table" class="table table-striped table-bordered table-hover dataTable no-footer DTTT_selectable">
- <thead>
- <tr>
- <!-- <th>ID</th> -->
- <th>学期名称</th>
- <th>学年</th>
- <th>开始时间</th>
- <th>结束时间</th>
- <th>学期状态</th>
- <th>操作</th>
- </tr>
- </thead>
- <tbody>
- <?php if(!empty($list)):foreach($list as $cl):?>
- <tr>
- <!-- <td><?php echo $cl->semester_id;?></td> -->
- <td class="semesterName"><?php echo $cl->semester_name;?></td>
- <td><?php echo $cl->school_year;?></td>
-
- <td><?php echo date('Y-m-d',$cl->start_time);?></td>
- <td><?php echo date('Y-m-d',$cl->end_time);?></td>
- <td class="hidden-480">
- <?php if($cl->status == 1){?>
- <span class="label label-sm label-primary">当前学期</span>
- <?php }else if($this->schoolManager->isFutureSemester($cl->semester_id)){?>
- <span class="label label-sm label-warning">未开始学期</span>
- <?php }else{?>
- <span class="label label-sm label-success">已完成学期</span>
- <?php }?>
- </td>
- <td>
- <div class="hidden-sm hidden-xs action-buttons">
- <?php if(($this->schoolManager->isFutureSemester($cl->semester_id) || Yii::app()->session["role"] == 2) && $cl->status == 0){?>
- <!--<a class="green changeSemester" title="切换到该学期" semesterId="<?php echo $cl->semester_id;?>" href="javascript:;">切换到该学期</a>-->
- <span class="iconfont addbx click-delete changeSemester" title="切换到该学期" semesterId="<?php echo $cl->semester_id;?>" >
- <i class="ace-icon fa fa-refresh bigger-120"></i>
- </span>
- <?php }else{?>
- -
- <?php }?>
- </div>
- </td>
- </tr>
- <?php endforeach;else:?>
- <tr><td colspan="6">暂无数据!</td></tr>
- <?php endif;?>
- </tbody>
- </table>
-
- <?php if(!empty($page_total)):?>
- <div class="row">
- <div class="col-xs-6">
- <!-- <div class="dataTables_info" id="dynamic-table_info" role="status" aria-live="polite">Showing 1 to 10 of 23 entries</div> -->
- </div>
- <div class="col-xs-6">
- <div class="dataTables_paginate paging_simple_numbers">
- <?php
- $this->widget('CLinkPager', array(
- 'header' => '',
- //'selectedPageCssClass' => 'active2', //当前页的class
- //'hiddenPageCssClass' => 'disabled2', //禁用页的class
- 'firstPageLabel' => '首页',
- 'lastPageLabel' => '末页',
- 'prevPageLabel' => '上一页',
- 'nextPageLabel' => '下一页',
- 'pages' => $pages,
- 'maxButtonCount'=> 5,
- ));
- ?><?php echo '共:'.$page_total.'条';?>
- </div>
- </div>
- </div>
- <?php endif;?>
- </div>
- <!-- PAGE CONTENT ENDS -->
- </div>
- </div>
- </div>
- </div>
- <style>
- /*弹出层*/
- .confirmbox {
- background: #fff;
- border: 1px solid #cccccc;
- border-radius: 3px;
- padding: 40px 40px 30px;
- text-align: center;
- position: fixed;
- left: 50%;
- top: 50%;
- transform: translate(-50%, -50%);
- z-index: 99;
- }
- .confirmbox-mask {
- background: rgba(0, 0, 0, .7);
- left: 0;
- right: 0;
- top: 0;
- bottom: 0;
- z-index: 99;
- position: fixed;
- }
- button {
- border: none;
- background: #2977ff;
- width: 80px;
- height: 26px;
- border-radius: 3px;
- font-size: 14px;
- color: #fff;
- outline: none;
- cursor: pointer;
- }
- button.save {
- display: block;
- margin: 40px auto;
- }
- .confirmbox .confirmbox-btns {
- margin-top: 40px;
- }
- .class-modal {
- width: 720px;
- background: #fff;
- // border-radius: 5px;
- position: absolute;
- top: 50%;
- left: 50%;
- transform: translate(-50%, -50%);
- }
- .class-modal-head {
- font-size: 14px;
- background:#2977ff;
- color:#fff;
- height:25px;
- line-height: 25px;
- padding: 0 0 0 15px;
- }
- .class-modal-body {
- overflow: auto;
- padding:15px;
- }
- .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;
- }
- .class_btn{
- text-align: center;
- }
- .confirmbox-mask p{
- word-wrap : break-word ;
- }
- .icon-close{
- cursor: pointer;
- }
- .model-input{
- border:1px solid #ccc;
- margin-top:10px;
- }
- .model-input label{
- margin:0 15px;
- }
- .class_area{
- height:300px;
- overflow:auto;
- }
- .class_up_info{
- width:140px;
- padding:15px;
- font-size:13px;
- }
- .class_up_1{
- width:270px;
- padding:10px 15px 10px 10px;
- border-left:1px solid #aaa;
- }
- .class_up_2{
- width:260px;
- padding:10px 10px 10px 15px;
- }
- .class_up_1 input,.class_up_2 input{
- width:100px;
- padding:0 10px;
- }
- .class_up_1 td,.class_up_2 td{
- text-align: center;
- padding:3px 0;
- }
- .first_input{
- padding:10px;
- }
- /* Tooltip 容器 */
- .tooltipclass {
- display: inline-block;
- }
- /* Tooltip 文本 */
- .tooltipclass .tooltiptext {
- visibility: hidden;
- width: 160px;
- background-color: #555;
- color: #fff;
- padding: 5px;
- border-radius: 6px;
- font-size:11px;
- text-align: left;
- /* 定位 */
- position: absolute;
- z-index: 1;
- }
- /* 鼠标移动上去后显示提示框 */
- .tooltipclass:hover .tooltiptext {
- visibility: visible;
- }
- </style>
- <!-- 弹窗 -->
- <div class="confirmbox-mask" style="display: none" id="examModal">
- <div class="class-modal">
- <i class="icon close_1 icon-close">×</i>
- <div class="class-modal-head">切换学期</div>
- <div class="class-modal-body">
- <div class="model-input first_input">
- <label> <input type="checkbox" class="RetainClass" checked disabled name="RetainClass" value="1"> 保留班级和学生</label>
- <label> <input type="checkbox" class="Graduation" name="Graduation" value="1"> 删除毕业生</label>
- <label> <input type="checkbox" class="classUp" name="classUp" value="1"> 批量升班</label>
- </div>
- <div class="model-input grade_director_area" style="display: none">
- <label> <input type="radio" class="gradeDirector" name="gradeDirector" checked value="1"> 年级主任同步升班
- <span class="tooltipclass"> <img src="/images/icon-warning-red.png">
- <span class="tooltiptext">
- 已升班的班级内年级主任进行升级,如高一年级主任升为高二年级主任
- </span></span>
- </label>
- <label> <input type="radio" class="gradeDirector" name="gradeDirector" value="2"> 年级主任不同步升班
- <span class="tooltipclass"> <img src="/images/icon-warning-red.png">
- <span class="tooltiptext">
- 已升班的班级内将自动去除年级主任,新学期需重新添加班级的年级主任
- </span></span>
- </label>
- </div>
- <div class="model-input class_area" style="display: none">
- <div class="fl class_up_info">
- <img src="/images/warn-icon.png">注意:<br>
- 1、批量升班可将本学期高一/高二班级分别升为新学期高二/高三班级;<br>
- 2、请对应修改升班后的新学期班级名称,且名称不能重复;<br>
- 3、升班后教师与学生一起升班,不支持回退,请谨慎操作!
- </div>
- <div class="fl class_up_1">
- <table>
- <tr>
- <td colspan="3" align="center">行政班</td>
- </tr>
- <tr>
- <td>本学期班级</td>
- <td style="width:60px;"></td>
- <td>新学期班级</td>
- </tr>
- <?php
- if(isset($classes[1])){
- foreach ($classes[1] as $class){
- echo '<tr>';
- echo '<td>'.$class['class_name'].'</td>';
- echo '<td style="width:60px;">——</td>';
- echo '<td><input type="text" id="'.$class['class_id'].'" old_name="'.$class['class_name'].'" class="new_class_name" name="class[]" value="'.$class['class_name'].'"></td>';
- echo '</tr>';
- }
- }
- ?>
- </table>
- </div>
- <div class="fl class_up_2">
- <table>
- <tr>
- <td colspan="3" align="center">教学班</td>
- </tr>
- <tr>
- <td>本学期班级</td>
- <td style="width:60px;"></td>
- <td>新学期班级</td>
- </tr>
- <?php
- if(isset($classes[2])){
- foreach ($classes[2] as $class){
- echo '<tr>';
- echo '<td>'.$class['class_name'].'</td>';
- echo '<td style="width:60px;">——</td>';
- echo '<td><input type="text" id="'.$class['class_id'].'" old_name="'.$class['class_name'].'" class="new_class_name" name="class[]" value="'.$class['class_name'].'"></td>';
- echo '</tr>';
- }
- }
- ?>
- </table>
- </div>
- </div>
- </div>
- <div class="class-modal-body red">
- 操作须知:<br>
- <?php if(Yii::app()->params['section']!=0):?>
- 1、切换后,旧学期将不存在学生数据;请在完成所有考试和产品后再切换学期。<br>
- 2、寒假后切换学期,不要勾选【删除毕业生】、【批量升班】,直接切换即可。<br>
- 3、暑假后切换学期,高三学生已经毕业,可勾选【删除毕业生】,需谨慎操作。<br>
- 4、需要批量将高一升高二,高二升高三,请勾选【批量升班】。<br>
- 注意:切换新学期后,将不能再切换回以前的学期,请确认!
- <?php else:?>
- 1、切换后,旧学期将不存在学生数据;请在完成所有考试和产品后再切换学期。<br>
- 2、寒假后切换学期,不要勾选【删除毕业生】、【批量升班】,直接切换即可。<br>
- 3、暑假后切换学期,九年级学生已经毕业,可勾选【删除毕业生】,需谨慎操作。<br>
- 4、需要批量将七年级升八年级,八年级升九年级,请勾选【批量升班】。<br>
- 注意:切换新学期后,将不能再切换回以前的学期,请确认!
- <?php endif;?>
- </div>
- <p class="class_btn">
- <button type="button" class="sumbit">确定</button>
- <button type="button" class="close_1">取消</button>
- </p>
- </div>
- </div>
- <script type="text/javascript">
- function changeProvince(pid) {
- if (!pid) return;
- $.post("<?php echo $this->createUrl('school/area');?>",{pid:pid},function(data){
- var p = eval("("+data+")");
- if (p.flag) {
- var cityObj = $("#city");
- cityObj.show();
- cityObj.empty();
- var html;
- html = "<option value=''>请选择市</option>";
- $.each(p.getArray,function(i,n){
- html += "<option <?php if(!empty($cityId) && $cityId=="+n.region_id+"){echo 'selected';}?> value='"+n.region_id+"'>" + n.region_name + "</option>";
- });
- cityObj.append(html);
- } else {
- alert("获取数据失败!");
- }
- });
- }
- function changeCity(pid,flag) {
- if (!pid) return;
- $.post("<?php echo $this->createUrl('coach/area');?>",{pid:pid,flag:flag},function(data){
- var p = eval("("+data+")");
- if (p.flag) {
- var cityObj = $("#county");
- var schObj = $("#schoolId");
- //cityObj.show();
- // 市县select
- cityObj.empty();
- var html;
- html = "<option value=''>请选择区县</option>";
- $.each(p.getArray,function(i,n){
- html += "<option value='"+n.region_id+"'>" + n.region_name + "</option>";
- });
- cityObj.append(html);
-
- // 学校select
- var str;
- schObj.empty();
- $.each(p.schoolArr,function(i,n){
- str += "<option value='"+n.school_id+"'>" + n.school_name + "</option>";
- });
- schObj.append(str);
- } else {
- alert("获取数据失败!");
- }
- });
- }
- function changeCounty(aid,flag) {
- if (!aid) return;
- $.post("<?php echo $this->createUrl('coach/area');?>",{pid:aid,flag:flag},function(data){
- var p = eval("("+data+")");
- if (p.flag) {
- var schObj = $("#schoolId");
-
- // 学校select
- var str;
- schObj.empty();
- $.each(p.schoolArr,function(i,n){
- str += "<option value='"+n.school_id+"'>" + n.school_name + "</option>";
- });
- schObj.append(str);
- } else {
- alert("获取数据失败!");
- }
- });
- }
- $('.classUp').click(function(){
- if($('input[name=classUp]').is(':checked')){
- $('.class_area').show();
- $('.grade_director_area').show();
- }else{
- $('.class_area').hide();
- $('.grade_director_area').hide();
- }
- });
- </script>
|