<html>
<head>
<meta http-equiv = "content-type" content = "text/html; charset = gb2312">
<title>歴史的なメッセージ</title>
<スクリプト言語= "javascript">
<! -
function checkall(form){
for(var i = 0; i <document.checkboxform1.length; i ++){
var e = document.checkboxform1 [i];
if(e.name!= 'chkall')e.checked = form.chkall.checked;
}
}
//レコードが選択されているかどうかを確認します
関数checkbox1(form)
{
var thelength;
var i、j;
thelength = form.id.length;
i = 0;
j = 0;
while(i <thelength){
if(form.id [i] .cecked)
J ++;
i ++;
}
if(j == 0 &&!form.id.checked){
alert( "delete recordを選択してください");
falseを返します。
}
trueを返します。
}
//「削除」ボタンがクリックされたときにトリガーされます
functiondel(form)
{
if(!checkbox1(form)){
falseを返します。
}
それ以外
if(confism( 'これらのレコードを削除する」)){
window.location.href = "deletemessage.asp?page = <%= clng(page)%>"}
}
- >
</script>
</head>
<body>
<br> <br> <%
conn = server.createObject( "adodb.connection")を設定します
Provider = "provider = microsoft.jet.oledb.4.0;"
dbpath = "data source ="&server.mappath( "webuuser.mdb")
conn.openプロバイダー&dbpath
username = session( "username")
username <> "" thenの場合
sql = "select * from talks fromname = '"&username& "'またはtroname = '"&username& "' Order by AddDate Desc"
rs = server.createObject( "adodb.recordset")を設定します
rs.open sql、conn、3,3
rs.Pagesize = 15
page = clng(request( "page"))
ページ<1の場合、ページ= 1
page> rs.pagecountの場合、page = rs.pagecount
%>
<table cellpacing = "0" width = 590cellpadding = "0" align = center>
<tr>
<td> <font size = "2">私の履歴メッセージを見る(<b> <font color = "#ff0000">チャット履歴は1週間しか保存されていません。自分のバックアップ</font> </b> )</font> </b>)font> </td>
</tr>
<%rs.eofまたはrs.bofの場合は%>
<tr>
<td> <font color = "#ff0000">歴史的な記録がなければ、すぐにコミュニケーションをとってください</font>! ! ! </td>
</tr>
<%else%>
<tr>
<td align = "center">
<form action = history.asp name = f1>
<%page <> 1 then%>の場合
<a href = history.asp?ページ= 1>ページ1 </a>
<a href = history.asp?page = <%=(page-1)%>>前のページ</a>
<%end if
page <> rs.pagecount then%>の場合
<a href = history.asp?page = <%=(page+1)%>>次のページ</a>
<a href = history.asp?page = <%= rs.pagecount%>>最後のページ</a>
<%end if>
ページ:<font color = "red"> <%= page%>/<%= rs.pagecount%> </font>
<入力型=テキストサイズ= 4 maxlength = 4 name = page>
</form>
</td>
</tr>
<tr>
<td> <%rs、page%> </td>を表示します
</tr>
<%end if>
<tr>
<td>
<%
サブショー(rs、ページ)
rs.absolutepage =ページ
count = rs.Pagesize
%>
<form name = "checkboxform1" method = post action = "deletemessage.asp?page = <%= clng(page)%>">
<table cellpacing = "0" width = "590" cellpadding = "0" align = center>
<%
rs.eofではなく、> 0を数えます
%>
<tr bgcolor = "#d8d3cd">
<td> <入力タイプ= "チェックボックス" name = "id" value = "<%= rs(" id ")%>"> <b> <%= rs( "fromname")%> </b> < %= rs( "adddate")%> paging <b> <%= rs( "toname")%> </b> </td> </tr>
<tr>
<TD高さ= 22> <%
word = cheplage(rs( "word")、vbcrlf、 "<br>")
response.write word%>
</td>
</tr>
<%
count = count-1
rs.movenext
ループ
%>
<tr>
<td>
<入力タイプ= "チェックボックス" id = "check1" name = "chkall" value = "on"> <label for = "check1">チェックボックスまたは漢字をクリックしてすべてのQingを選択します</label>
<入力タイプ= "submit" value = "選択したデータを削除" name = "shanchu"> </td>
</tr>
</table>
</form>
<%end sub%>
</td>
</tr>
</table>
<%
sql = "adddateを選択し、talksからid"
obj = conn.execute(sql)を設定します
obj.eofではない場合
obj.eofではありません
sql = "(day(now) - day(adddate)> 8)"から削除
conn.execute(sql)
obj.movenext
ループ
ifを終了します
obj.close
obj =何も設定しません
ifを終了します
rs.close
rs = Nothingを設定します
conn.close
conn =何も設定しません
%>
</body>
</html>