westdc-zf1/application/admin/views/scripts/data/dataimport-preprocess.phtml

72 lines
2.3 KiB
PHTML

<?php
$this->headTitle($this->config->title->site);
$this->headTitle('后台管理');
$this->headTitle()->setSeparator(' - ');
?>
<div class="row-fluid">
<div class="span2">
<?= $this->partial('data/left.phtml'); ?>
</div>
<div class="span10">
<h3>数据导入<small>文件预处理</small></h3>
<hr />
处理文件:<?= $this->file ?>...
<h5>文件信息</h5>
<ul>
<li>文件行數:<?= $this->Count ?></li>
<li>文件大小:<?= $this->Size ?></li>
<li>文件类型:<?= $this->Type ?></li>
</ul>
<hr />
<h5 class="error-alerts" style="display: none;">错误消息</h5>
<ul id="errors" class="error-alerts" style="display: none;">
</ul>
<h6 id="error-loading"></h6>
<a href="javascript:void(0);" id="clt-next" class="btn btn-success disabled">下一步</a>
</div>
</div>
<script>
$(document).ready(function(){
$.ajax({
'type':"POST",
'url':'/admin/data/dataimport/ac/check',
'data':'file=<?= $this->file ?>',
'success':function(data){
if (data!=null)
{
if(data.status == true)
{
$('#clt-next').removeClass('disabled');
$('#clt-next').attr('href','/admin/data/dataimport/ac/target?file=<?= $this->file ?>');
alert("數據完整性檢查成功,可以進行下一步");
return true;
}
$('.error-alerts').show();
$.each(data.status,function(index,value){
$('#errors').append("<li>"+value+"</li>");
});
}else{
alert('处理中出现错误');
}
},
'timeout': 30000,
'beforeSend' : function(){
$('#error-loading').html("正在對文件進行初始化檢查......");
$('#error-loading').show();
},
'complete' : function(){
$('#error-loading').hide();
}
});
});
</script>