index.php 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. <div class="main-content-inner">
  2. <div class="breadcrumbs" id="breadcrumbs">
  3. <ul class="breadcrumb">
  4. <li>
  5. <i class="ace-icon fa fa-home home-icon"></i>
  6. <a>首页</a>
  7. </li>
  8. <li>
  9. <a>学生管理</a>
  10. </li>
  11. <li class="active">学生列表</li>
  12. </ul>
  13. </div>
  14. <div class="page-content">
  15. <div class="row">
  16. <div class="col-xs-12">
  17. <!-- PAGE CONTENT BEGINS -->
  18. <div id="dynamic-table_wrapper" class="dataTables_wrapper form-inline no-footer">
  19. <div class="row">
  20. <form method="get" action="<?php echo $this->createUrl('userinfo/index');?>">
  21. <div class="col-xs-10">
  22. <div class="dataTables_length margin-zy">
  23. <select class="form-control" name="years_id" onchange="changeYears(this.value);">
  24. <option value="">请选择年级</option>
  25. <?php if(!empty($yearsInfo)):foreach($yearsInfo as $loop):?>
  26. <option <?php if(!empty($years_id) && $years_id == $loop->years_id){echo 'selected';}?> value="<?php echo $loop->years_id;?>"><?php echo $loop->years_name;?></option>
  27. <?php endforeach;endif;?>
  28. </select>
  29. <select class="form-control" id="class_id" name="class_id" <?php if(empty($class_id)){echo 'style="display:none;"';}?>>
  30. <?php if(!empty($classInfo)):foreach($classInfo as $lp):?>
  31. <option <?php if(!empty($class_id) && $class_id == $lp->class_id){echo 'selected';}?> value="<?php echo $lp->class_id;?>"><?php echo $lp->class_name;?></option>
  32. <?php endforeach;endif;?>
  33. </select>
  34. <input type="text" class="form-control input-sm" placeholder="请输入姓名!" name="realname" value="<?php if(!empty($realname)){echo $realname;}?>">
  35. <button class="btn btn-minier btn-primary">搜索</button>
  36. </div>
  37. </div>
  38. </form>
  39. <div class="col-xs-2">
  40. <div id="dynamic-table_filter" class="dataTables_filter">
  41. <a class="btn btn-primary btn-sm" href="<?php echo $this->createUrl('userinfo/add');?>">
  42. <i class="fa fa-plus" style="font-style: normal;"></i> 添加学生
  43. </a>
  44. </div>
  45. </div>
  46. </div>
  47. <table id="dynamic-table" class="table table-striped table-bordered table-hover dataTable no-footer DTTT_selectable">
  48. <thead>
  49. <tr>
  50. <th>姓名</th>
  51. <th>学号</th>
  52. <th>登录账号</th>
  53. <th>年级</th>
  54. <th>班级</th>
  55. <th>创建时间</th>
  56. <th>操作</th>
  57. </tr>
  58. </thead>
  59. <tbody>
  60. <?php if(!empty($userList)):foreach($userList as $ul):?>
  61. <tr>
  62. <td><?php echo $ul['realname'];?></td>
  63. <td><?php echo $ul['userno'];?></td>
  64. <td><?php echo $ul['username'];?></td>
  65. <td><?php echo $ul['years_name'];?></td>
  66. <td><?php echo $ul['class_name'];?></td>
  67. <td><?php echo date('Y-m-d H:i:s',$ul['add_time']);?></td>
  68. <td>
  69. <div class="hidden-sm hidden-xs action-buttons">
  70. <a class="green" title="编辑" href="<?php echo $this->createUrl('userinfo/edit',array('uuid'=>$ul['uuid']));?>">编辑
  71. <!-- <i class="ace-icon fa fa-pencil bigger-130"></i> -->
  72. </a>
  73. <a class="red" title="缴费" onclick="cancelPay('<?php echo $ul['uuid'];?>')" href="javascript:void(0)">缴费
  74. <!-- <i class="ace-icon fa fa-trash-o bigger-130"></i> -->
  75. </a>
  76. </div>
  77. </td>
  78. </tr>
  79. <?php endforeach;endif;?>
  80. </tbody>
  81. </table>
  82. <div class="row">
  83. <div class="col-xs-6">
  84. &nbsp;
  85. </div>
  86. <div class="col-xs-6">
  87. <div class="dataTables_paginate paging_simple_numbers">
  88. <?php
  89. $this->widget('CLinkPager', array(
  90. 'header' => '',
  91. 'firstPageLabel'=> '首页',
  92. 'lastPageLabel' => '末页',
  93. 'prevPageLabel' => '上一页',
  94. 'nextPageLabel' => '下一页',
  95. 'pages' => $pages,
  96. 'maxButtonCount'=> 5,
  97. ));
  98. echo '共:'.$page_total.'条';
  99. ?>
  100. </div>
  101. </div>
  102. </div>
  103. </div>
  104. <!-- PAGE CONTENT ENDS -->
  105. </div>
  106. </div>
  107. </div>
  108. </div>
  109. <script src="/js/layer/layer.js"></script>
  110. <script type="text/javascript">
  111. // ajax获取班级
  112. function changeYears(num) {
  113. if (!num) return;
  114. $.post("<?php echo $this->createUrl('classes/ajaxclass');?>",{yid:num},function(data){
  115. var p = eval("("+data+")");
  116. if (p.flag) {
  117. var html;
  118. var cityObj = $("#class_id");
  119. cityObj.show();
  120. cityObj.empty();
  121. if (p.classList.length > 0){
  122. html = "<option value=''>请选择班级</option>";
  123. $.each(p.classList,function(i,n){
  124. html += "<option <?php if(!empty($class_id) && $class_id == "+n.class_id+"){echo 'selected';}?> value='"+n.class_id+"'>" + n.class_name + "</option>";
  125. });
  126. } else {
  127. html = "<option value=''>暂无班级</option>";
  128. }
  129. cityObj.append(html);
  130. } else {
  131. alert("获取数据失败!");
  132. }
  133. });
  134. }
  135. function cancelPay(uid){//alert(uid);return;
  136. if (!uid) return;
  137. layer.open({
  138. type: 2,
  139. skin: 'layui-layer-lan',
  140. title: '设置用户缴费信息',
  141. fix: false,
  142. shadeClose: true,
  143. maxmin: true,
  144. area: ['1000px', '500px'],
  145. content: "<?php echo $this->createUrl('payment/add');?>/uuid/"+uid,
  146. });
  147. }
  148. </script>