handle_existent_img.php 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  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. if(isset($fieldName[$check_field])){
  34. echo '<td>'.$fieldName[$check_field].'</td>';
  35. }else{
  36. echo '<td>考号</td>';
  37. }
  38. }
  39. for($i=1;$i<=count($topic_score);$i++){
  40. echo '<td>第'.$i.'题</td>';
  41. }
  42. echo '</tr>';
  43. foreach($list as $val){
  44. $topic_score=json_decode($val['score_data'],true);
  45. if($check_field=='student_name'){
  46. $scoreArr=$topic_score;
  47. }else{
  48. $cardValue=$topic_score['C'];
  49. $scoreArr=array_slice($topic_score,1);
  50. }
  51. echo '<tr>';
  52. if($check_field=='student_name'){
  53. echo '<td><input type="text" data="'.$val['student_name'].'" class="change_name" id="'.$val['id'].'" value="'.$val['student_name'].'"></td>';
  54. }else{
  55. echo '<td>'.$val['student_name'].'</td>';
  56. }
  57. echo '<td>'.$val['class_name'].'</td>';
  58. if(isset($cardValue)){
  59. echo '<td><input type="text" data="'.$val['check_field_value'].'" class="change_card" id="'.$val['id'].'" value="'.$val['check_field_value'].'"></td>';
  60. }
  61. foreach($scoreArr as $v){
  62. echo '<td>'.$v.'</td>';
  63. }
  64. echo '</tr>';
  65. }
  66. }
  67. ?>
  68. </table>
  69. </div>
  70. </article>
  71. </section>
  72. </div>
  73. </div>
  74. <script>
  75. $(function() {
  76. //修改姓名
  77. $('.handle-detail-main-excel')
  78. .on('change','.change_name',function(){
  79. var new_name=$(this).val();
  80. var id=$(this).attr('id');
  81. var data=$(this).attr('data');
  82. var obj=$(this);
  83. changeValue(new_name,id,data,obj);
  84. })
  85. .on('change','.change_card',function(){
  86. var new_card=$(this).val();
  87. var id=$(this).attr('id');
  88. var data=$(this).attr('data');
  89. var obj=$(this);
  90. changeValue(new_card,id,data,obj);
  91. })
  92. function changeValue(value,id,data,obj){
  93. if(value=='' || value==undefined){
  94. return false;
  95. }
  96. if(id=='' || id==undefined){
  97. return false;
  98. }
  99. indexSend=layer.msg('正在修改,请稍候......',{time:0});
  100. $.ajax({
  101. url:'<?php echo $this->createUrl('record/change_value_img')?>',
  102. type:'POST',
  103. dataType:'json',
  104. data:{'id':id,'value':value},
  105. success:function(res){
  106. layer.close(indexSend);
  107. if(res.status==1){
  108. layer.msg('修改成功');
  109. //obj.attr('data',value);
  110. obj.closest('tr').remove();
  111. }else{
  112. obj.val(data);
  113. if(res.msg!=undefined){
  114. layer.msg(res.msg);
  115. }else{
  116. layer.msg('修改失败');
  117. }
  118. }
  119. }
  120. });
  121. }
  122. $('.save_student_id').click(function(){
  123. window.location.href="<?php echo $this->createUrl('record/checkImgExcel')?>";
  124. });
  125. })
  126. </script>