123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243 |
- <script type="text/javascript">
- jQuery(document).ready(function(){
- jQuery(".delSemester").click(function(){
- document.semesterId = jQuery(this).attr("semesterId");
-
- layer.msg('确定删除?', {
- time: 0,
- btn: ['确定', '取消'],
- yes: function(index){
- layer.close(index);
-
- jQuery.post(
- "<?php echo $this->createUrl("semester/delsemesteract");?>",
- {"semesterId": document.semesterId},
- function(data){
- data = eval("("+data+")");
-
- if(data.code == "0"){
- msg = data.msg;
- icon = 6;
- }
- else{
- msg = "因为以下原因操作失败:<br/>"+data.msg;
- icon = 5;
- }
-
- layer.alert(msg, {icon: icon}, function(){
- location.href = "<?php echo $this->createUrl("semester/index");?>";
- });
- }
- );
- }
- });
- });
- });
- </script>
- <div class="main-content-inner">
- <!--<div class="breadcrumbs" id="breadcrumbs">
- <ul class="breadcrumb">
- <li class="li_backgrond_color">
- <a href="<?php echo $this->createUrl("semester/index");?>">学期管理</a>
- </li>
- <li>
- <a href="<?php echo $this->createUrl("teacher/index");?>">教师管理</a>
- </li>
- <li>
- <a href="<?php echo $this->createUrl("classes/index");?>">班级管理</a>
- </li>
- <li>
- <a href="<?php echo $this->createUrl("studentinfo/index");?>">学生管理</a>
- </li>
- </ul>
- </div>-->
- <!-- 导航栏开始-->
- <?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 -->
- <?php if($flag == 1):?>
- <div style="margin:200px 390px;color: red;">请联系助教组长设置使用学期!</div>
- <?php else:?>
- <div id="dynamic-table_wrapper" class="dataTables_wrapper form-inline no-footer">
- <div class="row">
- <div class="dataTables_length margin-zy">
- <div class="col-xs-9">
- <form action="">
- <input type="text" class="form-control input-sm" 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 class="col-xs-3">
- <?php if (Yii::app()->session['coachInfo']['leader'] == 1){?>
- <div id="dynamic-table_filter" class="dataTables_filter position_g">
- <a class="btn btn-success btn-sm" href="<?php echo $this->createUrl('semester/add');?>">
- <i class="fa fa-plus" style="font-style: normal;"></i> 添加学期
- </a>
-
- <a class="btn btn-success btn-sm" href="<?php echo $this->createUrl('semester/change');?>">
- <i class="fa" style="font-style: normal;"></i> 切换学期
- </a>
- </div>
- <?php }?>
- </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><?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( (isset(Yii::app()->session['testFlag'])&&(Yii::app()->session['testFlag']==1)) || $cl->status==1){?>
- <span class="iconfont addbx click-sc" title="编辑" onclick="javascript:location.href='<?php echo $this->createUrl('semester/edit',array('smtid'=>$cl->semester_id));?>'"></span>
- <?php }?>
- <!--<a class="green delSemester" semesterId="<?php echo $cl->semester_id;?>" title="删除" href="javascript:;">删除</a>-->
- <span class="iconfont addbx click-delete delSemester" title="删除" semesterId="<?php echo $cl->semester_id;?>" >
- 
- </span>
- </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-7">
- <!-- <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-5">
- <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>
- <?php endif;?>
- <!-- PAGE CONTENT ENDS -->
- </div>
- </div>
- </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("获取数据失败!");
- }
- });
- }
- </script>
|