import_classified.php 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. <link type="text/css" rel="stylesheet" href="/css/needDetail.css" />
  2. <script type="text/javascript" src="/js/vue.min.js"></script>
  3. <div class="main-content-inner">
  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" 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 button_active" data-button="red">学生管理</button>
  21. <img src="/images/line.jpg" style="height:45px;" />
  22. </li>
  23. <li class="pull-left">
  24. <button onclick='location.href="<?php echo $this->createUrl("classes/export");?>"' class="button button_normal button_group button_arrow " data-button="red">导出学生</button>
  25. <img src="/images/line.jpg" style="height:45px;" />
  26. </li>
  27. </ul>
  28. <title>Document</title>
  29. <style>
  30. * {
  31. margin: 0;
  32. padding: 0;
  33. }
  34. #app {
  35. padding: 0 20px;
  36. }
  37. .body {
  38. display: flex;
  39. /* align-items: center; */
  40. margin-top: 20px;
  41. padding: 0 10px;
  42. max-width: 100%;
  43. overflow: auto;
  44. }
  45. th, td {
  46. padding: 5px 15px;
  47. min-height: 30px;
  48. border: 1px solid #cccccc;
  49. }
  50. td > div {
  51. min-height: 20px;
  52. white-space: nowrap;
  53. }
  54. td.reducer {
  55. padding: 10px 10px 0;
  56. }
  57. td.reducer div {
  58. border: 2px solid green;
  59. text-align: center;
  60. font-size: 30px
  61. }
  62. tfoot td {
  63. border: none;
  64. }
  65. div.add {
  66. display: flex;
  67. margin-left: 10px;
  68. width: 50px;
  69. min-width: 50px;
  70. justify-content: center;
  71. align-items: center;
  72. border: 2px solid green;
  73. font-size: 30px;
  74. }
  75. div.table-wrap {
  76. display: inline-block;
  77. overflow: auto;
  78. }
  79. div.head {
  80. display: flex;
  81. align-items: center;
  82. justify-content: space-between;
  83. margin-top: 20px;
  84. padding: 0 10px 5px;
  85. border-bottom: 1px solid #cccccc;
  86. color: #585858;
  87. }
  88. div.head a {
  89. color: green;
  90. text-decoration: none;
  91. }
  92. </style>
  93. <div class="layout-gap" id="app">
  94. <section class="anc-top flex ">
  95. <div class="flex-one flex">
  96. <p class="anc-title">导入教学班学生</p>
  97. </div>
  98. <div class="anc-opt-btn green-font pointer reback" ><a href="<?php echo $this->createUrl('classes/index?class_type=2');?>">返回</a></div>
  99. </section>
  100. <br>
  101. excel模板示例如下:
  102. <table border="0" cellspacing="0">
  103. <thead>
  104. <tr>
  105. <td></td>
  106. <td>*教学班名称</td>
  107. <td>*姓名</td>
  108. <td>系统准考证号</td>
  109. </tr>
  110. </thead>
  111. <tbody>
  112. <tr>
  113. <td>1</td>
  114. <td>物理1班</td>
  115. <td>张三1</td>
  116. <td></td>
  117. </tr>
  118. <tr>
  119. <td>2</td>
  120. <td>物理2班</td>
  121. <td>张三2</td>
  122. <td></td>
  123. </tr>
  124. <tr>
  125. <td>3</td>
  126. <td>物理3班</td>
  127. <td>张三3</td>
  128. <td></td>
  129. </tr>
  130. </tbody>
  131. </table>
  132. <form id="form1" action="<?php echo $this->createUrl('importstudent/importClassified')?>" method="post" enctype="multipart/form-data">
  133. <section class="anc-top ">
  134. <p>请分学科导入名单</p>
  135. <div>
  136. <select name="subject" id="subject">
  137. <option value="0">请选择学科</option>
  138. <?php
  139. if(isset($subjects)){
  140. foreach ($subjects as $key => $val){
  141. echo '<option value="'.$key.'">'.$val.'</option>';
  142. }
  143. }
  144. ?>
  145. </select>
  146. </div>
  147. </section>
  148. <section class="anc-finish-opt " >
  149. <div class="anc-finish-btn i_fl select_file" >上传excel</div>
  150. <input type="file" name="student_file" id="uploadFile" style="display: none">
  151. </section>
  152. </form>
  153. </div>
  154. </div>
  155. <script>
  156. $(function(){
  157. $('#uploadFile').val('');
  158. $('.select_file').click(function(){
  159. if($('#subject').val()==0){
  160. alert('请选择学科');
  161. }else{
  162. $('#uploadFile').click();
  163. }
  164. });
  165. $('#uploadFile').change(function(){
  166. if($('#uploadFile').val()!=''){
  167. $('#form1').submit();
  168. }
  169. });
  170. })
  171. </script>