📄 importstep1.asp
字号:
<!-- #include file = "../include/asphead.asp" -->
<!-- #include file = "../include/function.asp" -->
<%CheckUser()%>
<link href="../include/main.css" rel="stylesheet" type="text/css">
<script src="../include/function.js" type="text/javascript"></script>
<script ID="clientEventHandlersJS" LANGUAGE="javascript">
<!--
function LocalDC()
{
var FileName,ExtName;
FileName=JTrim(frmData.ImportFile.value);
if(FileName=="")
{
alert("请选择导入文件。");
return(false);
}
else
{
ExtName=FileName.substr(FileName.lastIndexOf('.'));
ExtName=ExtName.toLowerCase();
if(ExtName!='.xls')
{
alert("只能选择 Excel 文件(.xls),如果数据在其它文件中,请整理到 Excel 后再导入。");
return(false);
}
}
return true;
}
function Next()
{
if(LocalDC()==true)
{
Prompt.innerHTML="正在上传文件,此过程需要花费一点时间,请稍候。"
DisableButton();
document.frmData.target ="SaveArea";
document.frmData.action="upload.asp";
document.frmData.submit();
}
}
function Cancel()
{
var discard;
discard=confirm("放弃导入吗?");
if(discard==true)
{
parent.window.returnValue = false;
parent.window.close();
}
}
function Close()
{
parent.window.close();
}
function DisableButton()
{
frmData.btnCancel.disabled =true;
frmData.btnPre.disabled =true;
frmData.btnNext.disabled =true;
}
function EnableButton()
{
btnCancel.disabled =false;
btnNext.disabled =false;
}
function ImportLimitPrompt()
{
Prompt.innerText ="注意:每次最多导入" + MaxRecord.value + "条,导入文件的大小不得超出" + ImportMaxSize.value + "K 字节,否则系统拒绝接收。"
}
//-->
</script>
<%
dim WExcel
set WExcel=server.CreateObject("WExcel.Sheet")
dim MaxRecord,ImportMaxSize
WExcel.GetImportMaxSize MaxRecord,ImportMaxSize
dim SheetID
SheetID=Request.Cookies("Temp")("SheetID")
dim Exist
Exist=WExcel.SheetExist(cint(UserID),cint(SheetID))
CheckErr
if Exist=false then
Response.Redirect "/hcgis/notfound.asp?Name=数据表&Depth=2"
end if
dim ImportPermit
ImportPermit=WExcel.CheckImportPermit (cint(UserID),cint(SheetID))
CheckErr
Response.Cookies("Temp")("ImportFor")="sheet"
%>
<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</HEAD>
<%if ImportPermit<>0 then%>
<BODY>
<table align=center width="70%" border=0 CELLSPACING="1" CELLPADDING="0">
<tr height=200 valign=center>
<td>
您无权导入数据,导入数据实质上也是一种录入操作,但系统未授予您录入权限。
</td>
</tr>
<tr>
<td>
<input id="btnClose" type="button" value="关闭" name="btnClose" style="CURSOR: hand; HEIGHT: 24px; WIDTH: 65px" LANGUAGE="javascript" onclick="return Close()">
</td>
</tr>
</table>
</BODY>
<%else%>
<BODY onload="return ImportLimitPrompt()">
<form METHOD="post" name="frmData" ENCTYPE="multipart/form-data">
<table align=center width="70%" border=0 cellPadding=0 cellSpacing=0>
<tr height=35>
<td>
<b>第1步:选择导入文件(.xls)</b>
</td>
</tr>
<tr height=65>
<td colspan=2>
您现有的数据无需再次输入,可直接导入本系统。
</td>
</tr>
<tr height=125 valign=top>
<td>
<input TYPE='file' NAME='ImportFile' style="width:350px" maxLength=255>
</td>
</tr>
<tr height=40>
<td>
<p id=Prompt></p>
</td>
</tr>
<tr height=40 valign=bottom>
<td>
<table align=center width="71%">
<tr>
<td width="33%"><input id="btnCancel" type="button" value="取消" name="btnCancel" style="CURSOR: hand; HEIGHT: 24px; WIDTH: 65px" LANGUAGE="javascript" onclick="return Cancel()"></td>
<td width="33%"><input id="btnPre" type="button" disabled value="上一步" name="btnPre" style="CURSOR: hand; HEIGHT: 24px; WIDTH: 65px" LANGUAGE="javascript" onclick="return Pre()"></td>
<td width="33%"><input id="btnNext" type="button" value="下一步" name="btnNext" style="CURSOR: hand; HEIGHT: 24px; WIDTH: 65px" LANGUAGE="javascript" onclick="return Next()"></td>
</tr>
</table>
</td>
</tr>
<iframe id="SaveArea" name="SaveArea" style="VISIBILITY: hidden" width="0" height="0" frameborder="0" src="">
</iframe>
</table>
</form>
<input TYPE="hidden" NAME="MaxRecord" id="MaxRecord" value="<%=MaxRecord%>">
<input TYPE="hidden" NAME="ImportMaxSize" id="ImportMaxSize" value="<%=ImportMaxSize%>">
</BODY>
<%end if%>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -