?? userinfo.asp
字號:
<!--#include file="articleconn.asp"-->
<%if chkcookie(request.cookies("userid"))="" or chkcookie(request.cookies("password"))="" then
%>
<script language="JavaScript">
<!--
function checkinput()
{
if (document.search.userid.value=="")
{
alert("請輸入用戶名!");
document.search.userid.focus();
return false;
}
if (document.search.password.value=="")
{
alert("請輸入密碼!");
document.search.password.focus();
return false;
}
return true;
}
-->
</script>
<title></title>
<body scroll="no" marginwidth="0" leftmargin="0" topmargin="0">
</p>
<p> </p>
<p> </p>
<div align="center">
<center>
<form method="POST" action="userpass.asp" name="search" onsubmit="return checkinput()">
<table border="0" cellpadding="0" cellspacing="1" style="border-collapse: collapse" width="223" id="AutoNumber1" bgcolor="#986800">
<tr>
<td width="100%">
<table border="0" cellspacing="0" style="border-collapse: collapse" width="233" id="AutoNumber1" cellpadding="4" height="109">
<tr>
<td width="223" colspan="2" bgcolor="#986800" height="3">
<font size="2" color="#FFFFFF">點播觀看影視,請先<b>登陸</b>!</font></td>
</tr>
<tr>
<td width="58" bgcolor="#EEEEEE" height="17"><font size="2">用<span lang="en-us">
</span>戶</font><span lang="en-us"><font size="2">:</font></span></td>
<td width="165" bgcolor="#EEEEEE" height="17">
<input type="text" name="userid" size="20" style="color: #000000; border-style: solid; border-width: 1; background-color: #FFCC30"></td>
</tr>
<tr>
<td width="58" bgcolor="#EEEEEE" height="17"><font size="2">密
碼:</font></td>
<td width="165" bgcolor="#EEEEEE" height="17">
<input type="password" name="password" size="20" style="color: #000000; border-style: solid; border-width: 1; background-color: #FFCC30"></td>
</tr>
<tr>
<td width="58" bgcolor="#EEEEEE" height="19"> </td>
<td width="165" bgcolor="#EEEEEE" height="19">
<input type="submit" value="提交" name="B1" style="color: #000000; border-style: solid; border-width: 1; background-color: #FFCC30">
<input type="reset" value="重置" name="B2" style="color: #000000; border-style: solid; border-width: 1; background-color: #FFCC30"></td>
</tr>
<tr>
<td width="223" colspan="2" bgcolor="#EEEEEE" height="13">
<font size="2">你還沒有注冊? </font>
<a target="_blank" href="USER/JOIN.asp">
<font size="2" color="#ff0000">點擊這里立刻申請</font></a></td>
</tr>
</table>
</td>
</tr>
</table>
</form>
</center>
</div>
<%response.end
end if
const MaxPerPage=10
dim totalPut,infoID
dim CurrentPage
dim i,j
if isempty(trim(request("page"))) then
currentPage=cint(trim(request("page")))
else
currentPage=1
end if
%>
<html>
<LINK href="css/style.css" type=text/css rel=stylesheet>
<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"><%=request.cookies("userid")%></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=chkcookie(trim(request("userID")))
infoID=chkcookie(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='img/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);">
<input type="submit" name="submit0" id="submit0" style="height:17px;font-size:11px;" value="刪 除">
</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 " 您共有信息:<font color=""red"">"&totalnumber&"</font> 條 <font color=""red"">"&CurrentPage&"/"&n&"</font> 頁"
response.Write " 轉到 <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=''"">"&_
" <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=""確 定""> "
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'> 首頁 上一頁</font> "
else
response.write "<a href="&filename&"?userID="&userID&"&page=1&> 首頁</a> "
response.write "<a href="&filename&"?userID="&userID&"&page="&CurrentPage-1&">上一頁</a> "
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 + -