studentshomework.php 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. <div class="main-content-inner">
  2. <ul class="clearfix main-content-inner-ul">
  3. <li class="pull-left">
  4. <button onclick='location.href="<?php echo $this->createUrl("print/index",array('type'=>'wp'));?>"' class="button button_normal button_group button_arrow " data-button="red">打印试卷</button>
  5. <img src="/images/line.jpg" style="height:45px;" />
  6. </li>
  7. <li class="pull-left">
  8. <button onclick='location.href="<?php echo $this->createUrl("print/sub_index",array('type'=>'wtb'));?>"' class="button button_normal button_group button_arrow button_active" data-button="red">下载错题本</button>
  9. <img src="/images/line.jpg" style="height:45px;" />
  10. </li>
  11. <li class="pull-left">
  12. <!--<button onclick='ccc()' class="button button_normal button_group button_arrow" data-button="red">下载提分方案</button>-->
  13. <button onclick='location.href="<?php echo $this->createUrl("print/sub_index",array('type'=>'isp'));?>"' class="button button_normal button_group button_arrow" data-button="red">下载提分方案</button>
  14. <img src="/images/line.jpg" style="height:45px;" />
  15. </li>
  16. <li class="pull-left">
  17. <button onclick='location.href="<?php echo $this->createUrl("export/index");?>"' class="button button_normal button_group button_arrow" data-button="red">导出报告</button>
  18. <img src="/images/line.jpg" style="height:45px;" />
  19. </li>
  20. <li class="pull-left">
  21. <button onclick='location.href="<?php echo $this->createUrl("vacationhomework/classes");?>"' class="button button_normal button_group button_arrow <?php if($printType == 'vh'){echo 'button_active';}?>" data-button="red">下载暑假作业</button>
  22. <img src="/images/line.jpg" style="height:45px;" />
  23. </li>
  24. <li class="pull-left">
  25. <button onclick='location.href="<?php echo $this->createUrl("cylet/index");?>"' class="button button_normal button_group button_arrow" data-button="red">全学科统考</button>
  26. </li>
  27. </ul>
  28. <div class="page-content">
  29. <div class="row" style="margin:0px">
  30. <div class="col-xs-12">
  31. <!-- PAGE CONTENT BEGINS -->
  32. <div id="dynamic-table_wrapper" class="dataTables_wrapper form-inline no-footer">
  33. <div class="row">
  34. <form method="get" id="form1" action="<?php echo $this->createUrl("vacationhomework/students");?>">
  35. <div class="col-xs-10">
  36. <div class="dataTables_length" style="margin: 6px 0px;">
  37. <div class="dataTables_length">
  38. <label><input type="text" class="form-control input-sm" placeholder="请输入学生姓名" name="sname" value="<?php echo $sname;?>"></label>
  39. <!--<button class="btn btn-minier btn-primary" id="search">搜索</button>-->
  40. <button style="padding:4px 12px;"class="label-primary-s bth-s">搜索</button>
  41. </div>
  42. </div>
  43. </div>
  44. <input type="hidden" name="classId" value="<?php echo $class_id;?>" />
  45. </form>
  46. <div class="col-xs-2">
  47. <div class="dataTables_filter" id="dynamic-table_filter">
  48. <a href="javascript:void(0);" class="btn label-primary-green btn-sm" id="selectPrint">
  49. <i style="font-style: normal;" class="fa fa-print"></i> 下载
  50. </a>
  51. </div>
  52. </div>
  53. </div>
  54. <table id="dynamic-table" class="table table-striped table-bordered table-hover dataTable no-footer DTTT_selectable">
  55. <thead>
  56. <tr>
  57. <th class="center">
  58. <input type="checkbox" class="ace selectAll">
  59. </th>
  60. <th>学生名称</th>
  61. <th>班级</th>
  62. <th>学生编号</th>
  63. <th>暑假作业</th>
  64. </tr>
  65. </thead>
  66. <tbody>
  67. <?php if(!empty($rs)):foreach($rs as $rt):?>
  68. <tr>
  69. <td class="center">
  70. <input type="checkbox" <?php if($rt['is_generated'] == 0){echo "disabled='disabled'";}?> class="ace myselect" value="<?php echo $rt['student_id'];?>" stnm="<?php echo $rt['student_id'];?>">
  71. </td>
  72. <td><?php echo $rt['realname'];?></td>
  73. <td><?php echo $rt['student_id'];?></td>
  74. <td><?php echo $rt['class_name'];?></td>
  75. <td>
  76. <?php if ($rt['is_generated'] == 0): ?>
  77. <span class="label label-sm label-warning">正在生成</span>
  78. <?php else: ?>
  79. <span class="label label-sm label-success">已生成</span>
  80. <?php endif; ?>
  81. </td>
  82. </tr>
  83. <?php endforeach;else:?>
  84. <tr><td colspan="5">暂无数据!</td></tr>
  85. <?php endif;?>
  86. </tbody>
  87. </table>
  88. </div>
  89. <input type="hidden" name="classId" id="classId" value="<?php echo $class_id;?>" />
  90. <!-- PAGE CONTENT ENDS -->
  91. </div>
  92. </div>
  93. </div>
  94. </div>
  95. <script type="text/javascript">
  96. function ccc(){
  97. layer.msg('敬请期待!', {
  98. time: 0,
  99. btn: ['确定', '取消'],
  100. yes: function(index){
  101. layer.close(index);
  102. return false;
  103. }
  104. });
  105. }
  106. $(function(){
  107. // 全选\反选
  108. $(".selectAll").click(function(){
  109. if ($(this).prop("checked")) {
  110. // $(".myselect").prop("checked",true);
  111. var s_obj = $(".myselect");
  112. var s_len = s_obj.length;
  113. for (var i=0;i<s_len;i++) {
  114. if (!s_obj[i].disabled) {
  115. s_obj[i].checked=true;
  116. }
  117. }
  118. } else {
  119. $(".myselect").prop("checked",false);
  120. }
  121. });
  122. $("#selectPrint").click(function(){
  123. // 判断是否有选中
  124. if (!$("input[class='ace myselect']").is(':checked')) {
  125. layer.msg('请至少选择一个学生!');return false;
  126. }
  127. layer.msg('您确定下载暑假作业吗?', {
  128. time: 0,
  129. btn: ['确定', '取消'],
  130. yes: function(index){
  131. layer.close(index);
  132. //var paperId = $("#paperId").val();
  133. var classId = $("#classId").val();
  134. //var examId = $("#examId").val();
  135. var examId = '96642437073601695';
  136. if (!classId || !examId) {
  137. layer.msg('未找到试卷、班级或周周练信息!');return false;
  138. }
  139. var result = [];
  140. $(".myselect").each(function(m,n){
  141. if ($(this).prop('checked')) {
  142. if ($(this).val() && $(this).attr("stnm")) {
  143. result.push($(this).val());
  144. }
  145. }
  146. })
  147. if (result.length < 1) {
  148. layer.msg('未找到要下载的学生!');return false;
  149. }
  150. layer.msg("下载中请稍后...");
  151. location.href = "<?php echo $this->createUrl('print/changewrongtopicdo');?>/cid/"+classId+"/eid/"+examId+"/stids/"+result;
  152. }
  153. });
  154. });
  155. })
  156. </script>