123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212 |
- <link rel="stylesheet" type="text/css" href="/css/jquery.datetimepicker.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;}
- #end_time-error ,#start_time-error{/* margin-left: 75px; */float: left;}
- .input-group{float:left}
- </style>
- <script type="text/javascript">
- function refreshSelect(){
- if(getRefreshState())
- return false;
-
- setRefreshState(true);
-
- jQuery("#semester").val("");
-
- var year = jQuery("#school_year").val();
- if(year.length != 4 || year < <?php echo date("Y", time());?>){
- jQuery("#school_year").val(year);
-
- setRefreshState(false);
- return false;
- }
- var s_name = "<?php echo $info->semester_name?>";
- var s_code = "<?php echo $info->refer_code?>";
- jQuery.get(
- "<?php echo $this->createUrl("semester/getthisyearsemesterdictionary?year=");?>"+year,
- function(data){
- data = JSON.parse(data);
- var select = "";
-
- for(var i in data){
- //select += '<li val="'+data[i].code+'">'+data[i].name+'</li>'
- if(s_code==data[i].code){
- select += '<option selected value="'+data[i].code+'">'+data[i].name+'</option>'
- }else{
- select += '<option value="'+data[i].code+'">'+data[i].name+'</option>'
- }
- }
- $("#semesterName").html(select);
- setRefreshState(false);
- }
- );
- }
- document.refreshing = false;
- function setRefreshState(state){
- document.refreshing = state;
- }
- function getRefreshState(){
- return document.refreshing;
- }
- jQuery(document).ready(function(){
- refreshSelect();
-
- jQuery("#school_year").keyup(function(){
- refreshSelect();
- });
- });
- </script>
- <div class="main-content-inner">
- <ul class="clearfix main-content-inner-ul">
- <li class="pull-left">
- <button onclick='location.href="<?php echo $this->createUrl("semester/index");?>"' class="button button_normal button_group button_arrow button_active" data-button="red">学期管理</button>
- <img src="/images/line.jpg" style="height:45px;" />
- </li>
- <li class="pull-left">
- <button onclick='location.href="<?php echo $this->createUrl("teacher/index");?>"' class="button button_normal button_group button_arrow" data-button="red">教师管理</button>
- <img src="/images/line.jpg" style="height:45px;" />
- </li>
- <li class="pull-left">
- <button onclick='location.href="<?php echo $this->createUrl("classes/index");?>"' class="button button_normal button_group button_arrow" data-button="red">班级管理</button>
- <img src="/images/line.jpg" style="height:45px;" />
- </li>
- <li class="pull-left">
- <button onclick='location.href="<?php echo $this->createUrl("studentinfo/index");?>"' class="button button_normal button_group button_arrow" data-button="red">学生管理</button>
- <img src="/images/line.jpg" style="height:45px;" />
- </li>
- <?php if(Yii::app()->session['coachInfo']['leader']==1){ ?>
- <li class="pull-left">
- <button onclick='location.href="<?php echo $this->createUrl("school/add");?>"' class="button button_normal button_group button_arrow" data-button="red">学校管理</button>
- <img src="/images/line.jpg" style="height:45px;" />
- </li>
- <?php } ?>
- <li class="pull-left">
- <button onclick='location.href="<?php echo $this->createUrl("classes/export");?>"' class="button button_normal button_group button_arrow " data-button="red">导出学生</button>
- <img src="/images/line.jpg" style="height:45px;" />
- </li>
- </ul>
- <div class="page-content" style="margin-top:15px;">
- <div class="row" style="margin:0px">
- <div class="col-xs-12 fontSize1">
- <!-- PAGE CONTENT BEGINS -->
- <form class="form-horizontal" action="<?php echo $this->createUrl('semester/edit',array('smtid'=>$info->semester_id));?>" method="post" id="semesAdd">
- <!--<div class="form-group">
- <label class="control-label col-xs-12 col-sm-3 no-padding-right">学期名称<span class="errorMessage">*</span>:</label>
- <div class="col-sm-9">
- <input type="text" id="name" name="name" class="col-xs-10 col-sm-3 addborder addheight marginLeftNo" />
- </div>
- </div>-->
-
-
- <div class="form-group">
- <label class="control-label col-xs-12 col-sm-3 no-padding-right">学年<span class="errorMessage">*</span>:</label>
- <div class="col-sm-9">
- <input type="number" id="school_year" readonly name="school_year" value="<?php echo $info->school_year?>" class="col-xs-10 col-sm-3 addborder addheight marginLeftNo" placeholder="例如:<?php echo date("Y", time());?>" />
- </div>
- </div>
- <div class="form-group">
- <label class="control-label col-xs-12 col-sm-3 no-padding-right">学期<span class="errorMessage">*</span>:</label>
- <div class="col-sm-9">
- <input type='hidden' name="semester" value="<?php echo $info->refer_code?>"/>
- <input type='text' readonly name="semester_name" value="<?php echo $info->semester_name?>"/>
- </div>
- </div>
- <div class="form-group">
- <label class="control-label col-xs-12 col-sm-3 no-padding-right">开始日期<span class="errorMessage">*</span>:</label>
- <div class="col-xs-12 col-sm-2">
- <div class="input-group input-group-sm">
- <input type="text" id="start_time" class="form-control hasDatepicker marginLeftNo" name="start_time" style="width:100%;" value="<?php echo date('Y-m-d',$info->start_time)?>">
- <span class="input-group-addon">
- <i class="ace-icon fa fa-calendar"></i>
- </span>
- </div>
- </div>
- </div>
- <div class="form-group">
- <label class="control-label col-xs-12 col-sm-3 no-padding-right">结束日期<span class="errorMessage">*</span>:</label>
- <div class="col-xs-12 col-sm-2">
- <div class="input-group input-group-sm">
- <input type="text" id="end_time" class="form-control hasDatepicker marginLeftNo" name="end_time" style="width:100%;" value="<?php echo date('Y-m-d',$info->end_time)?>">
- <span class="input-group-addon">
- <i class="ace-icon fa fa-calendar"></i>
- </span>
- </div>
- </div>
- </div>
- <div class="form-group">
- <label class="control-label col-xs-12 col-sm-3 no-padding-right">当前学期:<span class="errorMessage">*</span>:</label>
- <div class="col-sm-9 mt6">
- <span class="inline blue">
- <input type="radio" class="ace" name="status" value="0" <?php if($info->status==0){echo 'checked="checked"';}?> >
- <span class="lbl middle"> 否</span>
- </span>
-
- <span class="inline blue">
- <input type="radio" class="ace" name="status" value="1" <?php if($info->status==1){echo 'checked="checked"';}?>>
- <span class="lbl middle"> 是</span>
- </span>
- </div>
- </div>
- <div class="clearfix form-actions">
- <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>
- <script src="/js/jquery.validate.min.js"></script>
- <script src="/js/jquery.datetimepicker.js"></script>
- <script src="/js/xsgl.js"></script>
- <script type="text/javascript">
- jQuery(function($) {
- $('#start_time').datetimepicker({format:"Y-m-d",timepicker:false,lang:"ch"});
- $('#end_time').datetimepicker({format:"Y-m-d",timepicker:false,lang:"ch"});
- $('#schoolSubmit').click(function(){
- var startDate = $('#start_time').val(),
- endDate = $('#end_time').val(),
- semester_name=$('#semesterName').find("option:selected").text();
- var checkDate=new Date(Date.parse(startDate.replace(/-/g,"/"))) <= new Date(Date.parse(endDate.replace(/-/g,"/")));
- console.log(checkDate);
- if(!checkDate){
- layer.msg('结束日期必须大于开始日期');
- return false;
- }
- });
- });
- </script>
|