⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 funpage.asp

📁 很漂亮的一个网络公司的源码
💻 ASP
字号:
<!--#include file="Function.asp"-->
<%
Private Sub ShowPage(strPageID,ShowNV,PageSizeNum,ByVal strSQLWhere)
	Dim strSQL
	Dim objRs
	Dim PageNum

	Page = strPageID
	
	strSQL = "SELECT News.tid, News.p_Title, News.p_Date FROM News " & strSQLWhere & " order by [tid] desc "

	Set objRs=Server.CreateObject("ADODB.RecordSet")
	'Call OpenDataBase(0)'打開数据库
	'Call OpenData()
	objRs.Open strSQL,Conn,1,1

	With objRs
		If .eof and .bof then
			page = 1
			pagecountNum = 1
			CountNum=0
			Response.Write "<tr><td align=""center""  class=""TableFontColorWhite""><font color='red'> 暂无信息 </font></td></tr>"
		Else			
			CountNum = .RecordCount

			.pagesize = PageSizeNum'设定每页显示的记录数
			
			if page<1 then'设定页数的值
				page=1
			elseif page>.pagecount then
				page=.pagecount
			else
				page=page
			End if

			pagecountNum=.Pagecount

			.absolutepage = page'设定当前活动页

			recordsetcount=1


			Do while not .eof and recordsetcount<=.pagesize

			OutStr "<tr>"
			OutStr "<td height=""22"" class=""TableFontColorWhite""><img src=""Images/dot3.gif"" width=""12"" height=""10"">"
			OutStr "<a href=""shownews.asp?newID=" & .Fields(0).Value & """>" & GetTitle(.Fields(1).Value,35) & "</a>  (" & FormatDateTime(.Fields("p_Date").Value,2) & ") </td></tr>" & vbcrlf
			OutStr "</td>"
			OutStr "</tr>"
			OutStr "<tr>"
            OutStr "<td height=""1"" background=""Images/dot2.jpg""></td>"
			OutStr "</tr>"


				.MoveNext
				recordsetcount=recordsetcount+1
			Loop			

		End if
	objRs.Close		
	End With
	if ShowNV Then
		Response.Write "<tr><td colspan=""4"">" & vbcrlf
		ShowPageNav
		Response.Write "</td></tr>" & vbcrlf
	End if
Set objRs=Nothing
End Sub
Private Sub OutStr(ByVal strValue)
	Response.Write strValue & vbcrlf
End Sub
Public Sub ShowNew(ByVal NewID)
'文章ID,类别ID
	Dim strSQL
	Dim ObjRs
	strSQL="SELECT * from news where tid=" & NewID
	'
	Call OpenData()
	Set ObjRs=Conn.Execute(strSQL)
	With ObjRs
		If .Eof And .Bof Then
			Response.Write "你访问的信息不存在!"
			'Response.End
		Else
			Response.Write .Fields("p_Content").Value
		End If
	End With
	ObjRs.Close:Set objRs=Nothing
End Sub
Public Sub ShowTop10News(Byval strTypeID)
'函数说明:显示最新10条新闻
'是否以点击量排续 True 是 False 最新的新闻
	Dim strSQL
	Dim objRs
	Dim PageNum
	Page = strPageID
	Dim aspFile
	
	strSQL="SELECT Top 5 tid, p_Title from News Where TypeID=" & strTypeID & " order by tid desc"

	Set objRs=Server.CreateObject("Adodb.Recordset")
	objRs.Open strSQL,Conn,1,1
	
	With objRs
		If .eof and .bof then
			page = 1
			pagecountNum = 1
			CountNum=0
		Else			
			CountNum = .RecordCount
			Do while not .eof and recordsetcount<=.pagesize
				
				OutStr "<tr>"

				OutStr "<td style=""line-height:150%;padding:0 0 0 5;color:#005FA9;"">"
				OutStr "<a href=""shownews.asp?newID=" & .Fields(0).Value & """>" & .Fields(1).Value & "</a>"				
				OutStr "</td>"
				OutStr "</tr>"
				OutStr "<tr>"
				OutStr "<td height=""1"" bgcolor=""#EDEFF0""></td>"
				OutStr "</tr>"
				.MoveNext
				recordsetcount=recordsetcount+1
			Loop
		End if
	objRs.Close		
	End With
Set objRs=Nothing
End Sub

Private Sub OutStr(ByVal strValue)
	Response.Write strValue & vbcrlf
End Sub

