123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281 |
- <link type="text/css" rel="stylesheet" href="/css/needDetail.css" />
- <style>
- .handle{float: right}
- </style>
- <div class="main-content-inner">
- <!-- 导航栏开始-->
- <?php include(Yii::app()->basePath.'/views/layouts/class_navigation.php');?>
- <!-- 导航栏结束-->
- <div class="layout-gap">
- <section class="anc-top flex status_1 ">
- <div class="flex-one flex">
- <p class="anc-title">导入教师</p>
- </div>
- </section>
- <section class="anc-main-con">
- <div class="form-group">
- <label class="control-label col-xs-12 col-sm-1 no-padding-right">模板示例<span class="errorMessage">*</span>:</label>
- <div class="col-sm-11">
- <table id="template" class="table table-striped table-bordered table-hover dataTable no-footer DTTT_selectable">
- <tr>
- <th width="1"></th>
- <th>A</th>
- <th>B</th>
- <th>C</th>
- <th>D</th>
- <th>E</th>
- <th>F</th>
- <th>G</th>
- <th>H</th>
- <th>I</th>
- <th>J</th>
- <th>K</th>
- <th>L</th>
- <th>M</th>
- <th>N</th>
- <th class="hide custom_field_no">I</th>
- </tr>
- <tr>
- <th></th>
- <th>班级</th>
- <th>学期</th>
- <th>年级</th>
- <th>班主任</th>
- <th>语文</th>
- <th>数学</th>
- <th>英语</th>
- <th>物理</th>
- <th>化学</th>
- <th>生物</th>
- <th>政治</th>
- <th>历史</th>
- <th>地理</th>
- <th>其它</th>
- <th class="hide custom_field"></th>
- </tr>
- <tr>
- <th>1</th>
- <th><?php if(Yii::app()->params['section']==0){echo '初一1班';}else{ echo '高一1班'; }?></th>
- <th>2018-2019学年下学期</th>
- <th><?php if(Yii::app()->params['section']==0){echo '初一';}else{ echo '高一'; }?></th>
- <th></th>
- <th></th>
- <th></th>
- <th></th>
- <th></th>
- <th></th>
- <th></th>
- <th></th>
- <th></th>
- <th></th>
- <th></th>
- <th class="hide custom_field_value"></th>
- </tr>
- </table>
- </div>
- </div>
- <div class="form-group">
- <label class="control-label col-xs-12 col-sm-1 no-padding-right">填写须知<span class="errorMessage">*</span>:</label>
- <div class="col-sm-11">
- <div> 1、班级填写班主任后才成立</div>
- <div>2、教师姓名:只能填写汉字</div>
- <div> 3、班级、学期、年级、三项不可更改,学科老师对应填写</div>
- </div>
- </div>
- <div class="clearfix form-actions">
- <div class="col-md-offset-1">
- <a class="btn label-primary-green btn-sm" href="<?php echo $this->createUrl('parent/downloadexcel');?>">
- 下载excel模板
- </a>
- <div>
- <span class="red-font">*请下载excel模版,内有班级信息请下载后填写再上传</span>
- </div>
- </div>
- </div>
- <div class="clearfix form-actions">
- <div class="col-md-offset-1">
- <div class="btn label-primary-green btn-sm select_file" >上传excel</div>
- <form id="form1" action="<?php echo $this->createUrl('parent/import')?>" method="post" enctype="multipart/form-data">
- <input type="file" name="file" id="uploadFile" style="display: none">
- </form>
- </div>
- </div>
- </section>
- </div>
- </div>
- <div class="anc-pop">
- <div class="confirm-pop-con">
- <div class="need-pop-top clearfix">
- <div class="npt-title put-need fl">提示</div>
- <div class="npt-close fr">×</div>
- </div>
- <div class="confirm-msg red-font tac">
- 确认要放弃本次上传的数据吗?
- </div>
- <div class="pop-btns">
- <div class="confirm-pop-btn-sure">确认</div>
- <div class="confirm-pop-btn-cancel cancel-btn">取消</div>
- </div>
- </div>
- </div>
- <script>
- $(function(){
- /*
- $('.begain-check-btn').click(function(){
- $('.anc-status-con').removeClass('hide');
- $(this).hide();
- $('.anc-index-msg').hide();
- loadStudent();
- });
- */
- //checkFirst();
- //保存结果
- $('.save_result').click(function(){
- var l_index=layer.msg('导入中,请稍候......',{time:0});
- $.ajax({
- url:'<?php echo $this->createUrl('record/update_score')?>',
- dataType:'json',
- type:'POST',
- success:function(res){
- layer.close(l_index);
- if(res.status==1){
- layer.msg('导入成功',function(){
- window.location.href="<?php echo $this->createUrl('record/importscore')?>";
- });
- }else{
- layer.msg('导入失败');
- }
- }
- });
- });
- // //第一步,检测数据
- // function checkFirst(){
- // var count=0;
- // $.ajax({
- // url:'<?php //echo $this->createUrl('record/Check_field_first')?>//',
- // dataType:'json',
- // type:'POST',
- // success:function(res){
- // if(res.status==1){
- // $('.first').addClass('finish-status');
- // $('.first').removeClass('now-status');
- // $('.first .status-charact').html('检查完成,导入的excel格式正确');
- // <?php //if($need_check_name==1):?>
- // checkAbnormal();
- // <?php //else:?>
- // checkRepeat();
- // <?php //endif;?>
- // }else{
- // $('.first').addClass('error-status');
- // $('.first').removeClass('now-status');
- // $('.first .status-charact').html('导入的excel格式与模版不一致,请重新上传:'+res.msg);
- // }
- // }
- // });
- // }
- //第二步,姓名异常
- function checkAbnormal(){
- $('.second .status-charact').html('正在检测...');
- $('.second').addClass('now-status');
- $.ajax({
- url:'<?php echo $this->createUrl('record/check_student_name')?>',
- dataType:'json',
- type:'POST',
- success:function(res){
- if(res.status==1){
- count=res.count;
- $('.second .status-charact').html('检测完成,已为'+count+'名学生去除姓名中的非汉字字符');
- $('.second').addClass('finish-status');
- $('.second').removeClass('now-status');
- checkRepeat();
- }else{
- $('.second .status-charact').html('检测失败');
- $('.second').addClass('error-status');
- $('.second').removeClass('now-status');
- }
- }
- });
- }
- //第三步
- function checkRepeat(){
- $('.fourth .status-charact').html('正在检测...');
- $('.fourth').addClass('now-status');
- $.ajax({
- url:'<?php echo $this->createUrl('record/matching')?>',
- dataType:'json',
- type:'POST',
- success:function(res){
- if(res.status==1){
- var html='';
- if(res.repeat>0){
- html+='<p>重名学生<span class="handle"><a href="<?php echo $this->createUrl('record/handle_repeat')?>">'+res.repeat+'组</a></span></p>';
- }else{
- html+='<p>重名学生<span class="handle">'+res.repeat+'组</span></p>';
- }
- if(res.noExistent>0){
- html+='<p>学生在系统中不存在<span class="handle"><a href="<?php echo $this->createUrl('record/handle_existent')?>">'+res.noExistent+'人</a></span></p>';
- }else{
- html+='<p>学生在系统中不存在<span class="handle">'+res.noExistent+'人</span></p>';
- }
- html+='<p>匹配成功<span class="handle">'+res.success+'人</span></p>';
- $('.third .status-charact').html(html);
- if(res.repeat==0 && res.success>0){
- $('.save_result').removeClass('hide');
- }
- $('.third').addClass('now-status');
- }else{
- $('.third .status-charact').html('检测失败,请稍后再试');
- $('.third').addClass('error-status');
- $('.third').removeClass('now-status');
- }
- }
- });
- }
- $('.give-up-check').click(function(){
- $('.anc-pop').show()
- })
- $('.npt-close,.confirm-pop-btn-cancel').click(function(){
- $('.anc-pop').hide()
- })
- $('.confirm-pop-btn-sure').click(function () {
- $.ajax({
- url:'<?php echo $this->createUrl('record/giveup')?>',
- dataType:'json',
- type:'POST',
- success:function(res){
- if(res.status==1){
- $('.anc-pop').hide();
- window.location.href='<?php echo $this->createUrl('record/importscore')?>';
- }else{
- $('.anc-pop').hide();
- }
- }
- });
- });
- $('#uploadFile').val('');
- $('.select_file').click(function(){
- $('#uploadFile').click();
- });
- $('#uploadFile').change(function(){
- if($('#uploadFile').val()!=''){
- $('#form1').submit();
- }
- });
- })
- </script>
|