<!--#include file="../Inc/Consts.inc" -->
<!--#include file="CheckAdmin.Asp"-->
<!--#include file="../Inc/common.Asp" -->
<!--#include file="../Inc/strfunc.Asp" -->
<%
' Ss简单网站管理系统-开源版 
'晴天设计www.xxzwz.com
If InStr(SsMasterPurview, "|9,") = 0 Then
    response.Write ("<br /><br /><div align=""center""><font style=""color:red; font-size:9pt; "")>您没有管理该模块的权限！</font></div>")
    response.End
End If
%>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="Images/Admin_style.css">
<script language="javascript" src="Admin.js"></script>
<br />
<table class="tableBorder" width="95%" border="0" align="center" cellpadding="5" cellspacing="1">
<form action="DelContent.Asp?Result=About" method="post" name="formDel">
  <tr>
    <th>ID</th>
    <th>生效</th>
    <th width="200" align="left">信息标题</th>
    <th>预览</th>
    <th>显示顺序</th>
    <th>更新时间</th>
    <th>点击</th>
    <th>操作</th>
    <th>选择</th>
  </tr>
  <% AboutList() %>
  </form>
</table>
<% if request.QueryString("Result")="ModifyOrderNum" then call ModifyOrderNum() 
 if request.QueryString("Result")="SaveOrderNum" then call SaveOrderNum() %>
<%
Function AboutList()
    Dim idCount
    Dim pages
    pages = 20
    Dim pagec
    Dim page
    page = CLng(request("Page"))
    Dim pagenc
    pagenc = 2
    Dim pagenmax
    Dim pagenmin
    Dim datafrom
    datafrom = ""&Datapre&"_About"
    Dim datawhere
    datawhere = ""
    Dim sqlid
    Dim Myself, PATH_INFO, QUERY_STRING
    PATH_INFO = request.servervariables("PATH_INFO")
    QUERY_STRING = request.ServerVariables("QUERY_STRING")'
    If QUERY_STRING = "" Or InStr(PATH_INFO & "?" & QUERY_STRING, "Page=") = 0 Then
        Myself = PATH_INFO & "?"
    Else
        Myself = Left(PATH_INFO & "?" & QUERY_STRING, InStr(PATH_INFO & "?" & QUERY_STRING, "Page=") -1)
    End If
    Dim taxis
    taxis = "order by OrderNum asc"
    Dim i
    Dim rs, sql
    sql = "select count(ID) as idCount from ["& datafrom &"]" & datawhere
    Set rs = db(sql,4)
    idCount = rs("idCount")
    If(idcount>0) Then
    If(idcount Mod pages = 0)Then
    pagec = Int(idcount / pages)
Else
    pagec = Int(idcount / pages) + 1
End If
sql = "select id from ["& datafrom &"] " & datawhere & taxis
Set rs = db(sql,2)
rs.pagesize = pages
If page < 1 Then page = 1
If page > pagec Then page = pagec
If pagec > 0 Then rs.absolutepage = page
For i = 1 To rs.pagesize
    If rs.EOF Then Exit For
    If(i = 1)Then
    sqlid = rs("id")
Else
    sqlid = sqlid &","&rs("id")
End If
rs.movenext
Next
End If
If(idcount>0 And sqlid<>"") Then
sql = "select ID,ViewFlag,AboutName,OrderNum,UpdateTime,ChildFlag,Click_Count from ["& datafrom &"] where id in("& sqlid &") "&taxis
Set rs = db(sql,4)
While(Not rs.EOF)
Response.Write "<tr bgcolor=""#d5e9ff"" onMouseMove=""javascript:this.bgColor='#cedcf0';"" onMouseOut=""javascript:this.bgColor='#d5e9ff';"">" & vbCrLf
Response.Write "<td nowrap >"&rs("ID")&"</td>" & vbCrLf
If rs("ViewFlag") Then
    Response.Write "<td nowrap align='center' width=""40""><a href=""Conversion.Asp?id="&rs("ID")&"&LX="&datafrom&"&Operation=down""><font color='blue'>生效</font></a></td>" & vbCrLf
Else
    Response.Write "<td nowrap align='center' width=""40""><a href=""Conversion.Asp?id="&rs("ID")&"&LX="&datafrom&"&Operation=up""><font color='red'>未生效</font></a></td>" & vbCrLf
