index.php 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. <script type="text/javascript">
  2. jQuery(document).ready(function(){
  3. jQuery("#grades").change(function(){
  4. var grade = jQuery(this).val();
  5. location.href = "<?php echo $this->createUrl("record/index?grade=");?>"+grade;
  6. });
  7. jQuery("#classes").change(function(){
  8. var classId = jQuery(this).val();
  9. location.href = "<?php echo $this->createUrl("record/index?classId=");?>"+classId;
  10. });
  11. jQuery(".delExam").click(function(){
  12. document.examId = jQuery(this).attr("examId");
  13. msg = "确定删除?";
  14. layer.msg(msg, {
  15. time: 0,
  16. btn: ['确定', '取消'],
  17. yes: function(index){
  18. layer.close(index);
  19. jQuery.post(
  20. "<?php echo $this->createUrl("record/delact");?>",
  21. {"examId": document.examId},
  22. function(data){
  23. data = JSON.parse(data);
  24. if(data.code == "0"){
  25. msg = data.msg;
  26. icon = 6;
  27. }
  28. else{
  29. msg = data.msg;
  30. icon = 5;
  31. }
  32. layer.alert(msg, {icon: icon}, function(){
  33. location.href = "<?php echo 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];?>";
  34. });
  35. }
  36. );
  37. }
  38. });
  39. });
  40. });
  41. </script>
  42. <div class="main-content-inner">
  43. <div class="breadcrumbs" id="breadcrumbs">
  44. <ul class="clearfix main-content-inner-ul">
  45. <li class="pull-left">
  46. <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>
  47. <img src="/images/line.jpg" style="height:45px;" />
  48. </li>
  49. <li class="pull-left">
  50. <button onclick='location.href="<?php echo $this->createUrl("print/sub_index",array('type'=>'wtb'));?>"' class="button button_normal button_group button_arrow" data-button="red">下载错题本</button>
  51. <img src="/images/line.jpg" style="height:45px;" />
  52. </li>
  53. <li class="pull-left">
  54. <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>
  55. <img src="/images/line.jpg" style="height:45px;" />
  56. </li>
  57. <li class="pull-left">
  58. <button onclick='location.href="<?php echo $this->createUrl("print/sub_index",array('type'=>'studytrend'));?>"' class="button button_normal button_group button_arrow" data-button="red">下载个性化学习宝</button>
  59. <img src="/images/line.jpg" style="height:45px;" />
  60. </li>
  61. <!--<li class="pull-left">
  62. <button onclick='location.href="<?php echo $this->createUrl("vacationhomework/classes?type=vh");?>"' class="button button_normal button_group button_arrow" data-button="red">下载暑假作业</button>
  63. <img src="/images/line.jpg" style="height:45px;" />
  64. </li>-->
  65. <li class="pull-left">
  66. <button onclick='location.href="<?php echo $this->createUrl("export/index");?>"' class="button button_normal button_group button_arrow" data-button="red">导出报告</button>
  67. <img src="/images/line.jpg" style="height:45px;" />
  68. </li>
  69. <li class="pull-left">
  70. <button onclick='location.href="<?php echo $this->createUrl("upload/index");?>"' class="button button_normal button_group button_arrow" data-button="red">上传试卷</button>
  71. <img src="/images/line.jpg" style="height:45px;" />
  72. </li>
  73. <!--<li class="pull-left">
  74. <button onclick='location.href="<?php /*echo $this->createUrl("record/index");*/?>"' class="button button_normal button_group button_arrow button_active" data-button="red">导入考试成绩</button>
  75. <img src="/images/line.jpg" style="height:45px;" />
  76. </li>-->
  77. <li class="pull-left">
  78. <button onclick='location.href="<?php echo $this->createUrl("cylet/index");?>"' class="button button_normal button_group button_arrow " data-button="red">全学科统考</button>
  79. </li>
  80. </ul>
  81. </div>
  82. <div class="page-content">
  83. <div class="row marginNo">
  84. <div class="col-xs-12">
  85. <!-- PAGE CONTENT BEGINS -->
  86. <div id="dynamic-table_wrapper " class="dataTables_wrapper form-inline no-footer">
  87. <div class="row marginNo">
  88. <div class="dataTables_length margin-zy">
  89. <div class="col-xs-10 paddingNo">
  90. <div style="float: left;margin-top: 4px;">
  91. 按学期筛选:
  92. </div>
  93. <select id="grades" style="width:140px">
  94. <option <?php echo $grade == "1" ? "selected" : "";?> value="1">高一</option>
  95. <option <?php echo $grade == "2" ? "selected" : "";?> value="2">高二</option>
  96. <option <?php echo $grade == "3" ? "selected" : "";?> value="3">高三</option>
  97. </select>
  98. <?php if($classes){?>
  99. <select id="classes" style="width:140px">
  100. <?php foreach($classes as $key => $val){?>
  101. <option <?php echo $val["class_id"] == $class["class_id"] ? "selected" : "";?> value="<?php echo $val["class_id"];?>"><?php echo $val["class_name"];?></option>
  102. <?php }?>
  103. </select>
  104. <?php }?>
  105. <button class="label-primary-s bth-s" id="search" style="padding:4px 12px;">搜索</button>
  106. </div>
  107. <div class="col-xs-2">
  108. <div id="dynamic-table_filter" class="dataTables_filter">
  109. <a class="btn btn-success btn-sm" href="<?php echo $this->createUrl('record/edit');?>">
  110. <i class="fa fa-plus" style="font-style: normal;"></i> 录入成绩
  111. </a>
  112. </div>
  113. </div>
  114. </div>
  115. </div>
  116. <table id="dynamic-table" class="table table-striped table-bordered table-hover dataTable no-footer DTTT_selectable">
  117. <thead>
  118. <tr>
  119. <th>序号</th>
  120. <th>名称</th>
  121. <th>年级</th>
  122. <th>班级</th>
  123. <th>日期</th>
  124. <th>操作</th>
  125. </tr>
  126. </thead>
  127. <tbody>
  128. <?php if($exams):$k = 1;foreach($exams as $exam):?>
  129. <tr>
  130. <td><?php echo $k;?></td>
  131. <td><?php echo $exam["name"];?></td>
  132. <td>高<?php echo Char::numToZh($class['grade']);?></td>
  133. <td><?php echo $class["class_name"];?></td>
  134. <td><?php echo date('Y-m-d H:i:s',$exam['create_time']);?></td>
  135. <td>
  136. <!--<a href="<?php echo $this->createUrl("record/edit?act=edit&examId={$exam["exam_id"]}");?>"><span style="margin-right:8px">修改</span></a>-->
  137. <a href="<?php echo $this->createUrl("record/view?examId={$exam["exam_id"]}");?>"><span style="margin-right:8px">查看成绩</span></a>
  138. <a href="javascript:;" class="delExam" examId="<?php echo $exam["exam_id"];?>"><span style="margin-right:8px">删除</span></a></td>
  139. </tr>
  140. <?php $k++;endforeach;else:?>
  141. <tr><td colspan="7">暂无数据!</td></tr>
  142. <?php endif;?>
  143. </tbody>
  144. </table>
  145. <div class="row marginNo">
  146. <div class="col-xs-6">
  147. &nbsp;
  148. </div>
  149. <div class="col-xs-6">
  150. <div class="dataTables_paginate paging_simple_numbers">
  151. <?php if($pager->pagesCount){
  152. $this->widget('CLinkPager', array(
  153. 'header' => '',
  154. 'firstPageLabel'=> '首页',
  155. 'lastPageLabel' => '末页',
  156. 'prevPageLabel' => '上一页',
  157. 'nextPageLabel' => '下一页',
  158. 'pages' => $pager,
  159. 'maxButtonCount'=> 5,
  160. ));}
  161. ?>
  162. </div>
  163. </div>
  164. </div>
  165. </div>
  166. <!-- PAGE CONTENT ENDS -->
  167. </div>
  168. </div>
  169. </div>
  170. </div>
  171. <script src="/js/layer/layer.js"></script>
  172. <script type="text/javascript">
  173. </script>