restore.php 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. <style>
  2. label{font-weight:100 !important;}
  3. th{text-align: center}
  4. </style>
  5. <link rel="stylesheet" href="/css/cylet.css" />
  6. <div class="main-content-inner">
  7. <!-- 导航栏开始-->
  8. <?php include(Yii::app()->basePath.'/views/layouts/view_navigation.php');?>
  9. <!-- 导航栏结束-->
  10. <div class="" style="width: 95%;margin:0 auto">
  11. <div id="dynamic-table_wrapper" class="dataTables_wrapper form-inline no-footer">
  12. <div class="row" style="margin:10px auto;padding-left:0">
  13. <form action="" method="get" name="cylet" id="cyletForm" style="padding-left: 0">
  14. <input type="text" name="exam_name" value="<?php echo $examName;?>">
  15. <button type="submit">搜索</button>
  16. </form>
  17. </div>
  18. <table id="dynamic-table"
  19. class="table table-striped table-bordered table-hover dataTable no-footer DTTT_selectable"
  20. style="font-size:12px">
  21. <thead>
  22. <tr>
  23. <th>考试名称</th>
  24. <th>学科</th>
  25. <th>考试日期</th>
  26. <th>提交时间</th>
  27. <th width="12%">操作</th>
  28. </tr>
  29. </thead>
  30. <tbody>
  31. <?php
  32. if(isset($dataList) && !empty($dataList)):
  33. foreach ($dataList as $val):
  34. ?>
  35. <tr >
  36. <td><?php echo $val['exam_name'];?></td>
  37. <td ><?php echo $val['subject_name'] ?></td>
  38. <td><?php echo $val['exam_date']?></td>
  39. <td><?php echo date('Y-m-d H:i:s',$val['create_time']) ?></td>
  40. <td>
  41. <?php
  42. if($val['status']==1){
  43. ?>
  44. <span class="iconfont addbx restore" exam_group_id="<?php echo $val['exam_group_id']?>" exam_name="<?php echo $val['exam_name']?>" exam_date="<?php echo $val['exam_date']?>" style="background-color: red;font-size:12px;font-weight:normal" title="还原" >还原</span>
  45. <span class="iconfont addbx restore_back" exam_group_id="<?php echo $val['exam_group_id']?>" exam_name="<?php echo $val['exam_name']?>" exam_date="<?php echo $val['exam_date']?>" style="background-color: #2977ff;font-size:12px;font-weight:normal" title="退回" >退回</span>
  46. <?php
  47. }elseif($val['status']==2){
  48. ?>
  49. <span class="iconfont addbx " style="background-color: gray;font-size:12px;font-weight:normal" title="已还原" >已还原</span>
  50. <?php
  51. }
  52. ?>
  53. </td>
  54. </tr>
  55. <?php endforeach;endif;?>
  56. <?php
  57. if(isset($pageTotal) && $pageTotal>1){
  58. $StartPage=$page-5;
  59. $EndPage=$page+5;
  60. if($StartPage<1){
  61. $StartPage=1;
  62. }
  63. if($EndPage>$pageTotal){
  64. $EndPage=$pageTotal;
  65. }
  66. ?>
  67. <tr>
  68. <td colspan="10" class="page">
  69. <div class="row" style="padding-top:10px;">
  70. <div class="col-xs-7">
  71. &nbsp;
  72. </div>
  73. <div class="col-xs-5" style="font-size: 16px">
  74. <div class="dataTables_paginate paging_simple_numbers" style="vertical-align:sub;">
  75. <ul id="yw0" class="yiiPager">
  76. <?php
  77. if($page>1){
  78. echo '<li class="previous"><a href="'.$this->createUrl('print/restore').'?page='.($page-1).'&exam_name='.$examName.'">上一页</a></li>';
  79. }
  80. for($i=$StartPage;$i<=$EndPage;$i++){
  81. $url=$this->createUrl('print/restore')."?page=".$i."&exam_name=".$examName;
  82. if($page==$i){
  83. echo '<li class="page selected"><a href="#">'.$i.'</a></li>';
  84. }else{
  85. echo '<li class="page"><a href="'.$url.'">'.$i.'</a></li>';
  86. }
  87. }
  88. if($page<$pageTotal){
  89. echo '<li class="next"><a href="'.$this->createUrl('print/restore').'?page='.($page+1).'&exam_name='.$examName.'">下一页</a></li>';
  90. }
  91. ?>
  92. </ul>
  93. </div>
  94. </div>
  95. </div>
  96. </td>
  97. </tr>
  98. <?php }?>
  99. </tbody>
  100. </table>
  101. </div>
  102. </div>
  103. </div>
  104. <script>
  105. $('.restore').click(function(){
  106. var examId=$(this).attr('exam_group_id'),
  107. examDate=$(this).attr('exam_date'),
  108. examName=$(this).attr('exam_name');
  109. msg="<b>你确定要还原该场考试?</b><br>考试名称:"+examName+" <br>考试日期:"+examDate;
  110. layer.msg(msg, {
  111. time: 0,
  112. icon:0,
  113. btn: ['确定', '取消'],
  114. yes: function(index){
  115. layer.close(index);
  116. layer.msg('正在发送申请,请稍候。。。。。',{time:0});
  117. $.post('<?php echo $this->createUrl("print/restoreExam");?>',{examId:examId},function(data){
  118. var obj = JSON.parse(data);
  119. layer.closeAll();
  120. if (obj.status == 1) {
  121. layer.msg('操作成功!',{
  122. icon: 1
  123. }, function(){
  124. layer.closeAll();
  125. window.location.reload()
  126. });
  127. } else {
  128. layer.msg(obj.msg);
  129. }
  130. });
  131. }
  132. });
  133. });
  134. $('.restore_back').click(function(){
  135. var examId=$(this).attr('exam_group_id'),
  136. examDate=$(this).attr('exam_date'),
  137. examName=$(this).attr('exam_name');
  138. msg="<b>你确定要退回该场考试的还原申请?</b><br>考试名称:"+examName+" <br>考试日期:"+examDate;
  139. layer.msg(msg, {
  140. time: 0,
  141. icon:0,
  142. btn: ['确定', '取消'],
  143. yes: function(index){
  144. layer.close(index);
  145. layer.msg('正在发送申请,请稍候。。。。。',{time:0});
  146. $.post('<?php echo $this->createUrl("print/restoreApplyBack");?>',{examId:examId},function(data){
  147. var obj = JSON.parse(data);
  148. layer.closeAll();
  149. if (obj.status == 1) {
  150. layer.msg('操作成功!',{
  151. icon: 1
  152. }, function(){
  153. layer.closeAll();
  154. window.location.reload()
  155. });
  156. } else {
  157. layer.msg(obj.msg);
  158. }
  159. });
  160. }
  161. });
  162. });
  163. </script>