End If
Response.Write "<td nowrap><a href='Ss_AboutEdit.asp?Result=Modify&ID="&rs("ID")&"' title="""&rs("AboutName")&""">"&StrLeft(rs("AboutName"), 28)&"</a>"& vbCrLf
If rs("ChildFlag") Then Response.Write "<font color='blue'>分页</font>" & vbCrLf
Response.Write "</td>"& vbCrLf
Response.Write "<td nowrap align='center'><a href='../about.asp?id="&rs("id")&"' target=_blank><font color='blue'>动态页</font></a></td>" & vbCrLf
Response.Write "<td nowrap align='center'><font color='blue'>"&rs("OrderNum")&"</font></td>" & vbCrLf
Response.Write "<td nowrap align='center'>"&FormatDate(rs("UpdateTime"),1)&"</td>" & vbCrLf
Response.Write "<td nowrap align='center'>"&rs("Click_Count")&"</td>" & vbCrLf
Response.Write "<td align=""center""nowrap><a href='Ss_AboutEdit.asp?Result=Modify&ID="&rs("ID")&"'>修改</a> <a href='AboutList.Asp?Result=ModifyOrderNum&ID="&rs("ID")&"'>排序</a></td>" & vbCrLf
Response.Write "<td nowrap align='center'><input name='selectID' type='checkbox' value='"&rs("ID")&"'></td>" & vbCrLf
Response.Write "</tr>" & vbCrLf
rs.movenext
Wend
Response.Write "<tr>" & vbCrLf
Response.Write "<td colspan='10' nowrap align=""right"" class=""forumRow""><input onClick=""CheckAll(this.form)"" name=""buttonAllSelect"" type=""button"" id=""submitAllSearch"" value=""全选""> <input onClick=""CheckOthers(this.form)"" name=""buttonOtherSelect"" type=""button"" id=""submitOtherSelect"" value=""反选""> <input name='submitDelSelect' type='button' id='submitDelSelect' value='删除所选' onClick='ConfirmDel(""是否确定删除？删除后不能恢复！"");'></td>" & vbCrLf
Response.Write "</tr>" & vbCrLf
Else
    response.Write "<tr><td nowrap align='center' colspan='10' class=""forumRow"">暂无单页信息</td></tr>"
End If
Response.Write "<tr>" & vbCrLf
Response.Write "<td colspan='10' nowrap class=""forumRow"">" & vbCrLf
Response.Write "<table width='100%' border='0' align='center' cellpadding='0' cellspacing='0'>" & vbCrLf
Response.Write "<tr>" & vbCrLf
Response.Write "<td class=""forumRow"">共计：<font color='red'>"&idcount&"</font>条记录 页次：<font color='red'>"&page&"</font></strong>/"&pagec&" 每页：<font color='red'>"&pages&"</font>条</td>" & vbCrLf
Response.Write "<td align='right'>" & vbCrLf
pagenmin = page - pagenc
pagenmax = page+pagenc
If(pagenmin<1) Then pagenmin = 1
If(page>1) Then response.Write ("<a href='"& myself &"Page=1'><font style='font-size: 14px; font-family: Webdings'>9</font></a> ")
If(pagenmin>1) Then response.Write ("<a href='"& myself &"Page="& page - (pagenc * 2 + 1) &"'><font style='font-size: 14px; font-family: Webdings'>7</font></a> ")
If(pagenmax>pagec) Then pagenmax = pagec
For i = pagenmin To pagenmax
    If(i = page) Then
    response.Write (" <font color='red'>"& i &"</font> ")
Else
    response.Write ("[<a href="& myself &"Page="& i &">"& i &"</a>]")
End If
Next
If(pagenmax<pagec) Then response.Write (" <a href='"& myself &"Page="& page+(pagenc * 2 + 1) &"'><font style='font-size: 14px; font-family: Webdings'>8</font></a> ")
If(page<pagec) Then response.Write ("<a href='"& myself &"Page="& pagec &"'><font style='font-size: 14px; font-family: Webdings'>:</font></a> ")
Response.Write "第<input name='SkipPage' onKeyDown='if(event.keyCode==13)event.returnValue=false' onchange=""if(/\D/.test(this.value)){alert('请输入需要跳转到的页数并且必须为整数！');this.value='"&Page&"';}"" style='width: 28px;' type='text' value='"&Page&"'>页" & vbCrLf
Response.Write "<input name='submitSkip' type='button' onClick='GoPage("""&Myself&""")' value='转到'>" & vbCrLf
Response.Write "</td>" & vbCrLf
Response.Write "</tr>" & vbCrLf
Response.Write "</table>" & vbCrLf
rs.Close
Set rs = Nothing
Response.Write "</td>" & vbCrLf
Response.Write "</tr>" & vbCrLf
End Function



Sub ModifyOrderNum()
    Dim rs, sql, ID, AboutName, OrderNum
    ID = request.QueryString("ID")
    Set rs = server.CreateObject("adodb.recordset")
    sql = "select * from "&Datapre&"_About where ID="& ID
    rs.Open sql, conn, 1, 1
    AboutName = rs("AboutName")
    OrderNum = rs("OrderNum")
    rs.Close
    Set rs = Nothing
    response.Write "<br />"
    response.Write "<table width='100%' border='0' cellpadding='3' cellspacing='0'>"
    response.Write "<form action='Ss_AboutList.Asp?Result=SaveOrderNum' method='post' name='formOrderNum'>"
    response.Write "<tr>"
    response.Write "<td height='24' align='center' nowrap>ID：<input name='ID' type='text' style='width: 28;' value='"&ID&"' maxlength='4' readonly> 单页信息名称：<input name='AboutName' type='text' id='AboutName' style='width: 180;' value='"&AboutName&"' maxlength='35' readonly> 排序号：<input name='OrderNum' type='text' style='width: 60;' value='"&OrderNum&"' maxlength='4' onKeyDown='if(event.keyCode==13)event.returnValue=false' onchange=""if(/\D/.test(this.value)){alert('序号必须为整数！');this.value='"&OrderNum&"';}""> <input name='submitOrderNum' type='submit' class='button' value='保存'></td>"
    response.Write "</tr>"
    response.Write "</form>"
    response.Write "</table>"
End Sub

Sub SaveOrderNum()
    Dim rs, sql
    Set rs = server.CreateObject("adodb.recordset")
    sql = "select * from ["&Datapre&"_About] where ID="& request.Form("ID")
    rs.Open sql, conn, 1, 3
    rs("OrderNum") = request.Form("OrderNum")
    rs.update
    rs.Close
    Set rs = Nothing
    response.redirect "Ss_AboutList.Asp"
End Sub
' Ss简单网站管理系统-开源版 
'晴天设计www.xxzwz.com
%>