handle_existent.php 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  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. $letters = array('C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','AA','AB','AC','AD','AE','AF','AG','AH','AI','AJ','AK','AL','AM');
  30. $allSubject=Yii::app()->params['subjectId'];
  31. unset($allSubject[3]);
  32. unset($allSubject[51]);
  33. unset($allSubject[20]);
  34. $ExcelToSubject=array();
  35. $subjectOrder=0;
  36. foreach ($allSubject as $key =>$val){
  37. $ExcelToSubject[$letters[$subjectOrder]]=$key;
  38. $subjectOrder++;
  39. }
  40. if(isset($list) && $list){
  41. $scoreArr=json_decode($list[0]['score_data'],true);
  42. $check_field=$list[0]['check_field'];
  43. foreach($scoreArr as $f=>$v){
  44. echo '<th>'.Yii::app()->params['subjectId'][$ExcelToSubject[$f]].'</th>';
  45. }
  46. echo '</tr>';
  47. foreach($list as $val){
  48. $topic_score=json_decode($val['score_data'],true);
  49. echo '<tr>';
  50. if($check_field=='student_name'){
  51. echo '<td><input type="text" data="'.$val['student_name'].'" class="change_name" id="'.$val['id'].'" value="'.$val['student_name'].'"></td>';
  52. }else{
  53. echo '<td>'.$val['student_name'].'</td>';
  54. }
  55. echo '<td>'.$val['class_name'].'</td>';
  56. foreach($topic_score as $v){
  57. echo '<td>'.$v.'</td>';
  58. }
  59. echo '</tr>';
  60. }
  61. }
  62. ?>
  63. </table>
  64. </div>
  65. </article>
  66. </section>
  67. </div>
  68. </div>
  69. <script>
  70. $(function() {
  71. //修改姓名
  72. $('.handle-detail-main-excel')
  73. .on('change','.change_name',function(){
  74. var new_name=$(this).val();
  75. var id=$(this).attr('id');
  76. var data=$(this).attr('data');
  77. var obj=$(this);
  78. changeValue(new_name,id,data,obj);
  79. })
  80. .on('change','.change_card',function(){
  81. var new_card=$(this).val();
  82. var id=$(this).attr('id');
  83. var data=$(this).attr('data');
  84. var obj=$(this);
  85. changeValue(new_card,id,data,obj);
  86. })
  87. function changeValue(value,id,data,obj){
  88. if(value=='' || value==undefined){
  89. return false;
  90. }
  91. if(id=='' || id==undefined){
  92. return false;
  93. }
  94. indexSend=layer.msg('正在修改,请稍候......',{time:0});
  95. $.ajax({
  96. url:'<?php echo $this->createUrl('zhiliao/change_value')?>',
  97. type:'POST',
  98. dataType:'json',
  99. data:{'id':id,'value':value},
  100. success:function(res){
  101. layer.close(indexSend);
  102. if(res.status==1){
  103. layer.msg('修改成功');
  104. //obj.attr('data',value);
  105. obj.closest('tr').remove();
  106. }else{
  107. obj.val(data);
  108. if(res.msg!=undefined){
  109. layer.msg(res.msg);
  110. }else{
  111. layer.msg('修改失败');
  112. }
  113. }
  114. }
  115. });
  116. }
  117. $('.save_student_id').click(function(){
  118. window.location.href="<?php echo $this->createUrl('zhiliao/check_excel')?>";
  119. });
  120. })
  121. </script>