edit2.php 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  1. <link rel="stylesheet" type="text/css" href="/css/jquery.datetimepicker.css">
  2. <style>
  3. .addborder{border:1px solid #ccc}
  4. .addheight{height:30px;border-radius:2px;}
  5. .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;}
  6. .ace{position:relative;top:0px !important;left:0px !important;}
  7. label{font-weight:100 !important;}
  8. #end_time-error ,#start_time-error{/* margin-left: 75px; */float: left;}
  9. .input-group{float:left}
  10. </style>
  11. <script type="text/javascript">
  12. function refreshSelect(){
  13. if(getRefreshState())
  14. return false;
  15. setRefreshState(true);
  16. jQuery("#semester").val("");
  17. var year = jQuery("#school_year").val();
  18. if(year.length != 4 || year < <?php echo date("Y", time());?>){
  19. jQuery("#school_year").val(year);
  20. setRefreshState(false);
  21. return false;
  22. }
  23. var s_name = "<?php echo $info->semester_name?>";
  24. var s_code = "<?php echo $info->refer_code?>";
  25. jQuery.get(
  26. "<?php echo $this->createUrl("semester/getthisyearsemesterdictionary?year=");?>"+year,
  27. function(data){
  28. data = JSON.parse(data);
  29. var select = "";
  30. for(var i in data){
  31. //select += '<li val="'+data[i].code+'">'+data[i].name+'</li>'
  32. if(s_code==data[i].code){
  33. select += '<option selected value="'+data[i].code+'">'+data[i].name+'</option>'
  34. }else{
  35. select += '<option value="'+data[i].code+'">'+data[i].name+'</option>'
  36. }
  37. }
  38. $("#semesterName").html(select);
  39. setRefreshState(false);
  40. }
  41. );
  42. }
  43. document.refreshing = false;
  44. function setRefreshState(state){
  45. document.refreshing = state;
  46. }
  47. function getRefreshState(){
  48. return document.refreshing;
  49. }
  50. jQuery(document).ready(function(){
  51. refreshSelect();
  52. jQuery("#school_year").keyup(function(){
  53. refreshSelect();
  54. });
  55. });
  56. </script>
  57. <div class="main-content-inner">
  58. <ul class="clearfix main-content-inner-ul">
  59. <li class="pull-left">
  60. <button onclick='location.href="<?php echo $this->createUrl("semester/index");?>"' class="button button_normal button_group button_arrow button_active" data-button="red">学期管理</button>
  61. <img src="/images/line.jpg" style="height:45px;" />
  62. </li>
  63. <li class="pull-left">
  64. <button onclick='location.href="<?php echo $this->createUrl("teacher/index");?>"' class="button button_normal button_group button_arrow" data-button="red">教师管理</button>
  65. <img src="/images/line.jpg" style="height:45px;" />
  66. </li>
  67. <li class="pull-left">
  68. <button onclick='location.href="<?php echo $this->createUrl("classes/index");?>"' class="button button_normal button_group button_arrow" data-button="red">班级管理</button>
  69. <img src="/images/line.jpg" style="height:45px;" />
  70. </li>
  71. <li class="pull-left">
  72. <button onclick='location.href="<?php echo $this->createUrl("studentinfo/index");?>"' class="button button_normal button_group button_arrow" data-button="red">学生管理</button>
  73. <img src="/images/line.jpg" style="height:45px;" />
  74. </li>
  75. <?php if(Yii::app()->session['coachInfo']['leader']==1){ ?>
  76. <li class="pull-left">
  77. <button onclick='location.href="<?php echo $this->createUrl("school/add");?>"' class="button button_normal button_group button_arrow" data-button="red">学校管理</button>
  78. <img src="/images/line.jpg" style="height:45px;" />
  79. </li>
  80. <?php } ?>
  81. <li class="pull-left">
  82. <button onclick='location.href="<?php echo $this->createUrl("classes/export");?>"' class="button button_normal button_group button_arrow " data-button="red">导出学生</button>
  83. <img src="/images/line.jpg" style="height:45px;" />
  84. </li>
  85. </ul>
  86. <div class="page-content" style="margin-top:15px;">
  87. <div class="row" style="margin:0px">
  88. <div class="col-xs-12 fontSize1">
  89. <!-- PAGE CONTENT BEGINS -->
  90. <form class="form-horizontal" action="<?php echo $this->createUrl('semester/edit',array('smtid'=>$info->semester_id));?>" method="post" id="semesAdd">
  91. <!--<div class="form-group">
  92. <label class="control-label col-xs-12 col-sm-3 no-padding-right">学期名称<span class="errorMessage">*</span>:</label>
  93. <div class="col-sm-9">
  94. <input type="text" id="name" name="name" class="col-xs-10 col-sm-3 addborder addheight marginLeftNo" />
  95. </div>
  96. </div>-->
  97. <div class="form-group">
  98. <label class="control-label col-xs-12 col-sm-3 no-padding-right">学年<span class="errorMessage">*</span>:</label>
  99. <div class="col-sm-9">
  100. <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());?>" />
  101. </div>
  102. </div>
  103. <div class="form-group">
  104. <label class="control-label col-xs-12 col-sm-3 no-padding-right">学期<span class="errorMessage">*</span>:</label>
  105. <div class="col-sm-9">
  106. <input type='hidden' name="semester" value="<?php echo $info->refer_code?>"/>
  107. <input type='text' readonly name="semester_name" value="<?php echo $info->semester_name?>"/>
  108. </div>
  109. </div>
  110. <div class="form-group">
  111. <label class="control-label col-xs-12 col-sm-3 no-padding-right">开始日期<span class="errorMessage">*</span>:</label>
  112. <div class="col-xs-12 col-sm-2">
  113. <div class="input-group input-group-sm">
  114. <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)?>">
  115. <span class="input-group-addon">
  116. <i class="ace-icon fa fa-calendar"></i>
  117. </span>
  118. </div>
  119. </div>
  120. </div>
  121. <div class="form-group">
  122. <label class="control-label col-xs-12 col-sm-3 no-padding-right">结束日期<span class="errorMessage">*</span>:</label>
  123. <div class="col-xs-12 col-sm-2">
  124. <div class="input-group input-group-sm">
  125. <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)?>">
  126. <span class="input-group-addon">
  127. <i class="ace-icon fa fa-calendar"></i>
  128. </span>
  129. </div>
  130. </div>
  131. </div>
  132. <div class="form-group">
  133. <label class="control-label col-xs-12 col-sm-3 no-padding-right">当前学期:<span class="errorMessage">*</span>:</label>
  134. <div class="col-sm-9 mt6">
  135. <span class="inline blue">
  136. <input type="radio" class="ace" name="status" value="0" <?php if($info->status==0){echo 'checked="checked"';}?> >
  137. <span class="lbl middle"> 否</span>
  138. </span>
  139. &nbsp; &nbsp; &nbsp;
  140. <span class="inline blue">
  141. <input type="radio" class="ace" name="status" value="1" <?php if($info->status==1){echo 'checked="checked"';}?>>
  142. <span class="lbl middle"> 是</span>
  143. </span>
  144. </div>
  145. </div>
  146. <div class="clearfix form-actions">
  147. <div class="col-md-offset-3 col-md-9">
  148. <button class="btn btn-success btn-sm" type="submit" id="schoolSubmit">
  149. <i class="ace-icon fa fa-check bigger-110"></i>
  150. 提交
  151. </button>
  152. <!--&nbsp; &nbsp; &nbsp;
  153. <button class="btn" type="reset">
  154. <i class="ace-icon fa fa-undo bigger-110"></i>
  155. 重填
  156. </button>-->
  157. </div>
  158. </div>
  159. </form>
  160. <!-- PAGE CONTENT ENDS -->
  161. </div>
  162. </div>
  163. </div>
  164. </div>
  165. <script src="/js/jquery.validate.min.js"></script>
  166. <script src="/js/jquery.datetimepicker.js"></script>
  167. <script src="/js/xsgl.js"></script>
  168. <script type="text/javascript">
  169. jQuery(function($) {
  170. $('#start_time').datetimepicker({format:"Y-m-d",timepicker:false,lang:"ch"});
  171. $('#end_time').datetimepicker({format:"Y-m-d",timepicker:false,lang:"ch"});
  172. $('#schoolSubmit').click(function(){
  173. var startDate = $('#start_time').val(),
  174. endDate = $('#end_time').val(),
  175. semester_name=$('#semesterName').find("option:selected").text();
  176. var checkDate=new Date(Date.parse(startDate.replace(/-/g,"/"))) <= new Date(Date.parse(endDate.replace(/-/g,"/")));
  177. console.log(checkDate);
  178. if(!checkDate){
  179. layer.msg('结束日期必须大于开始日期');
  180. return false;
  181. }
  182. });
  183. });
  184. </script>