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

📄 userinfo.asp

📁 顶级影视站ASP源代码系统。很全面很强大。数据库用access
💻 ASP
字号:
<!--#include file="HMconnection.asp"-->
<%
   if session("username")="" then response.Write("<script laguage='javascript'>alert('对不起,您还没登陆或登陆超时!');window.close();</script>")
   const MaxPerPage=10
   dim totalPut,infoID   
   dim CurrentPage 
   dim i,j 
   if not isempty(trim(request("page"))) then 
      currentPage=cint(trim(request("page")))
   else 
      currentPage=1 
   end if
%><html>
<link rel="stylesheet" href="style/style.css" type="text/css">

<title>用户信息列表</title>
<body>
<center>
  <table width="100%" height="48" border="0">
    <tr> 
  <td height="30"><table width="100%" border="0" cellspacing="1" cellpadding="0" height="8" align="center"> 
    <tr> <td height="2" colspan="2" bgcolor="#FFFFFF"> 
              <DIV ALIGN="CENTER"><font color="#FF9900"><%=session("username")%></font>信 息 列 表<br>
                <hr size="1" width="100%" noshade>
              </DIV>
              <table width="100%" border="0" cellspacing="1" cellpadding="0" height="100%" ALIGN="CENTER"> 
<tr> <td bgcolor="#FFFFFF" height="166" VALIGN="TOP">
<table width="100%" border="1" bordercolor="#FFFFFF" cellpadding="0" cellspacing="0" >
  <tr align="center" bgcolor="#CCCCCC"> 
	<td width="10%">状态</td>
    <td width="7%">操作</td>
    <td width="18%">来自</td>
    <td width="36%">主题</td>
    <td width="29%">日期</td>
  </tr>
  <form action="userinfo.asp" name="msg" method="post">
<% 
dim userinfoSQL,userinfoRS,TotalPages,userID
userID=trim(request("userID"))
infoID=request("infoID")  
'删除信息

if infoID<>"" and userID<>"" then
 conn.execute "delete from UserMsg where UserId="&userID&" and MsgId in ("&infoID&")"
 response.Redirect "userinfo.asp?userID="&userID&""
 response.End
end if

set userinfoRS=server.createobject("adodb.recordset")
  userinfoSQL="select * from UserMsg where UserId="&userID&" order by sendtime DESC" 
  userinfoRS.open userinfoSQL,conn,1,1 
   if userinfoRS.eof and userinfoRS.bof then 
      response.write "<tr align='center'><td  colspan='5'>对不起,您暂无信息!</td></tr></table>"
      TotalPages=0
else
   totalPut=userinfoRS.recordcount
   TotalPages=int(totalPut\MaxPerPage)+1
   if currentpage<1 then
      currentpage=1
   end if

 if (currentpage-1)*MaxPerPage>totalput then
   if (totalPut mod MaxPerPage)=0 then
     currentpage= totalPut \ MaxPerPage
   else
     currentpage= totalPut \ MaxPerPage + 1
   end if
 end if
 
 if currentPage=1 then
   showContent
   showpage totalput,MaxPerPage,"userinfo.asp"
   showpage1 totalput,MaxPerPage,"userinfo.asp"
 else
  if (currentPage-1)*MaxPerPage<totalPut then
    userinfoRS.move  (currentPage-1)*MaxPerPage
    dim bookmark
    bookmark=userinfoRS.bookmark
    showContent
	showpage totalput,MaxPerPage,"userinfo.asp"
    showpage1 totalput,MaxPerPage,"userinfo.asp"
   else
    currentPage=1
    showContent
	showpage totalput,MaxPerPage,"userinfo.asp"
    showpage1 totalput,MaxPerPage,"userinfo.asp"
   end if
 end if
end if
sub showContent
  i=0
do while not userinfoRS.eof%>
   <tr align="center" bgcolor="#ECECEC">
    <td><% if not userinfoRS("readle") then
	response.write("<img src='images/new.gif'>") 
	end if%></td>
    <td><input type="checkbox" name="infoID" id="infoID" value="<%=userinfoRS("MsgId")%>"></td>
    <td><%=userinfoRS("sendman")%></td>
    <td><a href="#" onClick="javascript:window.open('detailMSG.asp?MsgId=<%=userinfoRS("MsgId")%>&userID=<%=userinfoRS("userID")%>','信息内容','width=432,height=288,toolbar=no, status=no, menubar=no, resizable=yes, scrollbars=yes')"><%=userinfoRS("infoName")%></a></td>
    <td><%=userinfoRS("sendtime")%></td>
  </tr>
  
