index_underline.php 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589
  1. <script type="text/javascript">
  2. function in_array(search, array){
  3. for(var i in array){
  4. if(array[i]==search){
  5. return true;
  6. }
  7. }
  8. return false;
  9. }
  10. testFlag = "<?php echo $this->testFlag;?>";
  11. customTplsIds = new Array();
  12. var i = 0;
  13. <?php foreach(Yii::app()->params["custom_tpls_ids"] as $tplId){?>
  14. customTplsIds[i] = "<?php echo $tplId;?>";
  15. i++;
  16. <?php }?>
  17. jQuery(document).ready(function(){
  18. // 根据年级筛选班级
  19. jQuery("#grade").change(function(){
  20. var grade = $(this).val();
  21. if (!grade) return false;
  22. jQuery.post(
  23. '<?php echo $this->createUrl("print/getGradeClass");?>',{"grade": grade},function(data){
  24. data = JSON.parse(data);
  25. if(data.success == 1){
  26. var classObj = $("#class");
  27. var html = "<option value=''>全部班级</option>";
  28. classObj.empty();
  29. $.each(data.message,function(i,n){
  30. html += "<option value='"+n.class_id+"'>" + n.class_name + "</option>";
  31. });
  32. classObj.append(html);
  33. }
  34. }
  35. );
  36. });
  37. });
  38. </script>
  39. <style>
  40. /*切换选择*/
  41. .tab-con{
  42. position: relative;
  43. height: 30px;
  44. width: 200px;
  45. background: #F2F2F2;
  46. border: 1px solid #01B677;
  47. border-radius: 15px;
  48. }
  49. .sel-opt{
  50. width: 50%;
  51. position: relative;
  52. color: #01B677;
  53. line-height: 30px;
  54. text-indent: 6px;
  55. cursor: pointer;
  56. }
  57. .sel-opt:after{
  58. content: '';
  59. border-left: 6px solid transparent;
  60. border-right: 6px solid transparent;
  61. border-top: 8px solid #01B677;
  62. position: absolute;
  63. right: 12px;
  64. top: 12px;
  65. }
  66. // .sel-opt select{
  67. // width: 100%;
  68. // height: 30px;
  69. // background: #F2F2F2;
  70. // color: #01B677;
  71. // text-indent: 6px;
  72. // font-size: inherit;
  73. // border-top-right-radius: 15px;
  74. // border-bottom-right-radius: 15px;
  75. // cursor: pointer;
  76. // }
  77. // .sel-opt select option{
  78. // position: relative;
  79. // }
  80. .points{
  81. position: absolute;
  82. top: -2px;
  83. right: 0;
  84. width: 10px;
  85. height: 10px;
  86. background: #F01516;
  87. border-radius: 50%;
  88. }
  89. .sel-cons{
  90. border: 1px solid #01B677;
  91. width: 50%;
  92. position: absolute;
  93. right: 0;
  94. top: 30px;
  95. text-indent: 10px;
  96. display: none;
  97. }
  98. .sc-lis{
  99. line-height: 30px;
  100. cursor: pointer;
  101. }
  102. .sc-lis span{
  103. position: relative;
  104. }
  105. .sc-lis .points{
  106. top: 2px;
  107. right: -16px;
  108. }
  109. .click-sc:focus {
  110. color: #fff;
  111. }
  112. .click-sc:hover {
  113. color: #fff;
  114. }
  115. .create-third{
  116. position: absolute;
  117. right: 6px;
  118. top: 10px;
  119. }
  120. .tab-con-btn{
  121. height: 31px;
  122. width: 210px;
  123. background: #F2F2F2;
  124. border: 1px solid #2977ff;
  125. border-radius: 15px;
  126. display: inline-block;
  127. text-align: center;
  128. }
  129. .tab_btn{
  130. display: inline-block;
  131. width:100px;
  132. padding: 0;
  133. border: 0;
  134. margin:0;
  135. outline:none;
  136. background: #F2F2F2;
  137. border-radius: inherit;
  138. }
  139. .has-sel{
  140. background: #01B677;
  141. color: #fff;
  142. width: 50%;
  143. height: 30px;
  144. border-top-left-radius: 15px;
  145. border-bottom-left-radius: 15px;
  146. text-align: center;
  147. line-height: 30px;
  148. }
  149. .has-sel-1{
  150. background: #2977ff;
  151. color: #fff;
  152. width: 50%;
  153. height: 30px;
  154. border-top-right-radius: 15px;
  155. border-bottom-right-radius: 15px;
  156. text-align: center;
  157. line-height: 30px;
  158. }
  159. .icon {
  160. display: inline-block;
  161. background: center/contain no-repeat;
  162. width: 25px;
  163. height: 25px;
  164. cursor: pointer;
  165. vertical-align: middle;
  166. }
  167. .icon-edit {
  168. background-image: url("/images/edit.png")
  169. }
  170. .table-hover>tbody>tr:hover {
  171. background-color: #E6F1EC
  172. }
  173. </style>
  174. <link rel="stylesheet" href="/fonts/fpdf/iconfont.css" />
  175. <link rel="stylesheet" href="/fonts/shangchuan/iconfont.css" />
  176. <div class="main-content-inner">
  177. <!-- 导航栏开始-->
  178. <?php include(Yii::app()->basePath.'/views/layouts/view_navigation.php');?>
  179. <!-- 导航栏结束-->
  180. <div class="page-content">
  181. <div class="row" style="margin:0px;">
  182. <div class="col-xs-12">
  183. <!-- PAGE CONTENT BEGINS -->
  184. <div id="dynamic-table_wrapper" class="dataTables_wrapper form-inline no-footer">
  185. <div class="row">
  186. <form method="get" id="form1" action="<?php echo $this->createUrl("third/index");?>">
  187. <div class="col-xs-12">
  188. <div class="dataTables_length margin-zy">
  189. <div class="tab-con-btn">
  190. <?php
  191. if(isset($list_type) && $list_type==1):
  192. ?>
  193. <button class="tab_btn " >阅卷试卷</button>
  194. <button class="tab_btn has-sel-1" >导入成绩试卷</button>
  195. <?php
  196. else:
  197. ?>
  198. <button class="tab_btn has-sel" >阅卷试卷</button>
  199. <button class="tab_btn " >导入成绩试卷</button>
  200. <?php
  201. endif;
  202. ?>
  203. </div>
  204. <input type="hidden" name="list_type" value="<?php if(isset($list_type)){echo $list_type;}else{echo 0;}?>" />
  205. <input type="hidden" name="type" value="<?php echo $printType;?>" />
  206. <input type="checkbox" name="display" style="margin: -1px 2px 0 0;display:inline-block;vertical-align: middle;width:15px;height:15px;" value="1" <?php if($display === '1') echo "checked";?>>显示隐藏试卷
  207. <input type="text" class="form-control input-sm" placeholder="请输入打印任务名称" name="name" value="<?php echo $printName;?>">
  208. <button class="label-primary-s bth-s" id="search" style="padding:4px 12px;">搜索</button>
  209. </div>
  210. </div>
  211. </form>
  212. <button class="label-primary-s bth-s create-third" data-button="red">创建试卷</button>
  213. </div>
  214. <table id="dynamic-table" class="table table-striped table-bordered table-hover dataTable no-footer DTTT_selectable" style="font-size:12px">
  215. <thead>
  216. <tr>
  217. <th>名称</th>
  218. <th>创建日期</th>
  219. <th>考试日期</th>
  220. <th>题量</th>
  221. <th>满分</th>
  222. <th>考试班级</th>
  223. <th>上传进度</th>
  224. <th>状态</th>
  225. <th >操作</th>
  226. </tr>
  227. </thead>
  228. <tbody>
  229. <?php if(!empty($printList)):foreach($printList as $cl):?>
  230. <tr>
  231. <td style="max-width:260px">
  232. <?php
  233. if($cl['is_new']==0)
  234. {
  235. echo "<span style='color: #ff0000;font-weight: bold;'>【New】</span>";
  236. }
  237. echo $cl['exam_name'];
  238. ?>
  239. <!-- <a href="<?php /*echo Yii::app()->createUrl('paper/index',array('eid'=>$cl['exam_id']))*/?>"><?php /*echo $cl['print_name'];*/?></a>-->
  240. </td>
  241. <td><?php if(!empty($cl['create_time'])){ echo date('Y-m-d',$cl['create_time']);}?></td>
  242. <td><?php if(!empty($cl['examDate'])){ echo date('Y-m-d',$cl['examDate']);}?></td>
  243. <td><?php if(!empty($cl['totals'])){ echo $cl['totals'];}?></td>
  244. <td><?php if(!empty($cl['total_score'])){ echo $cl['total_score'];}?></td>
  245. <td><?php if(!empty($cl['class_count'])){ echo $cl['class_count'];}?></td>
  246. <td><?php if(!empty($cl['upload_count'])){ echo $cl['upload_count'];}?></td>
  247. <td><?php if(!empty($cl['upload_status'])){ echo $cl['upload_status'];}?></td>
  248. <td style="width:265px;">
  249. <span class="iconfont click-sc addbx" aria-hidden="true" title="选择学生" onclick="javascript:location.href='<?php echo $this->createUrl('third/exam_list',array('exam_group_id'=>$cl['exam_group_id'],'branch'=>$cl['branch'],'grade'=>$class_grade[$cl['class_id']],'upload_status'=>$cl['upload_status']));?>'">&#xe668;</span>
  250. <span class="iconfont click-sc addbx score-import" rel="<?php echo $cl['exam_group_id'] ?>" aria-hidden="true" title="上传成绩" onclick="">&#xe640;</span>
  251. <?php
  252. if($cl['upload_status']!='已上传成绩'):
  253. ?>
  254. <i class="icon icon-edit" rel="<?php echo $cl['exam_group_id'] ?>" title="编辑"></i>
  255. <?php endif;?>
  256. <?php if($cl['is_display'] == 1):?>
  257. <span class="iconfont click-sc click-tc addbx" aria-hidden="true" title="恢复试卷" onclick="oprateExam('<?php echo $cl['exam_group_id'];?>',0)">&#xe68f;</span>
  258. <?php else:?>
  259. <span class="iconfont click-sc click-delete addbx" aria-hidden="true" title="隐藏试卷" onclick="oprateExam('<?php echo $cl['exam_group_id'];?>',1)">&#xe68b;</span>
  260. <?php endif;?>
  261. </td>
  262. </tr>
  263. <?php endforeach;else:?>
  264. <tr><td colspan="10">暂无数据!</td></tr>
  265. <?php endif;?>
  266. </tbody>
  267. </table>
  268. <?php if(!empty($page_total)):?>
  269. <div class="row">
  270. <div class="col-xs-6">
  271. &nbsp;
  272. </div>
  273. <div class="col-xs-6">
  274. <div class="dataTables_paginate paging_simple_numbers">
  275. <?php
  276. $this->widget('CLinkPager', array(
  277. 'header' => '',
  278. 'firstPageLabel'=> '首页',
  279. 'lastPageLabel' => '末页',
  280. 'prevPageLabel' => '上一页',
  281. 'nextPageLabel' => '下一页',
  282. 'pages' => $pages,
  283. 'maxButtonCount'=> 5,
  284. ));
  285. echo '共:'.$page_total.'条';
  286. ?>
  287. </div>
  288. </div>
  289. </div>
  290. <?php endif;?>
  291. </div>
  292. <!--上传模板弹窗-->
  293. <!-- PAGE CONTENT ENDS -->
  294. </div>
  295. </div>
  296. </div>
  297. </div>
  298. <script src="/js/jquery.ajaxfileupload.js"></script>
  299. <script type="text/javascript">
  300. $(document).ready(function(){
  301. /*var str = '<div class="points"></div>';
  302. $(".sc-lis").each(function(){
  303. if($(this).find(".points").length>0){
  304. $(".sel-opt").append(str);
  305. }
  306. });*/
  307. $('.score-import').click(function(){
  308. $egid=$(this).attr('rel');
  309. $(location).attr('href',"<?php echo Yii::app()->createUrl('third/import')?>?examgroupid="+$egid);
  310. });
  311. $('.icon-edit').click(function(){
  312. $egid=$(this).attr('rel');
  313. $(location).attr('href',"<?php echo Yii::app()->createUrl('third/editthirdunderline')?>?examgroupid="+$egid);
  314. });
  315. $(".sel-opt,.sel-cons").mouseover(function(){
  316. $(".sel-cons").show();
  317. }).mouseout(function(){
  318. $(".sel-cons").hide();
  319. });
  320. $(".sc-lis").click(function(){
  321. var data = {
  322. subjectId : $(this).attr('val')
  323. };
  324. $.post("<?php echo Yii::app()->createUrl('third/setSubjectId')?>",data,function(flags){
  325. if(flags)
  326. {
  327. location.reload();
  328. }else
  329. {
  330. alert('网络异常');
  331. }
  332. });
  333. $('.has-sel').text($(this).text());
  334. $(".sel-cons").hide();
  335. });
  336. $(".ruanyun").click(function(){
  337. var exam_id = $(this).attr('exam_id');
  338. layer.msg("确定发送吗?学生是否全部上传成绩", {
  339. time: 0,
  340. btn: ['确定', '取消'],
  341. yes: function(index){
  342. layer.close(index);
  343. $.ajax({
  344. url: "<?php echo $this->createUrl('print/send_ruanyun_pdf');?>",
  345. type: "POST",
  346. dataType: "json",
  347. data:{ examId: exam_id
  348. },
  349. success: function (data){
  350. if(data.status == 1){
  351. layer.msg('发送成功',{
  352. icon: 1
  353. }, function(){
  354. layer.closeAll();
  355. location.reload();
  356. });
  357. }else if(data.status == 2){
  358. layer.msg('发送失败,未上传成绩',{
  359. icon: 5
  360. }, function(){
  361. layer.closeAll();
  362. location.reload();
  363. });
  364. }else{
  365. layer.msg('发送失败',{
  366. icon: 5
  367. }, function(){
  368. layer.closeAll();
  369. location.reload();
  370. });
  371. }
  372. },
  373. error: function (data, status, e){ //服务器响应失败处理函数
  374. layer.msg('返回失败!',{
  375. icon: 1
  376. }, function(){
  377. layer.closeAll();
  378. });
  379. }
  380. });
  381. }
  382. });
  383. });
  384. $(".create_sheet").click(function(){
  385. var exam_group_id = $(this).attr("exam_group_id");
  386. var sheet_id = $(this).attr("sheet_id");
  387. if(exam_group_id>0){
  388. $.post("<?php echo Yii::app()->createUrl('third/set_new')?>",{exam_group_id:exam_group_id});
  389. $.post("<?php echo Yii::app()->createUrl('third/verify_exam_rs')?>",{exam_group_id:exam_group_id},function(rs){
  390. var m = JSON.parse(rs);
  391. if(m.status==1)
  392. {
  393. layer.msg('已上传成绩,无法修改!',{
  394. icon: 5
  395. }, function(){
  396. layer.closeAll();
  397. location.reload();
  398. });
  399. }
  400. if(m.status==3)
  401. {
  402. layer.msg('已发送标注,无法修改!',{
  403. icon: 5
  404. }, function(){
  405. layer.closeAll();
  406. location.reload();
  407. });
  408. }
  409. if(m.status==2)
  410. {
  411. layer.msg('非法考试!',{
  412. icon: 5
  413. }, function(){
  414. layer.closeAll();
  415. location.reload();
  416. });
  417. }
  418. if(m.status==0)
  419. {
  420. evaluationClient.createAnswerSheet(sheet_id+","+exam_group_id);
  421. }
  422. });
  423. }
  424. });
  425. $(".create_sheet_subject").click(function(){
  426. var exam_group_id = $(this).attr("exam_group_id");
  427. var sheet_id = $(this).attr("sheet_id");
  428. if(exam_group_id>0){
  429. $.post("<?php echo Yii::app()->createUrl('third/set_new')?>",{exam_group_id:exam_group_id});
  430. $.post("<?php echo Yii::app()->createUrl('third/verify_exam_rs')?>",{exam_group_id:exam_group_id},function(rs){
  431. var m = JSON.parse(rs);
  432. if(m.status==1)
  433. {
  434. layer.msg('已上传成绩,无法修改!',{
  435. icon: 5
  436. }, function(){
  437. layer.closeAll();
  438. location.reload();
  439. });
  440. }
  441. if(m.status==3)
  442. {
  443. layer.msg('已发送标注,无法修改!',{
  444. icon: 5
  445. }, function(){
  446. layer.closeAll();
  447. location.reload();
  448. });
  449. }
  450. if(m.status==2)
  451. {
  452. layer.msg('非法考试!',{
  453. icon: 5
  454. }, function(){
  455. layer.closeAll();
  456. location.reload();
  457. });
  458. }
  459. if(m.status==0)
  460. {
  461. evaluationClient.createAnswerSheet(sheet_id+","+exam_group_id+",<?php echo Yii::app()->session['session_duoxueke_subject_id']?>");
  462. }
  463. });
  464. }
  465. });
  466. //打印
  467. $(".print_sheet").click(function(){
  468. var exam_group_id = $(this).attr('exam_group_id');
  469. if(!exam_group_id)
  470. {
  471. layer.msg('非法考试!');
  472. return false;
  473. }
  474. $.post("<?php echo Yii::app()->createUrl('third/print_paper')?>",{exam_group_id:exam_group_id},function(rs){
  475. var m = JSON.parse(rs);
  476. if(m.status)
  477. {
  478. evaluationClient.CreateDiSanFang(m.result);
  479. }
  480. });
  481. });
  482. $('.tab_btn').click(function(){
  483. $('input[name="list_type"]').val($(this).index());
  484. });
  485. $('.create-third').click(function(){
  486. var href='';
  487. <?php
  488. if(isset($list_type) && $list_type==1){
  489. echo "href='".$this->createUrl("third/thirdview_under_line")."';";
  490. } else{
  491. if(in_array(Yii::app()->session['session_duoxueke_subject_id'],array(3,6))){
  492. echo "href='".$this->createUrl("third/thirdview")."';";
  493. }else{
  494. echo "href='".$this->createUrl("third/thirdview_duo")."';";
  495. }
  496. }
  497. ?>
  498. window.location=href;
  499. });
  500. });
  501. // 搜索事件
  502. $("#search").click(function(){
  503. $("#form1").submit();
  504. });
  505. // 隐藏试卷
  506. function oprateExam(examGroupId,flag){
  507. if (examGroupId) {
  508. layer.msg('未找到周周练id',{
  509. icon: 5
  510. }, function(){
  511. layer.closeAll();
  512. });
  513. }
  514. var msg = '您确定要隐藏该试卷吗?';
  515. if (flag == 0) {
  516. msg = '您确定要恢复该试卷吗?';
  517. }
  518. layer.msg(msg, {
  519. time: 0,
  520. btn: ['确定', '取消'],
  521. yes: function(index){
  522. layer.close(index);
  523. $.post('<?php echo $this->createUrl("third/oprateexam");?>',{exam_group_id:examGroupId,flag:flag},function(data){
  524. var obj = JSON.parse(data);
  525. if (obj.success == 1) {
  526. location.reload();
  527. } else {
  528. layer.msg(obj.message,{
  529. icon: 5
  530. }, function(){
  531. layer.closeAll();
  532. });
  533. // layer.msg(obj.message);
  534. }
  535. });
  536. }
  537. });
  538. }
  539. </script>