blacklist.php 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896
  1. <link rel="stylesheet" href="/css/assist/successPage.css"/>
  2. <style>
  3. .fr{
  4. float: right;
  5. }
  6. .filter {
  7. font-size: 0;
  8. margin-top:10px;
  9. width: 96%;
  10. margin:10px auto 0 auto;
  11. }
  12. .filter * {
  13. font-size: 14px;
  14. }
  15. .filter label {
  16. font-weight: bold;
  17. }
  18. .filter select {
  19. height: 36px;
  20. font-size: 14px;
  21. margin-left: 10px;
  22. }
  23. .filter select:nth-child(2) {
  24. width: 82px;
  25. }
  26. .filter select:nth-child(3) {
  27. width: 110px;
  28. }
  29. .filter button {
  30. border: none;
  31. background: #2977ff;
  32. width: 111px;
  33. height: 36px;
  34. border-radius: 3px;
  35. font-size: 14px;
  36. color: #fff;
  37. outline: none;
  38. cursor: pointer;
  39. margin-left: 10px;
  40. }
  41. .showClassInfo{
  42. cursor: pointer;
  43. }
  44. .list table {
  45. width: 96%;
  46. margin-top: 20px;
  47. text-align: center;
  48. border-right: 1px solid #ccc;
  49. margin:20px auto 0 auto;
  50. }
  51. .list table th {
  52. background: #f2f2f2;
  53. border: 1px solid #ccc;
  54. border-right: none;
  55. padding: 12px 15px;
  56. }
  57. .list table td {
  58. border: 1px solid #ccc;
  59. border-right: none;
  60. border-top: none;
  61. padding: 12px 15px;
  62. font-weight: bold;
  63. }
  64. .list table tr:nth-child(even) {
  65. background: #f2f2f2;
  66. }
  67. .list .tl {
  68. text-align: left;
  69. }
  70. .list .red {
  71. color: #cc3400;
  72. }
  73. .list .green {
  74. color: #079b67;
  75. }
  76. .icon {
  77. display: inline-block;
  78. background: center/contain no-repeat;
  79. width: 25px;
  80. height: 25px;
  81. cursor: pointer;
  82. vertical-align: middle;
  83. }
  84. .icon-edit {
  85. background-image: url("/images/edit.png")
  86. }
  87. .icon-eye-close {
  88. background-image: url("/images/eye_close.png")
  89. }
  90. .icon-download {
  91. background-image: url("/images/download_cylet.png")
  92. }
  93. .icon-xunhuan {
  94. background-image: url("/images/xunhuan.png")
  95. }
  96. .icon-add {
  97. background-image: url("/images/add.png");
  98. width: 20px;
  99. height: 20px;
  100. }
  101. .list .subjects {
  102. line-height: 22px;
  103. font-size: 0;
  104. }
  105. .list .icon{
  106. margin: 0 4px;
  107. }
  108. .list .subjects span {
  109. display: inline-block;
  110. font-size: 16px;
  111. word-break: keep-all;
  112. margin: 0 4px;
  113. }
  114. .confirmbox {
  115. background: #fff;
  116. border: 1px solid #cccccc;
  117. border-radius: 3px;
  118. padding: 40px 40px 30px;
  119. text-align: center;
  120. position: fixed;
  121. left: 50%;
  122. top: 50%;
  123. transform: translate(-50%, -50%);
  124. z-index: 99;
  125. }
  126. .confirmbox-mask {
  127. background: rgba(0, 0, 0, .7);
  128. left: 0;
  129. right: 0;
  130. top: 0;
  131. bottom: 0;
  132. z-index: 99;
  133. position: fixed;
  134. }
  135. button {
  136. border: none;
  137. background: #009965;
  138. width: 111px;
  139. height: 36px;
  140. border-radius: 3px;
  141. font-size: 14px;
  142. color: #fff;
  143. outline: none;
  144. cursor: pointer;
  145. }
  146. button.save {
  147. display: block;
  148. margin: 40px auto;
  149. }
  150. .confirmbox .confirmbox-btns {
  151. margin-top: 40px;
  152. }
  153. /*弹出层*/
  154. .confirmbox {
  155. background: #fff;
  156. border: 1px solid #cccccc;
  157. border-radius: 3px;
  158. padding: 40px 40px 30px;
  159. text-align: center;
  160. position: fixed;
  161. left: 50%;
  162. top: 50%;
  163. transform: translate(-50%, -50%);
  164. z-index: 99;
  165. }
  166. .confirmbox-mask {
  167. background: rgba(0, 0, 0, .7);
  168. left: 0;
  169. right: 0;
  170. top: 0;
  171. bottom: 0;
  172. z-index: 99;
  173. position: fixed;
  174. }
  175. .confirmbox-mask button {
  176. border: none;
  177. background: #2977ff;
  178. width: 80px;
  179. height: 26px;
  180. border-radius: 3px;
  181. font-size: 14px;
  182. color: #fff;
  183. outline: none;
  184. cursor: pointer;
  185. }
  186. .confirmbox-mask button.save {
  187. display: block;
  188. margin: 40px auto;
  189. }
  190. .confirmbox .confirmbox-btns {
  191. margin-top: 40px;
  192. }
  193. .class-modal {
  194. width: 900px;
  195. background: #fff;
  196. // border-radius: 5px;
  197. position: absolute;
  198. top: 50%;
  199. left: 50%;
  200. transform: translate(-50%, -50%);
  201. min-height:520px;
  202. }
  203. .class-modal-head {
  204. font-size: 14px;
  205. background:#2977ff;
  206. color:#fff;
  207. height:35px;
  208. line-height: 35px;
  209. padding: 0 0 0 15px;
  210. }
  211. .class-modal-body {
  212. margin-top: 5px;
  213. padding:15px;
  214. min-height: 340px;
  215. }
  216. .class-modal-body .classes {
  217. margin-bottom: 20px;
  218. }
  219. .class-modal-body .classes > div {
  220. display: inline-block;
  221. max-width: 640px;
  222. vertical-align: top;
  223. }
  224. .class-modal-body .classes a {
  225. text-decoration: none;
  226. display: inline-block;
  227. margin: 0 5px 5px;
  228. color: #136bfb;
  229. font-size: 14px;
  230. }
  231. .class-modal-body .classes a.active {
  232. color: #fc091b;
  233. }
  234. .class-modal .icon-close{
  235. position: absolute;
  236. right: 10px;
  237. top: 5px;
  238. color:#fff;
  239. font-size: 18px;
  240. }
  241. .c-red {
  242. color: #CC3300
  243. }
  244. .avg{
  245. margin:0 10px;
  246. }
  247. .class_btn{
  248. text-align: center;
  249. }
  250. .confirmbox-mask p{
  251. word-wrap : break-word ;
  252. }
  253. .icon-close{
  254. cursor: pointer;
  255. }
  256. .model-input{
  257. border:1px solid #ccc;
  258. padding:5px;
  259. margin-top:10px;
  260. }
  261. .model-input label{
  262. margin:0 15px;
  263. }
  264. table{margin-top:5px;}
  265. .table_list{
  266. height:420px;
  267. overflow: auto;
  268. }
  269. .upload-box{
  270. position:relative;
  271. padding-left:106px;
  272. line-height: 28px;
  273. }
  274. .upload-div,.upload-ipt{
  275. position: absolute;
  276. left:0;
  277. top:0;
  278. width:100px!important;
  279. }
  280. .upload-div{
  281. height:28px;
  282. text-align: center;
  283. background: #eee;
  284. color: #333;
  285. border-radius: 3px;
  286. border:1px solid #ccc;
  287. }
  288. .upload-div:hover{
  289. background: #69d9a7;
  290. }
  291. .upload-ipt{
  292. z-index: 2;
  293. opacity: 0;
  294. }
  295. </style>
  296. <script>
  297. function getClassByGrade(gradeId,$classId){
  298. $.ajax({
  299. type:'post',
  300. url:'<?php echo $this->createUrl("cylet/getclassbygrade");?>',
  301. async: true,
  302. dataType: 'json',
  303. data:{'grade':gradeId},
  304. success: function (result) {
  305. if(result.status==1){
  306. $('#class').html('<option value="0">全部班级</option>');
  307. for(var i=0;i<result.data.length;i++){
  308. if($.trim($classId)==$.trim(result.data[i]['class_id'])){
  309. html='<option value="'+result.data[i]['class_id']+'" selected>'+result.data[i]['class_name']+'</option>';
  310. }else{
  311. html='<option value="'+result.data[i]['class_id']+'" >'+result.data[i]['class_name']+'</option>';
  312. }
  313. $('#class').append(html);
  314. }
  315. }
  316. },
  317. error: function () {
  318. return;
  319. }
  320. });
  321. }
  322. function changeDisplay(cid,display){
  323. var showAll=$('#display').is(':checked');
  324. if(parseInt(cid)==0){
  325. return false;
  326. }
  327. $.ajax({
  328. type:'post',
  329. url:'<?php echo $this->createUrl("zhiliao/changestatus");?>',
  330. async: true,
  331. dataType: 'json',
  332. data:{'cid':cid,'display':display},
  333. success: function (result) {
  334. if(result.status==1){
  335. if(display==1){
  336. if(showAll){
  337. $('#'+cid).find('.icon').eq(2).removeClass('icon-eye-close').addClass('icon-xunhuan');
  338. }else{
  339. $('#'+cid).hide();
  340. }
  341. }else{
  342. $('#'+cid).find('.icon').eq(2).removeClass('icon-xunhuan').addClass('icon-eye-close');
  343. $('#'+cid).hide();
  344. }
  345. window.location.reload()
  346. }
  347. },
  348. error: function () {
  349. return;
  350. }
  351. });
  352. }
  353. </script>
  354. <!-- 导航栏开始-->
  355. <?php include(Yii::app()->basePath.'/views/layouts/view_navigation.php');?>
  356. <!-- 导航栏结束-->
  357. <div class="hgc_headOPerator fl" style="background: transparent;padding-left: 0;">
  358. <div class="menuBtn" id="hgc_scanUploadBtn">
  359. <img src="/images/assist/icon_hgc_menu.svg" />
  360. <span class="btnText">不推送成绩设置</span>
  361. </div>
  362. </div>
  363. <div class="hgc_siderBar" id="hgc_siderBar">
  364. <div class="menuBtn" id="hgc_hideMenuBtn">
  365. <img src="/images/assist/icon_hgc_menu.svg" />
  366. <span class="btnText">家校成绩设置</span>
  367. </div>
  368. <ul class="menuList">
  369. <li>
  370. <a>不推送成绩设置</a>
  371. </li>
  372. <li>
  373. <a href="<?php echo $this->createUrl('zhiliao/reportsetting')?>">家长端成绩报告设置</a>
  374. </li>
  375. <!-- <li>
  376. <a>阅卷监控管理</a>
  377. </li>-->
  378. <li class="back" id="hgc_menuBack">
  379. <a href="<?php echo $this->createUrl('zhiliao/index')?>"> <img src="/images/assist/icon_hgc_back.svg" alt=""> 返回</a>
  380. </li>
  381. </ul>
  382. </div>
  383. <div class="filter">
  384. <?php
  385. $gradeSelect=array(
  386. 0=>'',
  387. 1=>'',
  388. 2=>'',
  389. 3=>''
  390. );
  391. //
  392. // if(isset($grade)){
  393. // $gradeSelect[$grade]='selected';
  394. // if($class){
  395. // $class=(string)$class;
  396. // echo "<script>getClassByGrade(".$grade.",'".$class."');</script>";
  397. // }else{
  398. // echo "<script>getClassByGrade(".$grade.",0);</script>";
  399. // }
  400. //
  401. // }
  402. ?>
  403. <form action="" method="get" name="cylet" id="cyletForm">
  404. <select name="grade" id="grade">
  405. <option value="0">年级</option>
  406. <option value="1" <?php echo $gradeSelect[1] ?>>高一</option>
  407. <option value="2" <?php echo $gradeSelect[2]?>>高二</option>
  408. <option value="3" <?php echo $gradeSelect[3]?>>高三</option>
  409. </select>
  410. <select name="class_id" id="class">
  411. <option value="0">全部班级</option>
  412. </select>
  413. <input type="text" name="name" value="" >
  414. <button type="submit" name="search_btn">搜索</button>
  415. <span class="c-red">同步在家长端及学生端</span>
  416. <button type="button" class="fr blackListSet" style="margin-right:10px;width:150px;">
  417. <i class="icon icon-add"></i>
  418. <span style="display: inline-block;vertical-align: middle">新增不推送试卷</span>
  419. </button>
  420. </form>
  421. </div>
  422. <div class="list">
  423. <table cellspacing="0" cellpadding="0" >
  424. <thead>
  425. <tr>
  426. <th >考试名称</th>
  427. <th >申请日期</th>
  428. <th >考试日期</th>
  429. <th >学科</th>
  430. <th >年级</th>
  431. <th >班级</th>
  432. <th>班级类型</th>
  433. <th>考试类型</th>
  434. <th>成绩是否已生成</th>
  435. <th width="12%">操作</th>
  436. </tr>
  437. </thead>
  438. <tbody>
  439. <?php
  440. if(isset($dataList) && !empty($dataList)):
  441. $i=0;
  442. $gradeArr=array(
  443. 1=>'高一',
  444. 2=>'高二',
  445. 3=>'高三'
  446. );
  447. $classArr=array(
  448. 1=>'行政班',
  449. 2=>'教学班'
  450. );
  451. //1:周考2:单元考3:月考4:联考5:期中6:期末7:高考模拟8:冲刺
  452. $typeArr=array(
  453. 1=>'周考',
  454. 2=>'单元考',
  455. 3=>'月考',
  456. 4=>'联考',
  457. 5=>'期中',
  458. 6=>'期末',
  459. 7=>'高考模拟',
  460. 8=>'冲刺',
  461. 9=>'测验'
  462. );
  463. foreach ($dataList as $val):
  464. $i++;
  465. ?>
  466. <tr id="<?php echo $val['exam_id']?>">
  467. <td><?php echo $val['name']?></td>
  468. <td class="tl"><?php echo date('Y-m-d',$val['exam_create_time']) ?></td>
  469. <td><?php echo $val['exam_date']?></td>
  470. <td class="tl"><?php echo $val['subject']?></td>
  471. <td class="tl"><?php echo isset($gradeArr[$val['grade']])?$gradeArr[$val['grade']]:''?></td>
  472. <td><?php echo $val['class_name']?></td>
  473. <td class="tl"><?php echo $classArr[$val['class_type']] ?></td>
  474. <td class="tl"><?php echo $typeArr[$val['type']]?></td>
  475. <td class="tl"><?php echo $val['status']?></td>
  476. <td>
  477. <a href="<?php echo $this->createUrl('zhiliao/delBlacklist',array('exam_id'=>$val['exam_id']))?>" class="delBlacklist" status="<?php echo $val['status'] ?>" title="移出试卷">删除</a>
  478. </td>
  479. </tr>
  480. <?php endforeach;endif;?>
  481. <tr>
  482. <td colspan="11" class="page">
  483. <?php
  484. if(isset($pageTotal) && $pageTotal>1){
  485. $StartPage=$page-5;
  486. $EndPage=$page+5;
  487. if($StartPage<1){
  488. $StartPage=1;
  489. }
  490. if($EndPage>$pageTotal){
  491. $EndPage=$pageTotal;
  492. }
  493. ?>
  494. <div class="row" style="padding-top:10px;">
  495. <div class="col-xs-7">
  496. &nbsp;
  497. </div>
  498. <div class="col-xs-5" style="font-size: 16px">
  499. <div class="dataTables_paginate paging_simple_numbers" style="vertical-align:sub;">
  500. <ul id="yw0" class="yiiPager">
  501. <?php
  502. if($page>1){
  503. $query['page']=$page-1;
  504. echo '<li class="previous"><a href="'.$this->createUrl('zhiliao/blacklist')."?".http_build_query($query).'">上一页</a></li>';
  505. }
  506. for($i=$StartPage;$i<=$EndPage;$i++){
  507. $query['page']=$i;
  508. $url=$this->createUrl('zhiliao/blacklist').'?'.http_build_query($query);
  509. if($page==$i){
  510. echo '<li class="page selected"><a href="#">'.$i.'</a></li>';
  511. }else{
  512. echo '<li class="page"><a href="'.$url.'">'.$i.'</a></li>';
  513. }
  514. }
  515. if($page<$pageTotal){
  516. $query['page']=$page+1;
  517. echo '<li class="next"><a href="'.$this->createUrl('zhiliao/blacklist')."?".http_build_query($query).'">下一页</a></li>';
  518. }
  519. }
  520. ?>
  521. </ul>
  522. <span>共:<?php echo $total?>条</span>
  523. </td>
  524. </tr>
  525. </tbody>
  526. </table>
  527. </div>
  528. <!-- 弹窗 -->
  529. <div class="confirmbox-mask" style="display: none" id="fieldModal">
  530. <div class="class-modal">
  531. <i class="icon close_1 icon-close">×</i>
  532. <div class="class-modal-head">选择不推送成绩试卷</div>
  533. <form id="examSelect">
  534. <div class="class-modal-body">
  535. <select name="grade" class="grade">
  536. <option value="0">年级</option>
  537. <option value="1"> 高一</option>
  538. <option value="2"> 高二</option>
  539. <option value="3"> 高三</option>
  540. </select>
  541. <select name="class" class="class">
  542. <option value="0">班级</option>
  543. </select>
  544. <input type="text" name="keyword" value="" placeholder="">
  545. <button class="search_exam">搜索</button>
  546. <div class="table_list">
  547. <table id="dynamic-table" class="table table-striped table-bordered table-hover dataTable no-footer DTTT_selectable">
  548. <tr><td align="center">请先查找您需要的试卷
  549. </td></tr>
  550. </table>
  551. </div>
  552. </div>
  553. <div class="page">
  554. <div class="row" style="padding-top:10px;padding-bottom: 15px;">
  555. <div class="" style="font-size: 16px;float: right;padding-right:15px;">
  556. <div class="dataTables_paginate paging_simple_numbers alertPage" style="vertical-align:sub;">
  557. </div>
  558. </div>
  559. </div>
  560. </div>
  561. <p class="class_btn">
  562. <button type="button" class="setting_sumbit">确定</button>
  563. <button type="button" class="close_1">取消</button>
  564. </p>
  565. </form>
  566. </div>
  567. </div>
  568. <script>
  569. $(function(){
  570. var scanMenuBtn = document.getElementById('hgc_scanUploadBtn');
  571. var scanMenu = document.getElementById('hgc_siderBar')
  572. var scanMenuBack = document.getElementById('hgc_menuBack')
  573. var scanMenuHideBtn = document.getElementById('hgc_hideMenuBtn')
  574. scanMenuBtn.addEventListener('click',function(){
  575. var originMeunText = scanMenuBtn.lastElementChild.innerText;
  576. scanMenu.style.top = $(scanMenuBtn).offset().top - $(window).scrollTop()+'px'
  577. scanMenu.className = 'hgc_siderBar active'
  578. scanMenuHideBtn.lastElementChild.innerText = originMeunText
  579. })
  580. scanMenuBack.addEventListener('click',function(){
  581. scanMenu.className = 'hgc_siderBar'
  582. })
  583. scanMenuHideBtn.addEventListener('click',function(){
  584. scanMenu.className = 'hgc_siderBar'
  585. })
  586. $(document).click(function(e){
  587. var e = e || window.event; //浏览器兼容性
  588. var elem = e.target || e.srcElement;
  589. while (elem) { //循环判断至跟节点,防止点击的是div子元素
  590. if (elem.id && (elem.id == 'hgc_scanUploadBtn' || elem.id == 'hgc_scanUploadBtn')) {
  591. return;
  592. }
  593. elem = elem.parentNode;
  594. }
  595. $('#hgc_siderBar').removeClass("active"); //点击的不是div或其子元素
  596. });
  597. $('.blackListSet').click(function(){
  598. $('#fieldModal').fadeIn();
  599. });
  600. $('.close_1').click(function(){
  601. $('#fieldModal').fadeOut();
  602. });
  603. $(document).on("change", "#grade", function(){
  604. // $('#grade').change(function(){
  605. var subjectId='<?php echo $subject?>';
  606. $.post("<?php echo $this->createUrl('print/getGradeClass'); ?>", {"grade": $('#grade').val(),"subjectId":subjectId}, function(data) {
  607. var m = JSON.parse(data);
  608. if(m.success==0)
  609. {
  610. var html = '<option value="0">请选择班级</option>';
  611. $("#class").html(html);
  612. }else{
  613. var html = '<option value="0">请选择班级</option>';
  614. $.each(m.message,function(i,n){
  615. html+='<option value="'+ n.class_id+'">'+ n.class_name+'</option>';
  616. });
  617. $("#class").html(html);
  618. }
  619. });
  620. });
  621. $('.grade').change(function(){
  622. var subjectId='<?php echo $subject?>';
  623. $.post("<?php echo $this->createUrl('print/getGradeClass'); ?>", {"grade": $('.grade').val(),"subjectId":subjectId}, function(data) {
  624. var m = JSON.parse(data);
  625. if(m.status==0)
  626. {
  627. var html = '<option value="0">请选择班级</option>';
  628. $(".class").html(html);
  629. }else{
  630. var html = '<option value="0">请选择班级</option>';
  631. $.each(m.message,function(i,n){
  632. html+='<option value="'+ n.class_id+'">'+ n.class_name+'</option>';
  633. });
  634. $(".class").html(html);
  635. }
  636. });
  637. });
  638. $('.search_exam').click(function(){
  639. loadExam(1);
  640. return false;
  641. });
  642. function loadExam(page){
  643. var exam_type=$('.exam_type').val();
  644. var subject=$('.subject').val();
  645. var grade=$('.grade').val();
  646. var class_id=$('.class').val();
  647. var keyword=$('input[name=keyword]').val();
  648. $.ajax({
  649. url:'<?php echo $this->createUrl('zhiliao/ajaxsearchexam')?>',
  650. type:'POST',
  651. dataType:'json',
  652. data:{'exam_type':exam_type,'subject':subject,'grade':grade,'class':class_id,'keyword':keyword,'page':page},
  653. success:function(res){
  654. if(res.status==1){
  655. var html='';
  656. var pageHtml='';
  657. html+='<tr>';
  658. html+='<th><input type="checkbox" name="select-all" class="selectAll" value=""></th>';
  659. html+='<th>考试名称</th>';
  660. html+='<th>学科</th>';
  661. html+='<th>申请日期</th>';
  662. html+='<th>考试日期</th>';
  663. html+='<th>年级</th>';
  664. html+='<th>班级</th>';
  665. html+='<th>班级类型</th>';
  666. html+='<th>考试类型</th>';
  667. html+='<th>成绩是否已生成</th>';
  668. html+='</tr>';
  669. $.each(res.list,function(i,n){
  670. html+='<tr>';
  671. html+='<td><input type="checkbox" status="'+n.status+'" name="exam" value="'+n.exam_id+'"></td>';
  672. html+='<td>'+n.name+'</td>';
  673. html+='<td>'+n.subject_name+'</td>';
  674. html+='<td>'+n.create_date+'</td>';
  675. html+='<td>'+n.exam_date+'</td>';
  676. html+='<td>'+n.grade+'</td>';
  677. html+='<td>'+n.class_name+'</td>';
  678. html+='<td>'+n.class_type+'</td>';
  679. html+='<td>'+n.type+'</td>';
  680. html+='<td>'+n.status_msg+'</td>';
  681. html+='</tr>';
  682. });
  683. //分页
  684. if(res.pages.totalPage>0){
  685. var pages=res.pages;
  686. var startPage=1;
  687. var endPage=5;
  688. if(pages.totalPage>1){
  689. startPage=parseInt(pages.page)-2;
  690. endPage=parseInt(pages.page)+3;
  691. if(startPage<1){
  692. startPage=1;
  693. }
  694. if(endPage>pages.totalPage){
  695. endPage=pages.totalPage;
  696. }
  697. pageHtml+='<ul id="yw0" class="yiiPager ">';
  698. nowPage=parseInt(pages.page)
  699. if(nowPage>1){
  700. pageHtml+='<li class="page "><a href="#" class="load_exam" page='+(nowPage-1)+'>上一页</a></li>';
  701. }
  702. for(var i=startPage;i<=endPage;i++){
  703. if(i==nowPage){
  704. pageHtml+='<li class="page selected"><a href="#">'+i+'</a></li>';
  705. }else{
  706. pageHtml+='<li class="page"><a href="#" class="load_exam" page='+i+'>'+i+'</a></li>';
  707. }
  708. }
  709. if(nowPage<pages.totalPage){
  710. pageHtml+='<li class="page "><a href="#" class="load_exam" page='+(nowPage+1)+'>下一页</a></li>';
  711. }
  712. pageHtml+='</ul>';
  713. pageHtml+='<span>共'+pages.total+'条</span>';
  714. }
  715. }
  716. $('#dynamic-table').html(html);
  717. $('.alertPage').html(pageHtml);
  718. }
  719. }
  720. });
  721. }
  722. $('.setting_sumbit').click(function(){
  723. var examIds=[],isHasComplete=false,isHasNoComplete=false,msg='';
  724. $.each($('input[name=exam]:checked'),function(){
  725. examIds.push($(this).val());
  726. if($(this).attr('status')=='1'){
  727. isHasComplete=true;
  728. }else {
  729. isHasNoComplete=true;
  730. }
  731. });
  732. if(examIds.length==0){
  733. layer.msg('请选择试卷');
  734. return false;
  735. }
  736. if(isHasComplete && isHasNoComplete){
  737. msg='您所选的试卷部分已发送成绩给家长,确定要撤回?';
  738. }else if(isHasComplete){
  739. msg='您所选试卷的成绩已发送给家长,您确定要撤回?';
  740. }else if(isHasNoComplete){
  741. msg='您确定要将所选试卷的成绩对家长隐藏?';
  742. }
  743. layer.msg(msg, {
  744. time: 0,
  745. btn: ['确定', '取消'],
  746. yes: function(index){
  747. jQuery.post(
  748. '<?php echo $this->createUrl('zhiliao/addBlacklist');?>',
  749. {"examIds":examIds},
  750. function(data){
  751. var obj = JSON.parse(data);
  752. if (obj.status == 1) {
  753. window.location.reload();
  754. } else {
  755. layer.msg('添加失败');
  756. }
  757. }
  758. );
  759. }
  760. });
  761. });
  762. $('.delBlacklist').click(function(){
  763. var status=$(this).attr('status');
  764. var msg='确定要移出试卷吗';
  765. var url=$(this).attr('href');
  766. console.log(url);
  767. if(status=='是'){
  768. msg='您确认要移出该试卷吗?移出后该试卷将重新推送成绩给家长';
  769. }else{
  770. msg='您确认要移出该试卷吗?移出后该试卷出成绩后将推送成绩给家长';
  771. }
  772. layer.msg(msg, {
  773. time: 0,
  774. btn: ['确定', '取消'],
  775. yes: function(index){
  776. window.location.href=url;
  777. }
  778. });
  779. return false;
  780. });
  781. // 全选按钮
  782. $("#examSelect")
  783. .on('change',"input[name='select-all']",function(){
  784. var type = $("input[name='select-all']").prop("checked");
  785. if(type){
  786. $("#dynamic-table").find("input[name=exam]").prop("checked", true);
  787. }else{
  788. $("#dynamic-table").find("input[name=exam]").prop("checked", false);
  789. }
  790. })
  791. .on('click','.load_exam',function(){
  792. var page=$(this).attr('page');
  793. loadExam(page);
  794. })
  795. //初始化年级班级
  796. function initClass(){
  797. var subjectId='<?php echo $subject?>';
  798. var grade = '<?php echo $grade;?>';
  799. var classId = '<?php echo $classId;?>';
  800. var name = '<?php echo $name;?>';
  801. if(grade > 0){
  802. $.post("<?php echo $this->createUrl('print/getGradeClass'); ?>", {"grade": grade,"subjectId":subjectId}, function(data) {
  803. var m = JSON.parse(data);
  804. if(m.success==0)
  805. {
  806. var html = '<option value="0">请选择班级</option>';
  807. $("#class").html(html);
  808. }else{
  809. var html = '<option value="0">请选择班级</option>';
  810. $.each(m.message,function(i,n){
  811. if(n.class_id == classId){
  812. html+='<option value="'+ n.class_id+'" selected="selected">'+ n.class_name+'</option>';
  813. }else{
  814. html+='<option value="'+ n.class_id+'">'+ n.class_name+'</option>';
  815. }
  816. });
  817. $("#class").html(html);
  818. $("#grade option[value='"+grade+"']").attr("selected",true);
  819. }
  820. });
  821. }
  822. if(name){
  823. $("input[name='name']").val(name);
  824. }
  825. }
  826. initClass();
  827. });
  828. </script>