<% i=i+1
if i>=MaxPerPage then exit do
userinfoRS.movenext
loop
%>
<tr align="right" bgcolor="#ECECEC">
<td colspan="5"><input type="hidden" name="userID" value="<%=userID%>">
 选中所显示信息<input type="checkbox" name="chkall" id="chkall" value="" onClick="CheckAll(this.form);">&nbsp;
 <input type="submit" name="submit0" id="submit0" style="height:17px;font-size:11px;" value="删 除">&nbsp;&nbsp;&nbsp;&nbsp;
 </td></tr>
<script language="JavaScript" type="text/javascript">
 function CheckAll(form)
  {
  for (var i=0;i<form.elements.length;i++)
    {
    var e = form.elements[i];
    if (e.name != 'chkall')
       e.checked = form.chkall.checked;
    }
  }

</script>
 </form>
</table>
 <%
end sub
function showpage(totalnumber,maxperpage,filename)
dim n
if totalnumber mod maxperpage=0 then
n= totalnumber \ maxperpage
else
n= totalnumber \ maxperpage+1
end if
Response.Write "<table border=""0"" cellspacing=""1"" bgcolor=#CCCCCC width=""100%"" align=center>"
response.write "<form action="&filename&" method='post' name='tiaozhuan1' target='_self'><tr><td width=""30%"">"
Response.Write "&nbsp;&nbsp;您共有信息:<font color=""red"">"&totalnumber&"</font> 条 <font color=""red"">"&CurrentPage&"/"&n&"</font> 页"
response.Write "&nbsp;&nbsp;转到&nbsp;<input name='userID' type=hidden class=text value="&userID&">"&_ 
            "<input style=""font-size:10px;height:17px;BACKGROUND-COLOR: #cccccc;""  value='页码' type=text name=""page"" size=3 onFocus=""this.value=''"">"&_ 
            "&nbsp;&nbsp;<input name='submit' type=submit STYLE=""BORDER-RIGHT: #000000 1px solid;height:17px; BORDER-TOP: #000000 1px solid; BORDER-LEFT: #000000 1px solid;font-size:11px; COLOR: #000000; BORDER-BOTTOM: #000000 1px "&_
			 "solid; BACKGROUND-COLOR: #cccccc"" value=""确 定"">&nbsp;&nbsp;"
end function

function showpage1(totalnumber,maxperpage,filename)
dim n
if totalnumber mod maxperpage=0 then
n= totalnumber \ maxperpage
else
n= totalnumber \ maxperpage+1
end if
if CurrentPage<2 then
response.write "<font color='999966'>&nbsp;首页 上一页</font>&nbsp;"
else
response.write "<a href="&filename&"?userID="&userID&"&page=1&>&nbsp;首页</a>&nbsp;"
response.write "<a href="&filename&"?userID="&userID&"&page="&CurrentPage-1&">上一页</a>&nbsp;"
end if
if n-currentpage<1 then
response.write "<font color='999966'>下一页 尾页</font>"
else
response.write "<a href="&filename&"?userID="&userID&"&page="&(CurrentPage+1)
response.write ">下一页</a> <a href="&filename&"?userID="&userID&"&page="&n&">尾页</a>"
end if
Response.Write "</td></tr></form></table>"
end function

userinfoRS.close
set userinfoRS=nothing
set conn=nothing

%> 
</td></tr> </table></td></tr> </table></td></tr> </table>
</center>
</body>
</html>
 <script language="VBScript" type="text/VBScript">
	  function tiaozhuan1_onSubmit()
		dim shuru
		shuru=document.tiaozhuan1.page.value
		if isNumeric(shuru) then
		  if shuru><%=TotalPages%> OR shuru<=0 then
			alert"对不起,您的输入页码不存在"
			tiaozhuan1_onSubmit=false
			document.tiaozhuan1.page.focus()
		  end if
		else 
		  alert"对不起,您的输入有误" 
		  tiaozhuan1_onSubmit=false
		  document.tiaozhuan1.page.focus()
		end if
	  end function									    
</script>

⌨️ 快捷键说明

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