handle_existent.php 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. <link type="text/css" rel="stylesheet" href="/css/needDetail.css" />
  2. <style>
  3. html {overflow-y: scroll;}
  4. </style>
  5. <div class="main-content-inner">
  6. <!-- 导航栏开始-->
  7. <?php include(Yii::app()->basePath.'/views/layouts/view_navigation.php');?>
  8. <!-- 导航栏结束-->
  9. <div class="layout-gap">
  10. <section class="hrn-top flex">
  11. <div class="flex-one hrn-top-title fw">学生在系统中不存在</div>
  12. <div class="green-font pointer" onclick="javascript:history.go(-1);">返回</div>
  13. </section>
  14. <section class="flex hrn-main-con">
  15. <article class="flex-one handle-detail-con">
  16. <div class="handle-detail-top flex">
  17. <div class="flex-one">
  18. <p>excel中学生:</p>
  19. </div>
  20. <span>处理办法:请修改<?php if(isset($check_field) && isset($fieldName[$check_field])){echo $fieldName[$check_field];}else{echo '考号';} ?>后重新导入</span>
  21. <div class="check-btn pointer save_student_id" data="">确认</div>
  22. </div>
  23. <div class="handle-detail-main-excel">
  24. <table class="table table-striped table-bordered table-hover dataTable no-footer DTTT_selectable">
  25. <tr>
  26. <td>姓名</td>
  27. <td>班级</td>
  28. <?php
  29. if(isset($list) && $list){
  30. $topic_score=json_decode($list[0]['score_data'],true);
  31. $check_field=$list[0]['check_field'];
  32. if($check_field=='student_name'){
  33. $scoreArr=array_slice($topic_score,1);
  34. echo '<td>科目总分</td>';
  35. }else{
  36. $scoreArr=array_slice($topic_score,2);
  37. if(isset($fieldName[$check_field])){
  38. echo '<td>'.$fieldName[$check_field].'</td>';
  39. }else{
  40. echo '<td>考号</td>';
  41. }
  42. echo '<td>科目总分</td>';
  43. }
  44. for($i=1;$i<=count($scoreArr);$i++){
  45. echo '<td>第'.$i.'题</td>';
  46. }
  47. echo '</tr>';
  48. foreach($list as $val){
  49. $topic_score=json_decode($val['score_data'],true);
  50. if($check_field=='student_name'){
  51. $scoreArr=array_slice($topic_score,1);
  52. $totalScore=$topic_score['C'];
  53. }else{
  54. $cardValue=$topic_score['C'];
  55. $totalScore=$topic_score['D'];
  56. $scoreArr=array_slice($topic_score,2);
  57. }
  58. echo '<tr>';
  59. if($check_field=='student_name'){
  60. echo '<td><input type="text" data="'.$val['student_name'].'" class="change_name" id="'.$val['id'].'" value="'.$val['student_name'].'"></td>';
  61. }else{
  62. echo '<td>'.$val['student_name'].'</td>';
  63. }
  64. echo '<td>'.$val['class_name'].'</td>';
  65. if(isset($cardValue)){
  66. echo '<td><input type="text" data="'.$val['check_field_value'].'" class="change_card" id="'.$val['id'].'" value="'.$val['check_field_value'].'"></td>';
  67. }
  68. echo '<td>'.$totalScore.'</td>';
  69. foreach($scoreArr as $v){
  70. echo '<td>'.$v.'</td>';
  71. }
  72. echo '</tr>';
  73. }
  74. }
  75. ?>
  76. </table>
  77. </div>
  78. </article>
  79. </section>
  80. </div>
  81. </div>
  82. <script>
  83. $(function() {
  84. //修改姓名
  85. $('.handle-detail-main-excel')
  86. .on('change','.change_name',function(){
  87. var new_name=$(this).val();
  88. var id=$(this).attr('id');
  89. var data=$(this).attr('data');
  90. var obj=$(this);
  91. changeValue(new_name,id,data,obj);
  92. })
  93. .on('change','.change_card',function(){
  94. var new_card=$(this).val();
  95. var id=$(this).attr('id');
  96. var data=$(this).attr('data');
  97. var obj=$(this);
  98. changeValue(new_card,id,data,obj);
  99. })
  100. function changeValue(value,id,data,obj){
  101. if(value=='' || value==undefined){
  102. return false;
  103. }
  104. if(id=='' || id==undefined){
  105. return false;
  106. }
  107. indexSend=layer.msg('正在修改,请稍候......',{time:0});
  108. $.ajax({
  109. url:'<?php echo $this->createUrl('record/change_value')?>',
  110. type:'POST',
  111. dataType:'json',
  112. data:{'id':id,'value':value},
  113. success:function(res){
  114. layer.close(indexSend);
  115. if(res.status==1){
  116. layer.msg('修改成功');
  117. //obj.attr('data',value);
  118. obj.closest('tr').remove();
  119. }else{
  120. obj.val(data);
  121. if(res.msg!=undefined){
  122. layer.msg(res.msg);
  123. }else{
  124. layer.msg('修改失败');
  125. }
  126. }
  127. }
  128. });
  129. }
  130. $('.save_student_id').click(function(){
  131. window.location.href="<?php echo $this->createUrl('record/check_excel')?>";
  132. });
  133. })
  134. </script>