'Private Const PageSizeNum = 25
'后台新闻管理分页
Private Sub ShowManagePage(strPageID,PageSizeNum,strSQLWhere,strFile)
	Dim strSQL
	Dim objRs
	Dim PageNum
	Dim page
	Page = strPageID
	If strSQLWhere="" Then
		strSQL="SELECT tID, p_Title,p_Date,p_Hits,TypeID FROM News order by tID desc "
	Else
		strSQL="SELECT tID, p_Title,p_Date,p_Hits,TypeID FROM News Where" & strSQLWhere & " order by tID desc "
	End if

	Set objRs=Server.CreateObject("ADODB.RecordSet")


	objRs.Open strSQL,Conn,1,1

	With objRs
		If .eof and .bof then
			Response.Write "<tr  bgcolor='#f3f3f3'><td colspan=""3"">"

			Response.Write "暂无信息"
			Response.Write  "</td>"
		Else			
			CountNum = .RecordCount

			.pagesize = PageSizeNum'设定每页显示的记录数
			
			if page<1 then'设定页数的值
				page=1
			elseif page>.pagecount then
				page=.pagecount
			else
				page=page
			End if

			pagecountNum=.Pagecount

			.absolutepage = page'设定当前活动页

			recordsetcount=1

			Do while not .eof and recordsetcount<=.pagesize
				Response.Write "<tr bgcolor='#f3f3f3'><td>"
				Response.Write  "<li>" &  GetTitle(.Fields(1).Value,35)

				Response.Write "<td align=center>" & .Fields(2).value & "</td>"
				
				Response.Write "<td>"				
				Response.Write "<a href=" & strFile & "?id=" & .Fields(0).value & ">修改</a>&nbsp&nbsp"
				Response.Write "<a href='javascript:deleted(" & .Fields(0).value &  ")'>删除</a>"
				Response.Write "</td></tr>"
				.MoveNext
				recordsetcount=recordsetcount+1
			Loop
		End if
%>
<tr bgcolor='#f3f3f3'>
<td height="30" colspan="3">
共有 <font color="red"><%=.recordcount%></font> 条记录 共 <font color="red"><%=.pagecount%></font> 页<!--'分页显示设置-->
    <%if page>1 then%>
      <a href=?page=1>首页</a>
      <a href=?page=<%=page-1%>>上一页</a>
    <%else%>
       首页
       上一页
    <%end if%>
   <%if page<.pagecount then%>
       <a href=?page=<%=page+1%>>下一页</a>
       <a href=?page=<%=.pagecount%>>尾页</a>
   <%else%>
        下一页
        尾页
  <%end if%>
    页次:<font color="red"><%=page%>/<%=.pagecount%></font>	
</td>
</tr>
<%
End With
Set objRs=Nothing
End Sub
Private Sub UserShowManage(strPageID,PageSizeNum)
	Dim strSQL
	Dim objRs
	Dim PageNum
	Dim page
	Page = strPageID

	strSQL = "Select uID,UserName, LoginName, Sex, Tel, cLogin, AddDate From uInfo Order By cLogin Asc"
	Set objRs=Server.CreateObject("ADODB.RecordSet")
	Call OpenDataBase(1)'打開数据库
	objRs.Open strSQL,Conn,1,1
	With objRs
		If .eof and .bof then
			Response.Write "<tr  bgcolor='#f3f3f3'><td colspan=""6"">"
			Response.Write "暂无信息"
			Response.Write  "</td>"
		Else			
			CountNum = .RecordCount
			.pagesize = PageSizeNum'设定每页显示的记录数			
			if page<1 then'设定页数的值
				page=1
			elseif page>.pagecount then
				page=.pagecount
			else
				page=page
			End if
			pagecountNum=.Pagecount
			.absolutepage = page'设定当前活动页
			recordsetcount=1
			Do while not .eof and recordsetcount<=.pagesize
				Response.Write "<tr bgcolor='#f3f3f3'><td>"
				Response.Write  "<li>" &  GetTitle(.Fields("UserName").Value,35)
				Response.Write "<td align=center bgcolor='#f3f3f3'>" & .Fields("Sex").value & "</td>"
				Response.Write "</td><td align=center bgcolor='#f3f3f3'>" & .Fields("Tel").value & "</td>"				
				Response.Write "<td align=center bgcolor='#f3f3f3'>" & .Fields("AddDate").value & "</td>"
				Response.Write "<td align=center>"
				If .Fields("cLogin").Value = 0 Then
					Response.Write "<a href=""UserSH.Asp?tID=1&uID=" & .Fields("uID").Value & """><font color=red>审核</font></a>"
				Else
					Response.Write "<a href=""UserSH.Asp?tID=2&uID=" & .Fields("uID").Value & """>取消审核</a>"
				End If
				Response.Write "</td><td align=""center"">"
				Response.Write "<a href=ShowUserInfo.asp?id=" & .Fields("uID").value & ">查看详情</a>&nbsp&nbsp"
				Response.Write "<a href='javascript:deleted(" & .Fields("uID").value &  ")'>删除</a>"
				Response.Write "</td></tr>"
				.MoveNext
				recordsetcount=recordsetcount+1
			Loop
		End if
