index.php 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687
  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. <!-- 导航栏开始-->
  57. <?php include(Yii::app()->basePath.'/views/layouts/class_navigation.php');?>
  58. <!-- 导航栏结束-->
  59. <style>
  60. .clearfix:after{content:'';display: block;clear: both;height:0;visibility: hidden;}
  61. .fl{float: left;}
  62. table{ border-collapse:collapse;}
  63. td{border:1px solid #ccc;border-spacing:0;width:100px;}
  64. tr:last-child td{border-bottom:0}
  65. .box{margin:50px auto;border-bottom:1px solid #ccc;width:500px;}
  66. .left{width:100%;overflow-y: auto}
  67. .right{width:10%;}
  68. .table1{min-width:1200px;}
  69. .table2 td{padding:0 5px!important;}
  70. .selcet-class-type{margin-right:10px}
  71. .change-stu-class{margin-left:10px}
  72. /* Tooltip 容器 */
  73. .tooltipclass {
  74. display: inline-block;
  75. }
  76. /* Tooltip 文本 */
  77. .tooltipclass .tooltiptext {
  78. visibility: hidden;
  79. width: 160px;
  80. background-color: #555;
  81. color: #fff;
  82. padding: 5px;
  83. border-radius: 6px;
  84. font-size:11px;
  85. text-align: left;
  86. /* 定位 */
  87. position: absolute;
  88. z-index: 1;
  89. }
  90. /* 鼠标移动上去后显示提示框 */
  91. .tooltipclass:hover .tooltiptext {
  92. visibility: visible;
  93. }
  94. </style>
  95. <div class="page-content">
  96. <div class="row" style="margin:0px;">
  97. <div class="col-xs-12">
  98. <!-- PAGE CONTENT BEGINS -->
  99. <div id="dynamic-table_wrapper" class="dataTables_wrapper form-inline no-footer">
  100. <div class="row">
  101. <form method="get" action="<?php echo $this->createUrl('studentinfo/index');?>">
  102. <div class="col-xs-7">
  103. <div class="dataTables_length margin-zy">
  104. <div class='diy_select1' style="display: inline;margin-right: 5px;border: 1px solid #c9ccd2; width: 131px">
  105. <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;}?>"/>
  106. <div class='diy_select_txt1'><?php if(empty($grade_id)){echo '请选择年级';}else{ echo Yii::app()->params['grade_list'][$grade_id]['grade_name'];}?></div>
  107. <input type='hidden' id="zhuanban-class" name="zhuanban-class" value="0"/>
  108. <div class='diy_select_btn1'></div>
  109. <ul class='diy_select_list1'>
  110. <li val="0" >请选择年级</li>
  111. <?php
  112. if(Yii::app()->params['grade_config']){
  113. foreach (Yii::app()->params['grade_config'] as $val){
  114. echo '<li val="'.$val['id'].'" >'.$val['grade_name'].'</li>';
  115. }
  116. }
  117. ?>
  118. </ul>
  119. </div>
  120. <?php if(!empty($classInfo)):?>
  121. <div class='diy_select' style="width: 131px">
  122. <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;}?>"/>
  123. <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>
  124. <div class='diy_select_btn'></div>
  125. <ul class='diy_select_list'>
  126. <li val="0">请选择班级</li>
  127. <?php if(empty($grade_id) || empty($grade_class)){echo '';}else{ foreach ($grade_class as $v)
  128. {?>
  129. <li val="<?php echo $v['class_id']?>"><?php echo $v['class_name']?></li>
  130. <?php }}?>
  131. </ul>
  132. </div>
  133. <?php endif;?>
  134. <div class='diy_select2' style="width: 131px;margin-left: 10px">
  135. <?php
  136. if(!$search_type) $search_type=1;
  137. $select_txt2='';
  138. switch ($search_type){
  139. case 1:
  140. $select_txt2='姓名';
  141. break;
  142. case 2:
  143. $select_txt2='登录账号';
  144. break;
  145. case 3:
  146. $select_txt2='系统准考证';
  147. break;
  148. case 4:
  149. $select_txt2='学校准考证';
  150. break;
  151. case 4:
  152. $select_txt2='智学网准考证';
  153. break;
  154. default:
  155. if(isset($studentextend)){
  156. foreach ($studentextend as $key => $val){
  157. if($search_type==$key){
  158. $select_txt2=$val['field_mean'];
  159. }
  160. }
  161. }
  162. }
  163. ?>
  164. <input type='hidden' id="class_id" name="search_type" class='diy_select_input2' value="<?php echo $search_type;?>"/>
  165. <div class='diy_select_txt2'><?php echo $select_txt2; ?></div>
  166. <div class='diy_select_btn2'></div>
  167. <ul class='diy_select_list2'>
  168. <li val="1">姓名</li>
  169. <li val="2">登录账号</li>
  170. <li val="3">系统准考证</li>
  171. <li val="4">学校准考证</li>
  172. <li val="5">智学网准考证</li>
  173. <?php
  174. if(isset($studentExtend)){
  175. foreach ($studentExtend as $key => $val){
  176. if($val['is_enable']==1){
  177. echo '<li val="'.$key.'">'.$val['field_mean'].'</li>';
  178. }
  179. }
  180. }
  181. ?>
  182. </ul>
  183. </div>
  184. <input type="text" class="form-control input-sm" placeholder="请输入" name="realname" value="<?php if(!empty($realname)){echo $realname;}?>">
  185. <!--<button class="btn btn-minier btn-primary">搜索</button>-->
  186. <button class="label-primary-s bth-s" id="search" style="padding:4px 12px;">搜索</button>
  187. </div>
  188. </div>
  189. </form>
  190. <?php if(!isset(Yii::app()->session['session_semester_state'])):?>
  191. <div class="col-xs-4 fr" style="width: 15%">
  192. <div id="dynamic-table_filter" class="dataTables_filter mt5">
  193. <a class="btn btn-success btn-sm" href="<?php echo $this->createUrl('studentinfo/add');?>">
  194. <i class="fa fa-plus" style="font-style: normal;"></i> 添加学生
  195. </a>
  196. <a class="btn btn-success btn-sm" href="<?php echo $this->createUrl('importstudent/index');?>">
  197. <i class="fa fa-plus" style="font-style: normal;"></i> 导入学生
  198. </a>
  199. <?php /*if(!isset(Yii::app()->session["crmUserInfo"])){*/?><!--
  200. <?php /*if($use_zhixue){*/?>
  201. <a class="btn btn-success btn-sm" href="<?php /*echo $this->createUrl("classes/zhixue_student");*/?>">
  202. <i class="fa fa-plus" style="font-style: normal;"></i> 关联智学网考号
  203. </a><?php /*}*/?>
  204. <a class="btn btn-success btn-sm" href="<?php /*echo $this->createUrl('studentinfo/schoolcard');*/?>">
  205. <i class="fa fa-plus" style="font-style: normal;"></i> 导入学校准考证号
  206. </a>
  207. --><?php /*}*/?>
  208. <!--
  209. <a class="btn btn-success btn-sm" href="<?php echo $this->createUrl('classes/resetpwd');?>">
  210. <i class="fa fa-plus" style="font-style: normal;"></i> 重置学生密码
  211. </a>
  212. <?php if(isset($waitStudent) && $waitStudent>0):?>
  213. <a class="btn btn-success btn-sm fr" href="<?php echo $this->createUrl('studentinfo/waitlist');?>">
  214. <i class="fa fa-plus" style="font-style: normal;"></i> 待分班学生(<?php echo $waitStudent?>)
  215. </a>
  216. <?php endif;?>
  217. <a class="btn btn-success btn-sm" href="<?php echo $this->createUrl('checkstudent/index');?>">
  218. <i class="fa fa-plus" style="font-style: normal;"></i> 学生账号检测
  219. </a>
  220. <?php if(Yii::app()->params['section']==1):?>
  221. <a class="btn btn-success btn-sm" href="<?php echo $this->createUrl('studentinfo/target');?>">
  222. <i class="fa fa-plus" style="font-style: normal;"></i> 目标院校管理
  223. </a>
  224. <?php endif;?>
  225. <a class="btn btn-success btn-sm" href="<?php echo $this->createUrl('studentinfo/level');?>">
  226. 学生能力等级
  227. </a>
  228. -->
  229. </div>
  230. </div>
  231. <?php endif;?>
  232. </div>
  233. <div class="clearfix">
  234. <div class="fl left">
  235. <table id="dynamic-table" class="table table1 table-striped table-bordered table-hover dataTable no-footer DTTT_selectable">
  236. <thead>
  237. <tr>
  238. <th>姓名</th>
  239. <th>身份证号</th>
  240. <th>班级</th>
  241. <th id="my_sort" class="sorting" onclick="student_sort(<?php if(empty($sort)){echo 1;}else{echo $sort;}?>)">学号</th>
  242. <th>班级序号</th>
  243. <th>登录账号</th>
  244. <th>准考证</th>
  245. <th>学校准考证</th>
  246. <?php if($use_zhixue)
  247. {?>
  248. <th>智学网准考证</th>
  249. <?php }?>
  250. <?php
  251. if(isset($studentExtend)){
  252. foreach ($studentExtend as $key=>$val){
  253. if($val['is_enable']==1){
  254. echo '<th>'.$val['field_mean'].'</th>';
  255. }
  256. }
  257. }
  258. ?>
  259. <th>性别</th>
  260. <th>是否为在籍生</th>
  261. <!--<th>创建时间</th>-->
  262. <th>状态</th>
  263. <th>操作</th>
  264. </tr>
  265. </thead>
  266. <tbody>
  267. <?php
  268. $actionArr=array();
  269. $actionMsgArr=array();
  270. if(!empty($userList)):foreach($userList as $ul):
  271. $actionArr[]=$ul['student_id'];
  272. $actionMsgArr[$ul['student_id']]['stu_name'] = $ul['realname'];
  273. $actionMsgArr[$ul['student_id']]['grade'] = $ul['grade'];
  274. $actionMsgArr[$ul['student_id']]['class_id'] = $ul['class_id'];
  275. ?>
  276. <tr>
  277. <td><?php echo $ul['realname'];?></td>
  278. <td><?php echo $ul['id_number'];?></td>
  279. <td><?php
  280. echo $ul['class_name'];
  281. $classList=array();
  282. $subjectList=array();
  283. if(isset($student_class[$ul['student_id']])){
  284. foreach ($student_class[$ul['student_id']] as $class){
  285. $classList[]=$class['class_name'];
  286. if($class['subject']){
  287. $subjectList[]=implode(',',$class['subject']);
  288. }
  289. }
  290. }
  291. if($classList){
  292. $str="所在教学班:".implode(';',$classList);
  293. if($subjectList){
  294. $str.="<br>所选学科:".implode(';',$subjectList);
  295. }
  296. echo '<div class="tooltipclass">&nbsp;<img src="/images/icon-warning-red.png"><span class="tooltiptext">'.$str.'</span></div>';
  297. }
  298. ?>
  299. </td>
  300. <td><?php echo $ul['userno'];?></td>
  301. <td><?php echo $ul['serial_number'];?></td>
  302. <td><?php echo $ul['username'];?></td>
  303. <td><?php echo isset($ul['student_card'])?$ul['student_card']:'';?></td>
  304. <td><?php echo isset($ul['school_student_card'])?$ul['school_student_card']:'';?></td>
  305. <?php if($use_zhixue)
  306. {?>
  307. <td><?php echo isset($ul['zhixue_student_card'])?$ul['zhixue_student_card']:'';?></td>
  308. <?php }?>
  309. <?php
  310. if(isset($studentExtend)){
  311. foreach ($studentExtend as $key=>$val){
  312. if($val['is_enable']==1){
  313. if(isset($ul[$key])){
  314. echo '<td>'.$ul[$key].'</td>';
  315. }else{
  316. echo '<td></td>';
  317. }
  318. }
  319. }
  320. }
  321. ?>
  322. <td><?php if($ul['sex'] == 1){echo '男';}else{echo '女';}?></td>
  323. <td><?php if($ul['is_outer'] == 1){echo '否';}else{echo '是';}?></td>
  324. <!--<td><?php echo date('Y-m-d H:i:s',$ul['add_time']);?></td>-->
  325. <td>
  326. <?php if($ul['status'] == 0):?>
  327. <span class="label label-sm label-success">有效</span>
  328. <?php else:?>
  329. <span class="label label-sm label-warning">无效</span>
  330. <?php endif;?>
  331. </td>
  332. <td style="min-width:114px">
  333. <?php
  334. $ac = $ul['student_id']
  335. ?>
  336. <div class="hidden-sm hidden-xs btn-group">
  337. <span class="iconfont addbx click-sc" title="编辑" onclick="javascript:location.href='<?php echo $this->createUrl('studentinfo/edit', array('stid' => $ac)); ?>'">&#xe77d;</span>
  338. <span class="iconfont addbx click-delete delStudent" title="删除" studentId="<?php echo $ac; ?>">&#xe616;</span>
  339. <span class="iconfont addbx click-sc changeStudent" title="学生转班" studentId="<?php echo $ac; ?>" grade="<?php echo isset($actionMsgArr[$ac]['grade']) ? $actionMsgArr[$ac]['grade'] : ''; ?>" realname="<?php echo isset($actionMsgArr[$ac]['stu_name']) ? $actionMsgArr[$ac]['stu_name'] : ''; ?>" classId="<?php echo isset($actionMsgArr[$ac]['class_id']) ? $actionMsgArr[$ac]['class_id'] : ''; ?>">&#xe68f;</span>
  340. </div>
  341. <div class="hidden-md hidden-lg">
  342. <div class="inline pos-rel">
  343. <button class="btn btn-minier btn-yellow dropdown-toggle" data-toggle="dropdown" data-position="auto">
  344. <i class="ace-icon fa fa-caret-down icon-only bigger-120"></i>
  345. </button>
  346. <ul class="dropdown-menu dropdown-only-icon dropdown-yellow dropdown-menu-right dropdown-caret dropdown-close">
  347. <li>
  348. <a class="tooltip-success green" data-rel="tooltip" title="编辑" href="<?php echo $this->createUrl('studentinfo/edit', array('stid' => $ac)); ?>">编辑</a>
  349. </li>
  350. </ul>
  351. </div>
  352. </div>
  353. <?php
  354. ?>
  355. </td>
  356. </tr>
  357. <?php endforeach;else:?>
  358. <?php if($use_zhixue)
  359. {?>
  360. <tr><td colspan="11">暂无数据!</td></tr>
  361. <?php }else{
  362. ?>
  363. <tr><td colspan="10">暂无数据!</td></tr>
  364. <?php }?>
  365. <?php endif;?>
  366. </tbody>
  367. </table>
  368. </div>
  369. <!-- <div class="fl right">
  370. <table class="table2 table table-striped table-bordered table-hover dataTable no-footer DTTT_selectable">
  371. <thead>
  372. <tr><th>操作</th></tr>
  373. </thead>
  374. <?php
  375. if($actionArr){
  376. foreach ($actionArr as $ac){
  377. if($ac) {
  378. ?>
  379. <tr>
  380. <td>
  381. <div class="hidden-sm hidden-xs btn-group">
  382. <span class="iconfont addbx click-sc" title="编辑"
  383. onclick="javascript:location.href='<?php echo $this->createUrl('studentinfo/edit', array('stid' => $ac)); ?>'">&#xe77d;</span>
  384. <span class="iconfont addbx click-delete delStudent" title="删除"
  385. studentId="<?php echo $ac; ?>">&#xe616;</span>
  386. <span class="iconfont addbx click-sc changeStudent" title="学生转班"
  387. studentId="<?php echo $ac; ?>" grade="<?php echo isset($actionMsgArr[$ac]['grade'])?$actionMsgArr[$ac]['grade']:'';?>" realname="<?php echo isset($actionMsgArr[$ac]['stu_name'])?$actionMsgArr[$ac]['stu_name']:'';?>" classId="<?php echo isset($actionMsgArr[$ac]['class_id'])?$actionMsgArr[$ac]['class_id']:'';?>">&#xe68f;</span>
  388. </div>
  389. <div class="hidden-md hidden-lg">
  390. <div class="inline pos-rel">
  391. <button class="btn btn-minier btn-yellow dropdown-toggle"
  392. data-toggle="dropdown" data-position="auto">
  393. <i class="ace-icon fa fa-caret-down icon-only bigger-120"></i>
  394. </button>
  395. <ul class="dropdown-menu dropdown-only-icon dropdown-yellow dropdown-menu-right dropdown-caret dropdown-close">
  396. <li>
  397. <a class="tooltip-success green" data-rel="tooltip"
  398. title="编辑"
  399. href="<?php echo $this->createUrl('studentinfo/edit', array('stid' => $ac)); ?>">编辑</a>
  400. </li>
  401. </ul>
  402. </div>
  403. </div>
  404. </td>
  405. </tr>
  406. <?php
  407. }else{
  408. echo '<tr><td>--</td></tr>';
  409. }
  410. }
  411. }
  412. ?>
  413. </table>
  414. </div> -->
  415. </div>
  416. <?php if(!empty($page_total)):?>
  417. <div class="row">
  418. <div class="col-xs-7">
  419. &nbsp;
  420. </div>
  421. <div class="col-xs-5">
  422. <div class="dataTables_paginate paging_simple_numbers">
  423. <?php
  424. $this->widget('CLinkPager', array(
  425. 'header' => '',
  426. 'firstPageLabel'=> '首页',
  427. 'lastPageLabel' => '末页',
  428. 'prevPageLabel' => '上一页',
  429. 'nextPageLabel' => '下一页',
  430. 'pages' => $pages,
  431. 'maxButtonCount'=> 5,
  432. ));
  433. echo '共:'.$page_total.'条';
  434. ?>
  435. </div>
  436. </div>
  437. </div>
  438. <?php endif;?>
  439. </div>
  440. <!-- PAGE CONTENT ENDS -->
  441. </div>
  442. </div>
  443. </div>
  444. </div>
  445. <script src="/js/layer/layer.js"></script>
  446. <script type="text/javascript">
  447. // 初始化学号排序图标
  448. $(function(){
  449. initHeight();
  450. function initHeight(){
  451. $('.table1 tr').each(function(index,val){
  452. $('.table2 tr').eq(index).height($(val).height());
  453. console.log($(val).height())
  454. })
  455. }
  456. $(window).resize(function(){
  457. initHeight();
  458. })
  459. var init_sort = '<?php echo $sort;?>';
  460. if ($.trim(init_sort) == '') {
  461. $('#my_sort').attr('class','sorting');
  462. } else if ($.trim(init_sort) == '1') {
  463. $('#my_sort').attr('class','sorting_desc');
  464. } else if ($.trim(init_sort) == '2') {
  465. $('#my_sort').attr('class','sorting_asc');
  466. }
  467. $(".diy_select1").click(function(){
  468. var grade = $(".diy_select1 input[class=diy_select_input1]").val();
  469. if(grade==0)
  470. {
  471. $(".diy_select input[class=diy_select_input]").val(0);
  472. $(".diy_select_txt").text("请选择班级");
  473. $(".diy_select_list li").text("请选择班级");
  474. $(".diy_select_list li").attr("val",0);
  475. }
  476. $.post("<?php echo $this->createUrl('classes/getclass');?>",{grade_id:grade,filter_hide:1},function(data){
  477. var m = JSON.parse(data);
  478. if(m.status==0)
  479. {
  480. $(".diy_select input[class=diy_select_input]").val(0);
  481. $(".diy_select_txt").text("请选择班级");
  482. $(".diy_select_list").empty();
  483. var html = '<li val="0">请选择班级</li>';
  484. $(".diy_select_list").html(html);
  485. }else{
  486. $(".diy_select input[class=diy_select_input]").val(0);
  487. $(".diy_select_txt").text("请选择班级");
  488. $(".diy_select_list").empty();
  489. var html = '<li val="0">请选择班级</li>';
  490. $.each(m.result,function(i,n){
  491. html+='<li val="'+ n.class_id+'">'+ n.class_name+'</li>';
  492. });
  493. $(".diy_select_list").html(html);
  494. }
  495. });
  496. });
  497. });
  498. // ajax获取班级
  499. function getClass(num) {
  500. if (!num) return;
  501. $.post("<?php echo $this->createUrl('classes/ajaxclass');?>",{smid:num},function(data){
  502. var p = eval("("+data+")");
  503. if (p.flag) {
  504. var html;
  505. var cityObj = $("#class_id");
  506. cityObj.show();
  507. cityObj.empty();
  508. if (p.classList.length > 0){
  509. html = "<option value=''>请选择班级</option>";
  510. $.each(p.classList,function(i,n){
  511. html += "<option <?php if(!empty($class_id) && $class_id == "+n.class_id+"){echo 'selected';}?> value='"+n.class_id+"'>" + n.class_name + "</option>";
  512. });
  513. } else {
  514. html = "<option value=''>暂无班级</option>";
  515. }
  516. cityObj.append(html);
  517. } else {
  518. alert("获取数据失败!");
  519. }
  520. });
  521. }
  522. // 缴费操作
  523. function cancelPay(uid){
  524. if (!uid) return;
  525. layer.open({
  526. type: 2,
  527. skin: 'layui-layer-lan',
  528. title: '设置用户缴费',
  529. fix: false,
  530. shadeClose: true,
  531. maxmin: true,
  532. area: ['1000px', '375px'],
  533. content: "<?php echo $this->createUrl('payment/add');?>/stid/"+uid,
  534. });
  535. }
  536. // 学号排序操作
  537. function student_sort(sum){
  538. /*var obj_sort = $('#my_sort');
  539. if (sum == 1) {
  540. obj_sort.attr('class','sorting_asc');
  541. } else if (sum == 2) {
  542. obj_sort.attr('class','sorting_desc');
  543. } else {
  544. obj_sort.attr('class','sorting');
  545. }*/
  546. window.location.href = '<?php echo $this->createUrl('studentinfo/index');?>'+'/sort/'+sum;
  547. }
  548. //转班获取班级
  549. function getClassByGrade(grade){
  550. var class_id = $("#zhuanban-class").val();
  551. $.post("<?php echo $this->createUrl('classes/getclass');?>",{grade_id:grade,filter_hide:1},function(data){
  552. var class_html = '';
  553. data = eval('(' + data + ')');
  554. if(data.status == 1){
  555. class_html += '<select class="select-class">';
  556. for(var i in data.result){
  557. if(class_id == data.result[i].class_id){
  558. class_html += '<option selected="selected" value="'+data.result[i].class_id+'">'+data.result[i].class_name+'</option>';
  559. }else{
  560. class_html += '<option value="'+data.result[i].class_id+'">'+data.result[i].class_name+'</option>';
  561. }
  562. }
  563. class_html += '</select>';
  564. }
  565. $(".change-stu-class").html(class_html);
  566. });
  567. }
  568. $("body").delegate(".all-select-option","change",function(){
  569. var grade = $(this).val();
  570. getClassByGrade(grade);
  571. });
  572. //单个学生转班
  573. $("body").delegate(".changeStudent","click",function(){
  574. var realname = $(this).attr("realname");
  575. var classId = $(this).attr("classId");
  576. var grade = $(this).attr("grade");
  577. var student_id = $(this).attr("studentId");
  578. // var checked1 = '';
  579. // var checked2 = '';
  580. // var checked3 = '';
  581. // if(grade == 1){
  582. // var checked1 = "checked='checked'";
  583. // }else if(grade == 2){
  584. // var checked2 = "checked='checked'";
  585. // }else if(grade == 3){
  586. // var checked3 = "checked='checked'";
  587. // }
  588. $("#zhuanban-class").val(classId);
  589. var str = '<div id="hgc_editor" style="padding:20px 35px;">';
  590. str += '<div>转移学生到:';
  591. <?php foreach(Yii::app()->params['grade_config'] as $k=>$v):?>
  592. if(grade == <?php echo $v['id']?>){
  593. var check_str = "checked='checked'";
  594. }else{
  595. var check_str = "";
  596. }
  597. str += '<input type="radio" name="change-grade[]" value="<?php echo $v['id'];?>" '+check_str+' class="all-select-option" ><span class="selcet-class-type"><?php echo $v['grade_name'];?></span>';
  598. <?php endforeach;?>
  599. str += '</div>'
  600. str += '<div>';
  601. str += realname+' -------';
  602. str += '<span class="change-stu-class"></span>'
  603. str += '</div>';
  604. str += ' </div>';
  605. layer.open({
  606. title:'学生转班'
  607. ,area:'500px'
  608. ,type: 1
  609. ,offset: 'auto'
  610. ,content: str
  611. ,btn: ['确定','取消']
  612. ,btnAlign: 'c' //按钮居中
  613. ,shade: 0.6 //不显示遮罩
  614. ,yes:function(){
  615. var class_id = $(".select-class").val();
  616. if(class_id){
  617. var class_array = [];
  618. class_array.push(student_id);
  619. var semester_id = '<?php echo $this->semesterId;?>';
  620. $.post("<?php echo $this->createUrl('classes/copy');?>"+"?cid="+class_id,{cid:class_id,class_array:class_array,semester_id:semester_id,class_id:classId,is_ajax:1},function(data){
  621. data = eval('(' + data + ')');
  622. if(data.status == 1){
  623. msg = "操作成功";
  624. icon = 6;
  625. layer.closeAll();
  626. layer.alert(msg, {icon: icon}, function(index){
  627. // layer.close(index);
  628. window.location.reload();
  629. });
  630. // window.location.reload();
  631. }
  632. });
  633. }
  634. }
  635. });
  636. if(grade){
  637. getClassByGrade(grade);
  638. }
  639. });
  640. </script>