index_prev_semester.php 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615
  1. <script src="/js/xsgl.js"></script>
  2. <script type="text/javascript">
  3. jQuery(document).ready(function(){
  4. jQuery(".kick").click(function(){
  5. document.studentId = jQuery(this).attr("studentId");
  6. layer.msg('确定踢出?', {
  7. time: 0,
  8. btn: ['确定', '取消'],
  9. yes: function(index){
  10. layer.close(index);
  11. jQuery.post(
  12. "<?php echo $this->createUrl("studentinfo/kick");?>",
  13. {"studentId": document.studentId},
  14. function(data){
  15. msg = "操作成功";
  16. icon = 6;
  17. layer.alert(msg, {icon: icon}, function(index){
  18. layer.close(index);
  19. });
  20. }
  21. );
  22. }
  23. });
  24. });
  25. jQuery(".delStudent").click(function(){
  26. document.studentId = jQuery(this).attr("studentId");
  27. layer.msg('确定从本班中删除该学生?', {
  28. time: 0,
  29. btn: ['确定', '取消'],
  30. yes: function(index){
  31. layer.close(index);
  32. jQuery.post(
  33. "<?php echo $this->createUrl("studentinfo/delstudentact");?>",
  34. {"studentId": document.studentId, "classId": "<?php echo $class_id;?>"},
  35. function(data){
  36. data = eval("("+data+")");
  37. if(data.code == "0"){
  38. msg = data.msg;
  39. icon = 6;
  40. }
  41. else{
  42. msg = "因为以下原因操作失败:<br/>"+data.msg;
  43. icon = 5;
  44. }
  45. layer.alert(msg, {icon: icon}, function(){
  46. location.href = "<?php echo $this->createUrl("studentinfo/index?class_id={$class_id}");?>";
  47. });
  48. }
  49. );
  50. }
  51. });
  52. });
  53. });
  54. </script>
  55. <div class="main-content-inner">
  56. <ul class="clearfix main-content-inner-ul">
  57. <?php if(Yii::app()->session['coachInfo']['leader']==1){?>
  58. <li class="pull-left">
  59. <button onclick='location.href="<?php echo $this->createUrl("semester/index");?>"' class="button button_normal button_group button_arrow" data-button="red">学期管理</button>
  60. <img src="/images/line.jpg" style="height:45px;" />
  61. </li>
  62. <?php }?>
  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 button_active" 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">
  87. <div class="row" style="margin:0px;">
  88. <div class="col-xs-12">
  89. <!-- PAGE CONTENT BEGINS -->
  90. <div id="dynamic-table_wrapper" class="dataTables_wrapper form-inline no-footer">
  91. <div class="row">
  92. <form method="get" action="<?php echo $this->createUrl('studentinfo/waitlist');?>">
  93. <div class="col-xs-7">
  94. <div class="dataTables_length margin-zy">
  95. <div class='diy_select1' style="display: inline;margin-right: 5px;border: 1px solid #c9ccd2; width: 131px">
  96. <input type='hidden' id="grade_id" name="grade_id" class='diy_select_input1' value="<?php if(empty($grade_id)){echo 0;}else{echo $grade_id;}?>"/>
  97. <div class='diy_select_txt1'><?php if(empty($grade_id)){echo '请选择历史年级';}else{ switch($grade_id){
  98. case 1:echo '高一';break;
  99. case 2:echo '高二';break;
  100. case 3:echo '高三';break;
  101. }}?></div>
  102. <div class='diy_select_btn1'></div>
  103. <ul class='diy_select_list1'>
  104. <li val="0" >请选择历史年级</li>
  105. <li val="1">高一</li>
  106. <li val="2">高二</li>
  107. <li val="3">高三</li>
  108. </ul>
  109. </div>
  110. <?php if(!empty($classInfo)):?>
  111. <div class='diy_select' style="width: 131px">
  112. <input type='hidden' id="class_id" name="class_id" class='diy_select_input' value="<?php if(empty($grade_id) || empty($grade_class) || empty($class_id)){echo 0;}else{echo $class_id;}?>"/>
  113. <div class='diy_select_txt'><?php if(empty($grade_id) || empty($class_id) || empty($grade_class)){echo '请选择历史班级';}else{ if(isset($grade_class[$class_id]) && !empty($grade_class[$class_id])){ echo $grade_class[$class_id]['class_name'];}}?></div>
  114. <div class='diy_select_btn'></div>
  115. <ul class='diy_select_list'>
  116. <li val="0">请选择历史班级</li>
  117. <?php if(empty($grade_id) || empty($grade_class)){echo '';}else{ foreach ($grade_class as $v)
  118. {?>
  119. <li val="<?php echo $v['class_id']?>"><?php echo $v['class_name']?></li>
  120. <?php }}?>
  121. </ul>
  122. </div>
  123. <?php endif;?>
  124. <div class='diy_select2' style="width: 131px;margin-left: 10px">
  125. <input type='hidden' id="class_id" name="search_type" class='diy_select_input2' value="<?php if($search_type==1||!$search_type ){echo 1;}if($search_type==2 ){echo 2;}if($search_type==3 ){echo 3;}if($search_type==4 ){echo 4;}if($search_type==5 ){echo 5;}?>"/>
  126. <div class='diy_select_txt2'><?php if($search_type==1 ||!$search_type){echo '姓名';}if($search_type==2 ){echo '登录账号';}if($search_type==3 ){echo '系统准考证';}if($search_type==4 ){echo '学校准考证';}if($search_type==5 ){echo '智学网准考证';}?></div>
  127. <div class='diy_select_btn2'></div>
  128. <ul class='diy_select_list2'>
  129. <li val="1">姓名</li>
  130. <li val="2">登录账号</li>
  131. <li val="3">系统准考证</li>
  132. <li val="4">学校准考证</li>
  133. <?php if($use_zhixue)
  134. {?>
  135. <li val="5">智学网准考证</li>
  136. <?php }?>
  137. </ul>
  138. </div>
  139. <input type="text" class="form-control input-sm" placeholder="请输入" name="realname" value="<?php if(!empty($realname)){echo $realname;}?>">
  140. <!--<button class="btn btn-minier btn-primary">搜索</button>-->
  141. <button class="label-primary-s bth-s" id="search" style="padding:4px 12px;">搜索</button>
  142. </div>
  143. </div>
  144. </form>
  145. <?php if(!isset(Yii::app()->session['session_semester_state'])):?>
  146. <div class="col-xs-4 fr" style="width: 40%">
  147. <div id="dynamic-table_filter" class="dataTables_filter mt5">
  148. <a class="btn btn-success btn-sm fr" href="">
  149. <i class="fa fa-plus" style="font-style: normal;"></i> 添加到新班级(<span class="checked_count">0</span>)
  150. </a>
  151. </div>
  152. </div>
  153. <?php endif;?>
  154. </div>
  155. <table id="dynamic-table" class="table table-striped table-bordered table-hover dataTable no-footer DTTT_selectable">
  156. <thead>
  157. <tr>
  158. <th><input type="checkbox" name="checkall" value="1"></th>
  159. <th>姓名</th>
  160. <th>历史班级</th>
  161. <th id="my_sort" class="sorting" onclick="student_sort(<?php if(empty($sort)){echo 1;}else{echo $sort;}?>)">学号</th>
  162. <th>历史班级序号</th>
  163. <th>登录账号</th>
  164. <th>准考证</th>
  165. <th>学校准考证</th>
  166. <?php if($use_zhixue)
  167. {?>
  168. <th>智学网准考证</th>
  169. <?php }?>
  170. <th>性别</th>
  171. <th>是否为在籍生</th>
  172. <!--<th>创建时间</th>-->
  173. <th>状态</th>
  174. <th>操作</th>
  175. </tr>
  176. </thead>
  177. <tbody>
  178. <?php if(!empty($userList)):foreach($userList as $ul):?>
  179. <tr>
  180. <td><input type="checkbox" class="assign" name="assign" value="<?php echo $ul['student_id']?>"></td>
  181. <td><?php echo $ul['realname'];?></td>
  182. <td><?php echo $ul['class_name'];?></td>
  183. <td><?php echo $ul['userno'];?></td>
  184. <td><?php echo $ul['serial_number'];?></td>
  185. <td><?php echo $ul['username'];?></td>
  186. <td><?php echo isset($ul['student_card'])?$ul['student_card']:'';?></td>
  187. <td><?php echo isset($ul['school_student_card'])?$ul['school_student_card']:'';?></td>
  188. <?php if($use_zhixue)
  189. {?>
  190. <td><?php echo isset($ul['zhixue_student_card'])?$ul['zhixue_student_card']:'';?></td>
  191. <?php }?>
  192. <td><?php if($ul['sex'] == 1){echo '男';}else{echo '女';}?></td>
  193. <td><?php if($ul['is_outer'] == 1){echo '否';}else{echo '是';}?></td>
  194. <!--<td><?php echo date('Y-m-d H:i:s',$ul['add_time']);?></td>-->
  195. <td>
  196. <?php if($ul['status'] == 0):?>
  197. <span class="label label-sm label-success">有效</span>
  198. <?php else:?>
  199. <span class="label label-sm label-warning">无效</span>
  200. <?php endif;?>
  201. </td>
  202. <td>
  203. <?php if($this->schoolManager->isCurrentSemester($semester_id)):?>
  204. <div class="hidden-sm hidden-xs btn-group">
  205. <span class="iconfont addbx click-sc" title="编辑" onclick="javascript:location.href='<?php echo $this->createUrl('studentinfo/edit',array('stid'=>$ul['student_id']));?>'">&#xe77d;</span>
  206. <!--<span title="踢出" class="iconfont addbx click-sc kick" studentId="<?php echo $ul['student_id'];?>">&#xe640;</span>-->
  207. <span class="iconfont addbx click-delete delStudent" title="删除" studentId="<?php echo $ul['student_id'];?>">&#xe616;</span>
  208. </div>
  209. <div class="hidden-md hidden-lg">
  210. <div class="inline pos-rel">
  211. <button class="btn btn-minier btn-yellow dropdown-toggle" data-toggle="dropdown" data-position="auto">
  212. <i class="ace-icon fa fa-caret-down icon-only bigger-120"></i>
  213. </button>
  214. <ul class="dropdown-menu dropdown-only-icon dropdown-yellow dropdown-menu-right dropdown-caret dropdown-close">
  215. <li>
  216. <a class="tooltip-success green" data-rel="tooltip" title="编辑" href="<?php echo $this->createUrl('studentinfo/edit',array('stid'=>$ul['student_id']));?>">编辑</a>
  217. </li>
  218. </ul>
  219. </div>
  220. </div>
  221. <?php else:?>
  222. --
  223. <?php endif;?>
  224. </td>
  225. </tr>
  226. <?php endforeach;else:?>
  227. <?php if($use_zhixue)
  228. {?>
  229. <tr><td colspan="11">暂无数据!</td></tr>
  230. <?php }else{
  231. ?>
  232. <tr><td colspan="10">暂无数据!</td></tr>
  233. <?php }?>
  234. <?php endif;?>
  235. </tbody>
  236. </table>
  237. <?php if(!empty($page_total)):?>
  238. <div class="row">
  239. <div class="col-xs-7">
  240. &nbsp;
  241. </div>
  242. <div class="col-xs-5">
  243. <div class="dataTables_paginate paging_simple_numbers">
  244. <?php
  245. $this->widget('CLinkPager', array(
  246. 'header' => '',
  247. 'firstPageLabel'=> '首页',
  248. 'lastPageLabel' => '末页',
  249. 'prevPageLabel' => '上一页',
  250. 'nextPageLabel' => '下一页',
  251. 'pages' => $pages,
  252. 'maxButtonCount'=> 5,
  253. ));
  254. echo '共:'.$page_total.'条';
  255. ?>
  256. </div>
  257. </div>
  258. </div>
  259. <?php endif;?>
  260. </div>
  261. <!-- PAGE CONTENT ENDS -->
  262. </div>
  263. </div>
  264. </div>
  265. </div>
  266. <style>
  267. /*弹出层*/
  268. .confirmbox {
  269. background: #fff;
  270. border: 1px solid #cccccc;
  271. border-radius: 3px;
  272. padding: 40px 40px 30px;
  273. text-align: center;
  274. position: fixed;
  275. left: 50%;
  276. top: 50%;
  277. transform: translate(-50%, -50%);
  278. z-index: 99;
  279. }
  280. .confirmbox-mask {
  281. background: rgba(0, 0, 0, .7);
  282. left: 0;
  283. right: 0;
  284. top: 0;
  285. bottom: 0;
  286. z-index: 99;
  287. position: fixed;
  288. }
  289. button {
  290. border: none;
  291. background: #009965;
  292. width: 80px;
  293. height: 26px;
  294. border-radius: 3px;
  295. font-size: 14px;
  296. color: #fff;
  297. outline: none;
  298. cursor: pointer;
  299. }
  300. button.save {
  301. display: block;
  302. margin: 40px auto;
  303. }
  304. .confirmbox .confirmbox-btns {
  305. margin-top: 40px;
  306. }
  307. .class-modal {
  308. width: 500px;
  309. background: #fff;
  310. // border-radius: 5px;
  311. position: absolute;
  312. top: 50%;
  313. left: 50%;
  314. transform: translate(-50%, -50%);
  315. height:170px;
  316. }
  317. .class-modal-head {
  318. font-size: 14px;
  319. background:#2977ff;
  320. color:#fff;
  321. height:25px;
  322. line-height: 25px;
  323. padding: 0 0 0 15px;
  324. }
  325. .class-modal-body {
  326. overflow: auto;
  327. padding:15px;
  328. }
  329. .class-modal-body .classes {
  330. margin-bottom: 20px;
  331. }
  332. .class-modal-body .classes > div {
  333. display: inline-block;
  334. max-width: 640px;
  335. vertical-align: top;
  336. }
  337. .class-modal-body .classes a {
  338. text-decoration: none;
  339. display: inline-block;
  340. margin: 0 5px 5px;
  341. color: #136bfb;
  342. font-size: 14px;
  343. }
  344. .class-modal-body .classes a.active {
  345. color: #fc091b
  346. }
  347. .class-modal .icon-close{
  348. position: absolute;
  349. right: 20px;
  350. top: 2px;
  351. color:#fff;
  352. }
  353. .c-red {
  354. color: #CC3300
  355. }
  356. .avg{
  357. margin:0 10px;
  358. }
  359. .class_btn{
  360. text-align: center;
  361. }
  362. .confirmbox-mask p{
  363. word-wrap : break-word ;
  364. }
  365. .icon-close{
  366. cursor: pointer;
  367. }
  368. .model-input{
  369. padding:5px;
  370. margin-top:10px;
  371. }
  372. .model-input label{
  373. margin:0 15px;
  374. }
  375. </style>
  376. <!-- 弹窗 -->
  377. <div class="confirmbox-mask" style="display: none" id="assignClass">
  378. <div class="class-modal">
  379. <i class="icon close_1 icon-close">×</i>
  380. <div class="class-modal-head">添加到新班级(<span class="checked_count">0</span>)</div>
  381. <div class="class-modal-body">
  382. <div class="model-input first_input">
  383. 请先选择班级:
  384. <select name="toGrade" class="toGrade">
  385. <option value="0">请选择年级</option>
  386. <option value="1">高一</option>
  387. <option value="2">高二</option>
  388. <option value="3">高三</option>
  389. </select>
  390. <select name="toClass" class="toClass">
  391. <option value="0">请选择班级</option>
  392. </select>
  393. </div>
  394. </div>
  395. <p class="class_btn">
  396. <button type="button" class="assign_submit">确定</button>
  397. <button type="button" class="close_1">取消</button>
  398. </p>
  399. </div>
  400. </div>
  401. <script src="/js/layer/layer.js"></script>
  402. <script type="text/javascript">
  403. // 初始化学号排序图标
  404. $(function(){
  405. var init_sort = '<?php echo $sort;?>';
  406. if ($.trim(init_sort) == '') {
  407. $('#my_sort').attr('class','sorting');
  408. } else if ($.trim(init_sort) == '1') {
  409. $('#my_sort').attr('class','sorting_desc');
  410. } else if ($.trim(init_sort) == '2') {
  411. $('#my_sort').attr('class','sorting_asc');
  412. }
  413. $(".diy_select1").click(function(){
  414. var grade = $(".diy_select1 input[class=diy_select_input1]").val();
  415. if(grade==0)
  416. {
  417. $(".diy_select input[class=diy_select_input]").val(0);
  418. $(".diy_select_txt").text("请选择班级");
  419. $(".diy_select_list li").text("请选择班级");
  420. $(".diy_select_list li").attr("val",0);
  421. }
  422. $.post("<?php echo $this->createUrl('studentinfo/getprevsemesterclassbygrade');?>",{grade_id:grade},function(data){
  423. var m = JSON.parse(data);
  424. if(m.status==0)
  425. {
  426. $(".diy_select input[class=diy_select_input]").val(0);
  427. $(".diy_select_txt").text("请选择历史班级");
  428. $(".diy_select_list").empty();
  429. var html = '<li val="0">请选择历史班级</li>';
  430. $(".diy_select_list").html(html);
  431. }else{
  432. $(".diy_select input[class=diy_select_input]").val(0);
  433. $(".diy_select_txt").text("请选择历史班级");
  434. $(".diy_select_list").empty();
  435. var html = '<li val="0">请选择历史班级</li>';
  436. $.each(m.result,function(i,n){
  437. html+='<li val="'+ n.class_id+'">'+ n.class_name+'</li>';
  438. });
  439. $(".diy_select_list").html(html);
  440. }
  441. });
  442. });
  443. //选择学生
  444. $('input[name=assign]').click(function(){
  445. var count=parseInt($('input[name=assign]:checked').length);
  446. var total=parseInt($('input[name=assign]').length);
  447. $('.checked_count').html(count);
  448. if(count==total){
  449. $('input[name=checkall]').attr('checked',true);
  450. }
  451. if(count==0){
  452. $('input[name=checkall]').attr('checked',false);
  453. }
  454. });
  455. $('.btn-success').click(function(){
  456. var count=parseInt($('.checked_count').html());
  457. console.log(count);
  458. if(count==0){
  459. layer.msg('请先选择要分配的学生');
  460. return false;
  461. }
  462. $('#assignClass').show();
  463. return false;
  464. });
  465. $('input[name=checkall]').click(function(){
  466. if($(this).is(':checked')){
  467. $('.assign').prop('checked',true);
  468. var total=parseInt($('input[name=assign]').length);
  469. $('.checked_count').html(total)
  470. }else{
  471. $('.assign').prop('checked',false);
  472. }
  473. });
  474. $('.close_1').click(function(){
  475. $('#assignClass').fadeOut();
  476. });
  477. $('.toGrade').change(function(){
  478. var grade=$(this).val();
  479. getClass(grade);
  480. });
  481. //提交分配
  482. $('.assign_submit').click(function(){
  483. var student=new Array();
  484. $('.assign').each(function(){
  485. if($(this).is(':checked')){
  486. student.push($(this).val());
  487. }
  488. })
  489. var class_id=$('.toClass').val();
  490. if(class_id==0){
  491. layer.msg('请先选择班级');
  492. return false;
  493. }
  494. assign(student,class_id);
  495. });
  496. });
  497. function assign(student,class_id){
  498. if(student.length==0 || class_id==''){
  499. return false;
  500. }
  501. $.ajax({
  502. url:'<?php echo $this->createUrl('studentinfo/assignstudent')?>',
  503. type:'POST',
  504. dataType:'json',
  505. data:{'class_id':class_id,'student_id':student},
  506. success:function(res){
  507. if(res.status==1){
  508. layer.msg('分班成功');
  509. $('#search').click();
  510. }else{
  511. layer.msg('分班失败');
  512. }
  513. }
  514. });
  515. }
  516. // ajax获取班级
  517. function getClass(num) {
  518. if (!num) return;
  519. $.post("<?php echo $this->createUrl('classes/getclass');?>",{grade_id:num},function(data){
  520. var p = JSON.parse(data);
  521. if (p.status) {
  522. var html;
  523. if (p.result.length > 0){
  524. html = "<option value=''>请选择班级</option>";
  525. $.each(p.result,function(i,n){
  526. html += "<option value='"+n.class_id+"'>" + n.class_name + "</option>";
  527. });
  528. } else {
  529. html = "<option value=''>暂无班级</option>";
  530. }
  531. $('.toClass').html(html);
  532. } else {
  533. alert("获取数据失败!");
  534. }
  535. });
  536. }
  537. // 缴费操作
  538. function cancelPay(uid){
  539. if (!uid) return;
  540. layer.open({
  541. type: 2,
  542. skin: 'layui-layer-lan',
  543. title: '设置用户缴费',
  544. fix: false,
  545. shadeClose: true,
  546. maxmin: true,
  547. area: ['1000px', '375px'],
  548. content: "<?php echo $this->createUrl('payment/add');?>/stid/"+uid,
  549. });
  550. }
  551. // 学号排序操作
  552. function student_sort(sum){
  553. /*var obj_sort = $('#my_sort');
  554. if (sum == 1) {
  555. obj_sort.attr('class','sorting_asc');
  556. } else if (sum == 2) {
  557. obj_sort.attr('class','sorting_desc');
  558. } else {
  559. obj_sort.attr('class','sorting');
  560. }*/
  561. window.location.href = '<?php echo $this->createUrl('studentinfo/index');?>'+'/sort/'+sum;
  562. }
  563. </script>