📄 list.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 View(SheetID,RowID) {
if(window.showModalDialog ("viewframe.asp?Target=view.asp?SheetAndRowID="+SheetID+JoinChar+RowID+JoinChar+RowIDs.value,"","dialogwidth:640px;dialogheight:480px;Status:0;center:1;resizable=1;")==true)
{
window.navigate("list.asp");
}
}
function ViewRef(SheetID,FieldID,FieldValue) {
var RefString;
RefString=SheetID+JoinChar+FieldID+JoinChar+FieldValue;
window.showModalDialog ("viewframe3.asp?Target=viewref.asp?RefString="+RefString,"","dialogwidth:640px;dialogheight:480px;Status:0;center:1;resizable=1;");
}
function window_onload() {
window.parent.RightHead.frmData.CurPage.value=CurPage.value;
window.parent.RightHead.PageNavigate.innerHTML=PageNavigate.value;
window.parent.RightHead.chkAll.status=false;
if(CurPage.value>0)
{
window.parent.RightHead.btnDel.disabled =false;
try
{
window.parent.RightFoot.SummaryLine.innerHTML =SummaryLine.value;
parent.RightPanel.rows=parent.RightHead.RightHeadTable.clientHeight + ",*," + parent.RightFoot.RightFootTable.clientHeight;
}
catch(e)
{
}
}
else
{
window.parent.RightHead.btnDel.disabled =true;
try
{
window.parent.RightFoot.SummaryLine.innerHTML ="";
parent.RightPanel.rows=parent.RightHead.RightHeadTable.clientHeight + ",*," + parent.RightFoot.RightFootTable.clientHeight;
}
catch(e)
{
}
}
}
//-->
</script>
<%
dim WExcel
set WExcel=server.CreateObject("WExcel.Sheet")
dim CurItems,MultiSelectItems,Searched,SearchValues,strWhere,strWhereDesc,strOrderBy,FromSearch
dim CurPage,NoField,PageCount,RecordCount,CurFromRecord,CurToRecord,PageNavigate,RowIDs,CanDeleteRowIDs,SummaryLine
dim SheetID,ViewID
dim SheetData
dim FirstAddRowID
dim AddMode
SheetID=Request.Cookies("Temp")("SheetID")
'确定当前视图
ViewID=Request.Form("SelectView")
if ViewID="" then
ViewID=Request.Cookies("Sheet")("ViewSelect" & SheetID)
else
Response.Cookies("Sheet")("ViewSelect" & SheetID)=ViewID
Response.Cookies("Sheet").Expires = CookieLife
end if
if IsEmpty(ViewID) then
ViewID="-1" '表示未指定缺省视图,也未指定任何公共、私有视图
end if
dim Exist
Exist=WExcel.SheetExist(cint(UserID),cint(SheetID))
CheckErr
if Exist=false then
Response.Redirect "/hcgis/notfound.asp?Name=数据表&Depth=0"
end if
if instr(1,Request.ServerVariables("HTTP_REFERER"),"search.asp")>0 then
'来自于查询操作
FromSearch=1
AddMode=0
strWhere=""
strWhereDesc=""
CurItems=Request.Form("CurItems")
MultiSelectItems=Request.Form("MultiSelectItems")
if CurItems<>"" then
WExcel.GetSQLWhere cint(SheetID),cstr(CurItems),cstr(MultiSelectItems),strWhere,strWhereDesc,SearchValues
end if
strOrderBy=Request.Cookies("Sheet")("OrderBy" & CoID & "-" & SheetID)
CurPage=1
WExcel.GetSheetData cint(UserID),cint(SheetID),cint(ViewID),cint(FromSearch),cint(AddMode),cint(0),cstr(strWhere),cstr(strWhereDesc),strOrderBy,CurPage,NoField,PageCount,RecordCount,CurFromRecord,CurToRecord,PageNavigate,RowIDs,CanDeleteRowIDs,SummaryLine,SheetData
Response.Cookies("Temp")("Where" & SheetID)=strWhere
Response.Cookies("Temp")("CurPage" & SheetID)=CurPage
Response.Cookies("Temp")("AddMode" & SheetID)="0"
Response.Cookies("Temp")("FirstAddRowID" & SheetID)=""
Response.Cookies("Sheet")("Searched" & CoID & "-" & SheetID)="1"
Response.Cookies("SheetSearchValues")(CoID & "-" & SheetID)=SearchValues
Response.Cookies("SheetSearchValues").Expires = CookieLife
Response.Cookies("Sheet").Expires = CookieLife
elseif instr(1,Request.ServerVariables("HTTP_REFERER"),"listhead.asp")>0 then
'来自于排序、翻页操作
strWhere=Request.Cookies("Temp")("Where" & SheetID)
strOrderBy=Request.Form("OrderBy")
CurPage=Request.Form("CurPage")
if Request.Cookies("Temp")("AddMode" & SheetID)="1" then
AddMode=1
WExcel.GetAddModeSheetData cint(UserID),cint(SheetID),cint(ViewID),strWhere,strOrderBy,CurPage,NoField,PageCount,RecordCount,CurFromRecord,CurToRecord,PageNavigate,RowIDs,CanDeleteRowIDs,SummaryLine,SheetData
else
FromSearch=0
AddMode=0
strWhereDesc=""
WExcel.GetSheetData cint(UserID),cint(SheetID),cint(ViewID),cint(FromSearch),cint(AddMode),cint(0),cstr(strWhere),cstr(strWhereDesc),strOrderBy,CurPage,NoField,PageCount,RecordCount,CurFromRecord,CurToRecord,PageNavigate,RowIDs,CanDeleteRowIDs,SummaryLine,SheetData
end if
Response.Cookies("Temp")("CurPage" & SheetID)=CurPage
Response.Cookies("Sheet")("OrderBy" & CoID & "-" & SheetID)=strOrderBy
Response.Cookies("Sheet").Expires = CookieLife
else
'来自于录入、删除、修改、视图设置、视图切换、导入、复制、批量修改操作,来自于自动查询
dim Visited '登录进来后,用户是否访问过此数据表
Visited=Request.Cookies("Login")("Visited" & SheetID)
if Visited="1" then
if Request.Cookies("Temp")("AddMode" & SheetID)="1" then
AddMode=1
FirstAddRowID=Request.Cookies("Temp")("FirstAddRowID" & SheetID)
strWhere = "Fld" & RowID_ID & ">=" & FirstAddRowID & " and Fld" & CreaterID_ID & "=" & UserID
strOrderBy=Request.Cookies("Sheet")("OrderBy" & CoID & "-" & SheetID)
WExcel.GetAddModeSheetData cint(UserID),cint(SheetID),cint(ViewID),strWhere,strOrderBy,CurPage,NoField,PageCount,RecordCount,CurFromRecord,CurToRecord,PageNavigate,RowIDs,CanDeleteRowIDs,SummaryLine,SheetData
Response.Cookies("Temp")("Where" & SheetID)=strWhere
else
'已访问过此数据表,则按照此前的查询条件、页号再现查询结果
FromSearch=0
AddMode=0
strWhereDesc=""
strWhere=Request.Cookies("Temp")("Where" & SheetID)
strOrderBy=Request.Cookies("Sheet")("OrderBy" & CoID & "-" & SheetID)
CurPage=Request.Cookies("Temp")("CurPage" & SheetID)
WExcel.GetSheetData cint(UserID),cint(SheetID),cint(ViewID),cint(FromSearch),cint(AddMode),cint(0),cstr(strWhere),cstr(strWhereDesc),strOrderBy,CurPage,NoField,PageCount,RecordCount,CurFromRecord,CurToRecord,PageNavigate,RowIDs,CanDeleteRowIDs,SummaryLine,SheetData
end if
else
'否则,按照已保存在客户端的查询条件作查询
FromSearch=0
AddMode=0
strWhere=""
strWhereDesc=""
Searched=Request.Cookies("Sheet")("Searched" & CoID & "-" & SheetID)
if Searched="1" then
SearchValues=Request.Cookies("SheetSearchValues")(CoID & "-" & SheetID)
'在V3.82之前,此Cookie的名称是Cookies("Sheet")("SearchValues" & CoID & "-" & SheetID)
'为了保持老用户的兼容性,如果新Cookie未取出值来,则尝试取旧值
if SearchValues="" then
SearchValues=Request.Cookies("Sheet")("SearchValues" & CoID & "-" & SheetID)
end if
WExcel.GetSQLWhereBySearchValue cint(SheetID),SearchValues,strWhere,strWhereDesc
end if
strOrderBy=Request.Cookies("Sheet")("OrderBy" & CoID & "-" & SheetID)
CurPage=1
WExcel.GetSheetData cint(UserID),cint(SheetID),cint(ViewID),cint(FromSearch),cint(AddMode),cint(0),cstr(strWhere),cstr(strWhereDesc),strOrderBy,CurPage,NoField,PageCount,RecordCount,CurFromRecord,CurToRecord,PageNavigate,RowIDs,CanDeleteRowIDs,SummaryLine,SheetData
Response.Cookies("Temp")("Where" & SheetID)=strWhere
Response.Cookies("Temp")("CurPage" & SheetID)=CurPage
Response.Cookies("Temp")("AddMode" & SheetID)=AddMode
Response.Cookies("Temp")("FirstAddRowID" & SheetID)=""
Response.Cookies("Login")("Visited" & SheetID)="1"
end if
end if
CheckErr
dim Count
Count=ubound(SheetData)
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" LANGUAGE="javascript" onload="return window_onload()">
<%if RecordCount<=0 and AddMode=0 then%>
<table width=100%>
<TR height=230 valign="center">
<TD align=center>
没有符合查询条件的数据。
</TD>
</TR>
</table>
<%else%>
<%for i=1 to Count:Response.Write SheetData(i-1):next%>
<%end if%>
<input TYPE="hidden" NAME="RecordCount" value="<%=RecordCount%>">
<input TYPE="hidden" NAME="CurPage" value="<%=CurPage%>">
<input TYPE="hidden" NAME="NoField" value="<%=NoField%>">
<input TYPE="hidden" NAME="PageNavigate" value="<%=PageNavigate%>">
<input TYPE="hidden" NAME="RowIDs" value="<%Count=ubound(RowIDs):for i=1 to Count:IF i=1 then Response.Write RowIDs(i-1) else Response.Write "," & RowIDs(i-1):end if:next%>">
<input TYPE="hidden" NAME="CanDeleteRowIDs" value="<%Count=ubound(CanDeleteRowIDs):for i=1 to Count:IF i=1 then Response.Write CanDeleteRowIDs(i-1) else Response.Write "," & CanDeleteRowIDs(i-1):end if:next%>">
<input TYPE="hidden" NAME="SummaryLine" value="<%=SummaryLine%>">
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -