changeraisescheme.php 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278
  1. <div class="main-content-inner">
  2. <!-- 导航栏开始-->
  3. <?php include(Yii::app()->basePath.'/views/layouts/view_production_navigation.php');?>
  4. <!-- 导航栏结束-->
  5. <div class="page-content">
  6. <div class="row" style="margin:0px">
  7. <div class="col-xs-12">
  8. <!-- PAGE CONTENT BEGINS -->
  9. <div id="dynamic-table_wrapper" class="dataTables_wrapper form-inline no-footer">
  10. <div class="row">
  11. <div class="col-xs-10">
  12. <form method="get" id="form1" action="<?php echo $this->createUrl("print/changeraisescheme", array("type" => $type));?>">
  13. <div class="dataTables_length" style="margin: 6px 0px;">
  14. <div class="dataTables_length">
  15. <label><input type="text" class="form-control input-sm" placeholder="请输入学生姓名" name="sname" value="<?php echo $sname;?>"></label>
  16. <button style="padding:4px 12px;"class="label-primary-s bth-s">搜索</button>
  17. </div>
  18. </div>
  19. <input type="hidden" name="cid" value="<?php echo $class_id;?>" />
  20. <input type="hidden" name="eid" value="<?php echo $exam_id;?>" />
  21. <input type="hidden" name="subid" value="<?php echo $subjectId;?>" />
  22. </form>
  23. </div>
  24. <div class="col-xs-2">
  25. <div class="dataTables_filter" id="dynamic-table_filter" style="padding-top:15px">
  26. <a href="javascript:void(0);" class="btn label-primary-green btn-sm" id="selectPrint">
  27. <i style="font-style: normal;" class="fa fa-print"></i> 下载
  28. </a>
  29. <a href="javascript:void(0);" printType="<?php echo $printType; ?>" class="btn label-primary-green btn-sm" id="selectPrintTools">
  30. <i style="font-style: normal;" class="fa fa-print"></i> 打印
  31. </a>
  32. </div>
  33. </div>
  34. </div>
  35. <div class="row">
  36. <div class="col-xs-12" style="font-weight:bold;padding:0px 15px">
  37. <?php echo $printTaskName;?>
  38. </div>
  39. </div>
  40. <table id="dynamic-table" class="table table-striped table-bordered table-hover dataTable no-footer DTTT_selectable" style="font-size:12px">
  41. <thead>
  42. <tr>
  43. <th class="center">
  44. <input type="checkbox" class="ace selectAll">
  45. </th>
  46. <th>序号</th>
  47. <th>个性化学习宝名称</th>
  48. <th>学生名称</th>
  49. <th>学生编号</th>
  50. <th>个性化学习宝PDF</th>
  51. <th>下载功能</th>
  52. </tr>
  53. </thead>
  54. <tbody>
  55. <?php if(!empty($result)):foreach($result as $rt):?>
  56. <tr>
  57. <td class="center">
  58. <?php if (($rt['ispStatus'] == 2)) { ?>
  59. <input type="checkbox" class="ace myselect" value="<?php echo $rt['studentCode'];?>" stnm="<?php echo $rt['studentName'];?>">
  60. <?php } else { ?>
  61. <input type="checkbox" disabled='disabled' class="ace myselect" value="<?php echo $rt['studentCode'];?>" stnm="<?php echo $rt['studentName'];?>">
  62. <?php } ?>
  63. </td>
  64. <td><?php echo $rt['no'];?></td>
  65. <td><?php echo $rt['planName'];?></td>
  66. <td><?php echo $rt['studentName'];?><?php if($rt['isAbsent']):?><span style="float: right;color: #FF0000">缺考</span><?php endif;?></td>
  67. <td><?php echo $rt['studentCode'];?></td>
  68. <td>
  69. <?php if ($rt['ispStatus'] == 0 || ($rt['ispStatus'] == 3 && $rt['complete_time'] > time() - 7*24*3600)): ?>
  70. <?php include('student_isp_error_msg.php');?>
  71. <!--红-->
  72. <!-- <span class="label label-sm label-danger" style="font-size:12px">未生成</span> -->
  73. <?php elseif ($rt['ispStatus'] == 1): ?>
  74. <span class="label label-sm label-warning" style="font-size:12px">正在生成中</span> <!--黄-->
  75. <?php elseif ($rt['ispStatus'] == 2): ?>
  76. <span class="label label-sm label-success" style="font-size:12px">已生成</span><!--绿-->
  77. <?php elseif ($rt['ispStatus'] == 3): ?>
  78. <span class="label label-sm" style="font-size:12px;background-color:gray;">已删除</span><!--灰-->
  79. <?php else: ?>
  80. <span class="label label-sm" style="font-size:12px;background-color:gray;">未知状态</span><!--灰-->
  81. <?php endif; ?>
  82. </td>
  83. <td>
  84. <?php
  85. if($limitstu==0){
  86. echo '<span class="label label-sm label-success" style="font-size:12px">已开通</span>';
  87. }elseif($limitstu==-1){
  88. echo '<span class="label label-sm label-danger" style="font-size:12px">未开通</span>';
  89. }else{
  90. if(isset($limitstu[$rt['studentCode']])){
  91. echo '<span class="label label-sm label-success" style="font-size:12px">已开通</span>';
  92. }else{
  93. echo '<span class="label label-sm label-danger" style="font-size:12px">未开通</span>';
  94. }
  95. }
  96. ?>
  97. </td>
  98. </tr>
  99. <?php endforeach;else:?>
  100. <tr><td colspan="6">暂无数据!</td></tr>
  101. <?php endif;?>
  102. </tbody>
  103. </table>
  104. </div>
  105. <input type="hidden" name="paperId" id="paperId" value="<?php echo $paper_id;?>" />
  106. <input type="hidden" name="classId" id="classId" value="<?php echo $class_id;?>" />
  107. <input type="hidden" name="examId" id="examId" value="<?php echo $exam_id;?>" />
  108. <!-- PAGE CONTENT ENDS -->
  109. </div>
  110. </div>
  111. </div>
  112. </div>
  113. <?php require_once "_print.php" ?>
  114. <script type="text/javascript">
  115. type = "<?php echo $type;?>";
  116. improveName = "";
  117. if(type == "isp"){
  118. type = 2;
  119. improveName = "个性化学习方案";
  120. }
  121. else if(type == "studytrend"){
  122. type = 3;
  123. improveName = "个性化学习宝";
  124. }
  125. else if(type == "third_isp"){
  126. type = 3;
  127. improveName = "个性化学习宝";
  128. }
  129. else{
  130. type = 0;
  131. }
  132. html = ""+
  133. '<div style="padding:20px 30px 0px 30px">'+
  134. '<div style="padding:8px 0;">请复制下方链接下载'+improveName+'。</div>'+
  135. '<div id="downloadUrl" style="white-space:nowrap;overflow:hidden;text-overflow:ellipsis;width:455px;"></div>'+
  136. '<div class="row" style="margin:30px auto 0px auto;text-align:center"><button id="confirm" class="label-primary-s bth-s" style="padding:4px 12px;margin:5px 0 10px 15px;background:gray;border-color:gray;">关闭</button>'+
  137. '</div>'+
  138. '</div>'+
  139. "";
  140. $(function(){
  141. // 全选\反选
  142. $(".selectAll").click(function(){
  143. if ($(this).prop("checked")) {
  144. var s_obj = $(".myselect");
  145. var s_len = s_obj.length;
  146. for (var i=0;i<s_len;i++) {
  147. if (!s_obj[i].disabled) {
  148. s_obj[i].checked=true;
  149. }
  150. }
  151. } else {
  152. $(".myselect").prop("checked",false);
  153. }
  154. });
  155. $("#selectPrint").click(function(){
  156. // 判断是否有选中
  157. if (!$("input[class='ace myselect']").is(':checked')) {
  158. layer.msg('请至少选择一个学生!');return false;
  159. }
  160. layer.msg("您确定下载"+improveName+"吗?", {
  161. time: 0,
  162. btn: ['确定', '取消'],
  163. yes: function(index){
  164. layer.close(index);
  165. var classId = $("#classId").val();
  166. var examId = $("#examId").val();
  167. if (!classId || !examId || !type) {
  168. layer.msg('参数错误!');return false;
  169. }
  170. var result = [];
  171. $(".myselect").each(function(m,n){
  172. if ($(this).prop('checked')) {
  173. if ($(this).val() && $(this).attr("stnm")) {
  174. result.push($(this).val());
  175. }
  176. }
  177. })
  178. if (result.length < 1) {
  179. layer.msg('未找到要下载的学生!');return false;
  180. }
  181. $.ajax({
  182. url: "<?php echo $this->createUrl('productdownload/getImproveFile');?>",
  183. type: "GET",
  184. dataType: "json",
  185. data: {"examId": examId, "classId": classId,"studentsIds":result, "type": type,"printType":"<?php echo $printType;?>"},
  186. timeout: <?php echo Yii::app()->params["product_download_time_limit"];?>,
  187. beforeSend:function(){
  188. layer.msg("下载中请稍后...",{"time": <?php echo Yii::app()->params["product_download_time_limit"];?>});
  189. },
  190. error: function (jqXHR, textStatus, errorThrown) {
  191. if(textStatus=="timeout"){
  192. $.ajax({
  193. type:'GET',
  194. url: "<?php echo $this->createUrl("productdownload/addIspTask");?>",
  195. data: {"examId": examId, "classId": classId, "studentsIds":result,"type": type,"printType":"<?php echo $printType;?>"},
  196. dataType: "json",
  197. success:function (data) {
  198. layer.alert('文件正在打包,请去右上角“下载”窗口获取下载链接!',{
  199. icon: 1,
  200. yes:function(){
  201. layer.closeAll();
  202. }
  203. });
  204. }
  205. })
  206. }else {
  207. layer.msg('返回失败!',{
  208. icon: 5
  209. }, function(){
  210. layer.closeAll();
  211. });
  212. }
  213. },
  214. success: function (data){
  215. layer.closeAll();
  216. if(data.success == 1||data.success == 2){
  217. layer.open({
  218. type: 1,
  219. area: ['550px', '220px'],
  220. title: "下载个性化学习宝",
  221. content: html,
  222. success: function(index, layerObj){
  223. // 更试卷打印时间
  224. $.post("<?php echo $this->createUrl('print/updatepaperprinttime');?>", {"examId": examId, "classId": classId, "studentsIds":result,"type": type,"printType":"<?php echo $printType;?>"} );
  225. jQuery("#downloadUrl").html('下载地址:<span style=""><input id="url" type="text" size="40" readonly value="'+data.downloadPath+'" /></span><button id="copy" class="label-primary-s bth-s" style="padding:4px 12px;margin:5px 0 10px 15px;">全选</button>');
  226. jQuery("#confirm, #cancel").on("click", function(){
  227. layer.close(layerObj);
  228. });
  229. jQuery("#copy").on("click", function(){
  230. jQuery("#url").select();
  231. });
  232. },
  233. end: function(){
  234. }
  235. });
  236. }else if(data.success == 3){
  237. // 更试卷打印时间
  238. $.post("<?php echo $this->createUrl('print/updatepaperprinttime');?>", {"examId": examId, "classId": classId, "studentsIds":result,"type": type,"printType":"<?php echo $printType;?>"} );
  239. layer.alert('文件正在打包,请去右上角“下载”窗口获取下载链接!',{
  240. icon: 1,
  241. yes:function(){
  242. layer.closeAll();
  243. }
  244. });
  245. }
  246. else if(data.success == 0){
  247. layer.msg(data.message, {"time": 3000});
  248. }
  249. },
  250. });
  251. }
  252. });
  253. });
  254. })
  255. </script>