edit1.php 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. <link rel="stylesheet" type="text/css" href="/css/jquery.datetimepicker.css">
  2. <div class="main-content-inner">
  3. <div class="breadcrumbs" id="breadcrumbs">
  4. <ul class="clearfix main-content-inner-ul">
  5. <?php if(Yii::app()->session['coachInfo']['leader']==1){?>
  6. <li class="pull-left">
  7. <button onclick='location.href="<?php echo $this->createUrl("semester/index");?>"' class="button button_normal button_group button_arrow button_active" data-button="red">学期管理</button>
  8. <img src="/images/line.jpg" style="height:45px;" />
  9. </li>
  10. <?php }?>
  11. <li class="pull-left">
  12. <button onclick='location.href="<?php echo $this->createUrl("teacher/index");?>"' class="button button_normal button_group button_arrow" data-button="red">教师管理</button>
  13. <img src="/images/line.jpg" style="height:45px;" />
  14. </li>
  15. <li class="pull-left">
  16. <button onclick='location.href="<?php echo $this->createUrl("classes/index");?>"' class="button button_normal button_group button_arrow" data-button="red">班级管理</button>
  17. <img src="/images/line.jpg" style="height:45px;" />
  18. </li>
  19. <li class="pull-left">
  20. <button onclick='location.href="<?php echo $this->createUrl("studentinfo/index");?>"' class="button button_normal button_group button_arrow" data-button="red">学生管理</button>
  21. <img src="/images/line.jpg" style="height:45px;" />
  22. </li>
  23. <?php if(Yii::app()->session['coachInfo']['leader']==1){ ?>
  24. <li class="pull-left">
  25. <button onclick='location.href="<?php echo $this->createUrl("school/add");?>"' class="button button_normal button_group button_arrow" data-button="red">学校管理</button>
  26. <img src="/images/line.jpg" style="height:45px;" />
  27. </li>
  28. <?php } ?>
  29. <li class="pull-left">
  30. <button onclick='location.href="<?php echo $this->createUrl("classes/export");?>"' class="button button_normal button_group button_arrow " data-button="red">导出学生</button>
  31. <img src="/images/line.jpg" style="height:45px;" />
  32. </li>
  33. </ul>
  34. </div>
  35. <div class="page-content" style="margin-top:15px;">
  36. <div class="row">
  37. <div class="col-xs-12">
  38. <!-- PAGE CONTENT BEGINS -->
  39. <form class="form-horizontal" action="<?php echo $this->createUrl('semester/edit',array('smtid'=>$info->semester_id));?>" method="post" id="semesAdd">
  40. <div class="form-group">
  41. <label class="control-label col-xs-12 col-sm-3 no-padding-right">学期名称<span class="errorMessage">*</span>:</label>
  42. <div class="col-sm-9">
  43. <input type="text" id="semester_name" name="semester_name" value="<?php echo $info->semester_name;?>" class="col-xs-10 col-sm-3" />
  44. </div>
  45. </div>
  46. <div class="form-group">
  47. <label class="control-label col-xs-12 col-sm-3 no-padding-right">学年<span class="errorMessage">*</span>:</label>
  48. <div class="col-sm-9">
  49. <input type="text" id="school_year" name="school_year" class="col-xs-10 col-sm-3" value="<?php echo $info->school_year;?>" />
  50. </div>
  51. </div>
  52. <div class="form-group">
  53. <label class="control-label col-xs-12 col-sm-3 no-padding-right">开始日期<span class="errorMessage">*</span>:</label>
  54. <div class="col-xs-12 col-sm-2">
  55. <div class="input-group input-group-sm">
  56. <input type="text" id="start_time" class="form-control hasDatepicker" name="start_time" value="<?php echo date('Y-m-d',$info->start_time)?>">
  57. <span class="input-group-addon">
  58. <i class="ace-icon fa fa-calendar"></i>
  59. </span>
  60. </div>
  61. </div>
  62. </div>
  63. <div class="form-group">
  64. <label class="control-label col-xs-12 col-sm-3 no-padding-right">结束日期<span class="errorMessage">*</span>:</label>
  65. <div class="col-xs-12 col-sm-2">
  66. <div class="input-group input-group-sm">
  67. <input type="text" id="end_time" class="form-control hasDatepicker" name="end_time" value="<?php echo date('Y-m-d',$info->end_time)?>">
  68. <span class="input-group-addon">
  69. <i class="ace-icon fa fa-calendar"></i>
  70. </span>
  71. </div>
  72. </div>
  73. </div>
  74. <div class="form-group">
  75. <label class="control-label col-xs-12 col-sm-3 no-padding-right">当前学期:<span class="errorMessage">*</span>:</label>
  76. <div class="col-sm-9">
  77. <label class="inline blue">
  78. <input type="radio" class="ace" name="status" value="0" <?php if($info->status==0){echo 'checked';}?> >
  79. <span class="lbl middle"> 否</span>
  80. </label>
  81. &nbsp; &nbsp; &nbsp;
  82. <label class="inline blue">
  83. <input type="radio" class="ace" name="status" value="1" <?php if($info->status==1){echo 'checked';}?>>
  84. <span class="lbl middle"> 是</span>
  85. </label>
  86. </div>
  87. </div>
  88. <div class="clearfix form-actions">
  89. <div class="col-md-offset-3 col-md-9">
  90. <button class="btn btn-info" type="submit" id="schoolSubmit">
  91. <i class="ace-icon fa fa-check bigger-110"></i>
  92. 提交
  93. </button>
  94. <!-- &nbsp; &nbsp; &nbsp;
  95. <button class="btn" type="reset">
  96. <i class="ace-icon fa fa-undo bigger-110"></i>
  97. 重填
  98. </button> -->
  99. </div>
  100. </div>
  101. </form>
  102. <!-- PAGE CONTENT ENDS -->
  103. </div>
  104. </div>
  105. </div>
  106. </div>
  107. <script src="/js/jquery.validate.min.js"></script>
  108. <script src="/js/jquery.datetimepicker.js"></script>
  109. <script type="text/javascript">
  110. jQuery(function($) {
  111. $('#start_time').datetimepicker({format:"Y-m-d",timepicker:false,lang:"ch"});
  112. $('#end_time').datetimepicker({format:"Y-m-d",timepicker:false,lang:"ch"});
  113. //检测开始日期是否大于结束日期
  114. $.validator.addMethod("checkTime", function(value, element) {
  115. var startDate = $('#start_time').val();
  116. return new Date(Date.parse(startDate.replace(/-/g,"/"))) <= new Date(Date.parse(value.replace(/-/g,"/")));
  117. }, "结束日期必须大于开始日期");
  118. $('#semesAdd').validate({
  119. //debug:true,// 表单不会提交
  120. //errorElement: 'font', // 错误信息div
  121. errorClass: 'errorMessage', //错误样式
  122. rules: {
  123. semester_name: {
  124. required: true,
  125. maxlength:20,
  126. },
  127. school_year: {
  128. required: true,
  129. maxlength:8,
  130. digits:true
  131. },
  132. //period: {
  133. //required: true,
  134. //},
  135. start_time: {
  136. required: true,
  137. },
  138. end_time: {
  139. required: true,
  140. checkTime:true
  141. }
  142. },
  143. messages: {
  144. semester_name: {
  145. required: "请填写学期名称!",
  146. maxlength: "学期名称字符不能超过20个字符!",
  147. },
  148. school_year: {
  149. required: "请填写学年!",
  150. maxlength: "学年不能超过8个字符!",
  151. digits:"学年必须是数字!"
  152. },
  153. //period: {
  154. // required: "请填写届!",
  155. //},
  156. start_time: {
  157. required: "请填写开始时间!",
  158. },
  159. end_time: {
  160. required: "请填写结束时间!",
  161. }
  162. },
  163. errorPlacement: function (error, element) { // 指定错误信息显示位置
  164. if(element.is('input[name=start_time]') || element.is('input[name=end_time]')) {
  165. error.insertAfter(element.parent());
  166. }else{
  167. error.insertAfter(element.after());
  168. }
  169. },
  170. })
  171. });
  172. </script>