%>
<tr bgcolor='#f3f3f3'>
<td height="30" colspan="6">
共有 <font color="red"><%=.recordcount%></font> 条记录 共 <font color="red"><%=.pagecount%></font> 页<!--'分页显示设置-->
    <%if page>1 then%>
      <a href=?page=1>首页</a>
      <a href=?page=<%=page-1%>>上一页</a>
    <%else%>
       首页
       上一页
    <%end if%>
   <%if page<.pagecount then%>
       <a href=?page=<%=page+1%>>下一页</a>
       <a href=?page=<%=.pagecount%>>尾页</a>
   <%else%>
        下一页
        尾页
  <%end if%>
    页次:<font color="red"><%=page%>/<%=.pagecount%></font>	
</td>
</tr>
<%
End With
Set objRs=Nothing
End Sub
Private Function GetTitle(strValue,TitleSize)
	GetTitle=gotTopic(XCHTMLEncode(strValue),TitleSize)
End function

Private Sub ShowFeedBackPage(strPageID,PageSizeNum)
	Dim strSQL
	Dim objRs
	Dim PageNum
	Dim page
	Page = strPageID
	
	strSQL="SELECT pid,yourname,Email, Address FROM FeedBack order by pid desc"
	
	Set objRs=Server.CreateObject("ADODB.RecordSet")

	objRs.Open strSQL,Conn,1,1

	With objRs
		If .eof and .bof then
			Response.Write "<tr bgcolor='#f3f3f3'><td colspan=4>"
			Response.Write "暂无信息"
			Response.Write "</td></tr>"
		Else			
			CountNum = .RecordCount

			.pagesize = PageSizeNum'设定每页显示的记录数
			
			if page<1 then'设定页数的值
				page=1
			elseif page>.pagecount then
				page=.pagecount
			else
				page=page
			End if
			
			pagecountNum =.Pagecount

			.absolutepage = page'设定当前活动页

			recordsetcount=1

			Do while not .eof and recordsetcount<=.pagesize
				Response.Write "<tr bgcolor='#f3f3f3'><td>"
				Response.Write  "<li>" &  .Fields(1).Value
				Response.Write "<td align=center>" & .Fields(2).Value & "----" & .Fields(3).value & "</td>"
				Response.Write "<td>"
				Response.Write "<a href=Read_feedback.asp?id=" & .Fields(0).value & ">查看</a>&nbsp&nbsp"
				Response.Write "<a href='javascript:deleted(" & .Fields(0).value &  ")'>删除</a>"
				Response.Write "</td></tr>"
				.MoveNext
				recordsetcount=recordsetcount+1
			Loop
		End if
%>
<tr bgcolor='#f3f3f3'>
<td height="30" colspan="3">
共有 <font color="red"><%=.recordcount%></font> 条记录 共 <font color="red"><%=.pagecount%></font> 页<!--'分页显示设置-->
    <%if page>1 then%>
      <a href=?page=1>首页</a>
      <a href=?page=<%=page-1%>>上一页</a>
    <%else%>
       首页
       上一页
    <%end if%>
   <%if page<.pagecount then%>
       <a href=?page=<%=page+1%>>下一页</a>
       <a href=?page=<%=.pagecount%>>尾页</a>
   <%else%>
        下一页
        尾页
  <%end if%>
    页次:<font color="red"><%=page%>/<%=.pagecount%></font>	
</td>
</tr>
<%
End With
Set objRs=Nothing
End Sub

Private Sub ShowPageNav()
%>
<table border="0" cellpadding="0" style="border-collapse: collapse" width="98%">
<tr>
<td width="5"></td>
<td height="30" style="color:#FFFFFF">
共找到 <font color="red"><%=CountNum%></font> 条记录 共 <font color="red"><%=pagecountNum%></font> 页<!--'分页显示设置-->
    <%if page>1 then%>
      <a href="?page=1&TypeID=<%=sTypeID%>">首页</a>
      <a href="?page=<%=page-1%>&TypeID=<%=sTypeID%>">上一页</a>
    <%else%>
       首页
       上一页
    <%end if%>
   <%if page<pagecountNum then%>
       <a href="?page=<%=page+1%>&TypeID=<%=sTypeID%>">下一页</a>
       <a href="?page=<%=pagecountNum%>&TypeID=<%=sTypeID%>">尾页</a>
   <%else%>
        下一页
        尾页
  <%end if%>
    页次:<font color="red"><%=page%>/<%=pagecountNum%></font>	
</td>
</tr>
</table>
<%
End Sub
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -