📄 admin_itemlist.asp
字号:
<%
Option Explicit
Response.Buffer = True
Response.Expires = -1
Response.ExpiresAbsolute = Now() - 1
Response.CacheControl = "no-cache"
%>
<!--#Include File="../Conn.asp"-->
<!--#include File="Admin_CheckCode.asp"-->
<!--#include File="Class/Admin_ClassAdmin.asp"-->
<!--#include File="Class/Admin_ClassCommon.asp"-->
<%
Sub ApplicationTerminate()
On Error Resume Next
Set EL_Admin = Nothing
Set EL_Common = Nothing
Call CloseConn()
If Err Then Err.Clear
Response.End()
End Sub
Dim EL_Admin, EL_Common
Set EL_Admin = New Class_Admin
Set EL_Common = New Class_Common
If EL_Admin.ErrorCode = 1 Then
Response.Write "请登陆后在使用此功能"
Call ApplicationTerminate()
ElseIf EL_Admin.ErrorCode = 2 Then
Response.Write "<font color=red>系统禁止了两个人使用同一帐号同时登陆系统,此帐号已经在别的地方登陆。</font>"
Call ApplicationTerminate()
End If
Dim DialogType, PageTitle, s
Dim ListCmd, rsList, RowCount, i, ScriptName
Dim StrFields, StrCondition, SelectedInfoID, SelectedInfoName
Dim Keyword, TotalRowCount, PageCounts, PageSizes, CurrentPage, URLParameters
Dim Tables, PrimaryKey, Sort, Province, City, Area
DialogType = EL_Common.ELRequest("DialogType", 1)
s = EL_Common.ELRequest("s", 1)
Keyword = EL_Common.ReplaceBadChar(EL_Common.ELRequest("Keyword", 1))
CurrentPage = EL_Common.ELRequest("page", 2)
PageSizes = EL_Common.ELRequest("pagesizes", 2)
Province = EL_Common.ELRequest("sProvince", 3)
City = EL_Common.ELRequest("sCity", 3)
Area = EL_Common.ELRequest("sArea", 3)
If PageSizes = 0 Then PageSizes = 40
URLParameters = Request.ServerVariables("QUERY_STRING")
URLParameters = EL_Common.ReplaceText(URLParameters, "\&{0,}pagesizes=[0-9]*", "")
If CurrentPage<1 Then
CurrentPage = 1
Else
URLParameters = EL_Common.ReplaceText(URLParameters, "\&{0,}page=[0-9]*", "")
End If
If s = "" Then
SelectedInfoID = "0"
SelectedInfoName = ""
Else
Dim ArrInfo, aItem
ArrInfo = Split(s, "$")
For i = 0 To Ubound(ArrInfo)
aItem = Split(ArrInfo(i), "|")
SelectedInfoID = EL_Common.Join2String(SelectedInfoID, Right(aItem(0), Len(aItem(0))-Instr(aItem(0), "=")), ",")
SelectedInfoName = EL_Common.Join2String(SelectedInfoName, aItem(1), ",")
Next
End If
Select Case DialogType
Case "Hotel":
PageTitle = "酒店"
ScriptName = "ShowHotel.asp?HotelID="
Tables = "EL_Hotel,EL_Channel"
PrimaryKey = "EL_Hotel.HotelID"
Sort = "EL_Hotel.HotelID DESC"
StrFields = "EL_Hotel.HotelID,EL_Hotel.HotelName,EL_Channel.ChannelDir"
StrCondition = "EL_Hotel.Deleted=0 And EL_Hotel.Passed=1 And EL_Hotel.ChannelID=EL_Channel.ChannelID "
If SelectedInfoID <> "0" Then StrCondition = StrCondition &" And EL_Hotel.HotelID NOT IN("& SelectedInfoID &")"
If Province <> "" Then StrCondition = StrCondition &" And EL_Hotel.Province='"& Province &"'"
If City <> "" Then StrCondition = StrCondition &" And EL_Hotel.City='"& City &"'"
If Area <> "" Then StrCondition = StrCondition &" And EL_Hotel.Area='"& Area &"'"
If Keyword <> "" Then StrCondition = StrCondition &" And EL_Hotel.HotelName Like '%"& Keyword &"%'"
Case "Sight":
PageTitle = "景点"
ScriptName = "ShowSight.asp?SightID="
Tables = "EL_Sight,EL_Channel"
PrimaryKey = "EL_Sight.SightID"
Sort = "EL_Sight.SightID DESC"
StrFields = "EL_Sight.SightID,EL_Sight.SightName,EL_Channel.ChannelDir"
StrCondition = "EL_Sight.Deleted=0 And EL_Sight.Passed=1 And EL_Sight.ChannelID=EL_Channel.ChannelID "
If SelectedInfoID <> "0" Then StrCondition = StrCondition &" And EL_Sight.SightID NOT IN("& SelectedInfoID &")"
If Province <> "" Then StrCondition = StrCondition &" And EL_Sight.Province='"& Province &"'"
If City <> "" Then StrCondition = StrCondition &" And EL_Sight.City='"& City &"'"
If Area <> "" Then StrCondition = StrCondition &" And EL_Sight.Area='"& Area &"'"
If Keyword <> "" Then StrCondition = StrCondition &" And EL_Sight.SightName Like '%"& Keyword &"%'"
Case Else:
Response.Write "页面参数错误"
Call ApplicationTerminate()
End Select
Call EL_Common.InitCommand(ListCmd, "EL_SP_SplitPage")
With ListCmd
.Parameters.Append .CreateParameter("RETURN", 3, 4, 4)
.Parameters.Append .CreateParameter("@Tables", 200, 1, 50, Tables)
.Parameters.Append .CreateParameter("@PrimaryKey", 200, 1, 20, PrimaryKey)
.Parameters.Append .CreateParameter("@Sort", 200, 1, 200, Sort)
.Parameters.Append .CreateParameter("@CurrentPage", 3, 1, 4, CurrentPage)
.Parameters.Append .CreateParameter("@PageSize", 3, 1, 4, PageSizes)
.Parameters.Append .CreateParameter("@Fields", 200, 1, 1000, StrFields)
.Parameters.Append .CreateParameter("@Filter", 200, 1, 1000, StrCondition)
.Parameters.Append .CreateParameter("@Group", 200, 1, 1, "")
.Parameters.Append .CreateParameter("@TotalRowCount", 3, 2, 4)
.Parameters.Append .CreateParameter("@PageCount", 3, 2, 4)
Set rsList = .Execute()
End With
rsList.Close()
RowCount = ListCmd(0)
TotalRowCount = ListCmd(9)
PageCounts = ListCmd(10)
%>
<html>
<head>
<title>选择<%=PageTitle%></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<link href='Admin_Style.css' type='text/css' rel='stylesheet'>
<script language="javascript" src="../js/Common.js"></script>
<script language="javascript" src="../js/City.js"></script>
<base target="_self">
<script language="javascript">
function OK(){
var frm = getObject("myform");
var ret = "";
for (var i=0;i<frm.elements.length;i++){
var e = frm.elements[i];
if (e.type == 'checkbox' && e.name=='ItemObject' && e.checked == true ){
if(ret==""){
ret = e.value;
}else{
ret = ret +"$"+ e.value;
}
}
}
if(ret!=""){
window.returnValue = ret;
}else{
window.returnValue = null;
}
window.close()
}
function initOption(o, df, source, pname, pvalue){
var e = getObject(o);
var sindex = 0;
var name, spell;
clearOption(o);
for(var i=0;i<source.length;i++){
name = source[i].name
spell = source[i].spell;
if(pname == ""){
e.options.add(new Option(spell.substring(0, 1).toUpperCase() +" - "+ name, name));
sindex++;
}else{
if(source[i][pname]==pvalue){
e.options.add(new Option(spell.substring(0, 1).toUpperCase() +" - "+ name, name));
sindex++;
}
}
if(name==df) e.selectedIndex = sindex;
}
}
function onProvinceChange(dfCity, flag){
var o = getObject("sProvince");
if(o.value!=""){
initOption("sCity", dfCity, City, "province", o.value);
}else{
clearOption("sCity");
}
onCityChange("", flag);
}
function onCityChange(dfArea, flag){
var o = getObject("sCity");
if(o.value!=""){
initOption("sArea", dfArea, Area, "city", o.value);
}else{
clearOption("sArea");
}
onAreaChange(flag);
}
function onAreaChange(flag){
if(flag) document.Search.submit();
}
function clearOption(o){
var e = getObject(o);
for(i=e.options.length-1;i>0;i--){
e.remove(i);
}
}
</script>
</head>
<body>
<form name="Search" action="Admin_ItemList.asp" method="post">
<table width="100%" border="0" cellpadding="0" cellspacing="1" class="Border">
<tr>
<td width="5%" nowrap class="td_ItemName">条件过滤:</td>
<td width="95%" class="td_ItemName">
<select name="sProvince" id="sProvince" onChange="onProvinceChange('', true)">
<option value="" selected>选择省份…</option>
</select>
<select name="sCity" id="sCity" onChange="onCityChange('', true)">
<option value="" selected>选择城市…</option>
</select>
<select name="sArea" id="sArea" onChange="onAreaChange(true)">
<option value="" selected>选择区域…</option>
</select>
<script>
initOption("sProvince", "<%=Province%>", Province, "", "");
onProvinceChange("<%=City%>", false);
onCityChange("<%=Area%>", false);
</script>
<input name="Keyword" type="text" id="Keyword" value="<%=Keyword%>">
<input type="submit" name="Submit3" value="搜索">
<input name="DialogType" type="hidden" id="DialogType" value="<%=DialogType%>">
<input name="s" type="hidden" id="s" value="<%=s%>"> </td></tr>
<% If SelectedInfoName <> "" Then %>
<tr>
<td nowrap class="td_ItemName"><strong>已选择的<%=PageTitle%></strong></td>
<td nowrap class="item_25"><%=SelectedInfoName%></td>
</tr>
<% End If %>
</table>
</form>
<table width="100%" border="0" cellspacing="1" cellpadding="0">
<tr>
<td align="right"><%Call ShowPage(URLParameters, CurrentPage, PageSizes, PageCounts, TotalRowCount, "信息", "条")%></td>
</tr>
</table>
<form name="myform" action="" onSubmit="return false" method="post">
<table width="100%" border="0" cellpadding="0" cellspacing="1" class="Border">
<tr>
<%
rsList.Open()
For i = 1 To RowCount
Response.Write "<td id=""td_"& i &""" class=""td_25"">"
Response.Write "<input type=""checkbox"" name=""ItemObject"" id=""ItemObject"" value="""& InstallDir & rsList(2) &"/"& ScriptName & rsList(0) &"|"& EL_Common.HTMLEncode(rsList(1)) &""" onclick=""getObject('td_"& i &"').className=(this.checked)?'MouseOver_25':'td_25'"">"
Response.Write "<a href='"& InstallDir & rsList(2) &"/"& ScriptName & rsList(0) &"' target='_blank' style='color:blue; text-decoration:underline;'>"& EL_Common.HTMLEncode(rsList(1)) &"</a>"
Response.Write "</td>"
If (i mod 4)=0 And i<RowCount Then Response.Write "</tr><tr>"
If i<RowCount Then rsList.MoveNext
Next
rsList.Close()
Set rsList = Nothing
Set ListCmd = Nothing
%>
</tr>
</table>
<table width="100%" border="0" cellspacing="1" cellpadding="0">
<tr>
<td align="center" class="td_50">
<input type="button" name="Submit" value=" 确 定 " onClick="OK()">
<input type="button" name="Submit2" value=" 取 消 " onClick="window.returnValue=null;window.close();"></td>
</tr>
</table>
</form>
<%
Sub ShowPage(ByVal URL, ByVal CurrentPage, ByVal PageSizes, ByVal PageCounts, ByVal TotalRowCount, ByVal ItemName, ByVal ItemUnit)
Dim StrHtml, i, ScriptName
ScriptName = Request.ServerVariables("SCRIPT_NAME") &"?"
If URL = "" Then
ScriptName = ScriptName & URL
Else
ScriptName = ScriptName & URL &"&"
End If
Response.Write "<table border=""0"" cellspacing=""1"" cellpadding=""0"">"
Response.Write "<form name='pageform' action='Admin_SelectFile.asp?"& URL &"' method='Post'><tr><td>"
Response.Write "一共<strong style='color:red'>"& TotalRowCount &"</strong>"& ItemUnit & ItemName &" "
Response.Write "<a href='"& ScriptName &"page=1'>首页</a> "
If CurrentPage = 1 Then
Response.Write "<a disabled>上一页</a> "
Else
Response.Write "<a href='"& ScriptName &"page="& (CurrentPage-1) &"'>上一页</a> "
End If
If CurrentPage >= PageCounts Then
Response.Write "<a disabled>下一页</a> "
Else
Response.Write "<a href='"& ScriptName &"page="& (CurrentPage+1) &"'>下一页</a> "
End If
Response.Write "<a href='"& ScriptName &"page="& PageCounts &"'>尾页</a> "
Response.Write "<strong style='color:red'>"& CurrentPage &"</strong>/<strong>"& PageCounts &"</strong>页 "
Response.Write "<strong>"& PageSizes &"</strong>"& ItemUnit & ItemName &"/页 "
Response.Write "跳转</td><td>"
If PageCounts>3000 Then Response.Flush()
Response.Write "<select onChange=""javascript:submit()"" name='page'>"
For i = 1 To PageCounts
Response.Write "<option value='"& i &"' "& EL_Common.SetObjectSelected(CurrentPage, i) &">第"& i &"页</option>"
Next
Response.Write"</select>"
Response.Write"</td></tr></form></table>"
End Sub
Call ApplicationTerminate()
%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -