<html>
<Evista>
<meta http-oquiv = "content-type" content = "text/html; charset = gb2312">
<title> Mensaje histórico </title>
<script language = "javaScript">
<!-
function checkall (form) {
for (var i = 0; i <document.checkboxform1.length; i ++) {
var e = document.checkboxForm1 [i];
if (e.name! = 'chkall') e.ecked = form.chkall.ecked;
}
}
// verifique si el registro está seleccionado
Función CheckBox1 (formulario)
{
var theLength;
var i, j;
thelength = form.id.length;
i = 0;
j = 0;
while (i <thelength) {
if (Form.id [i]. requisito)
j ++;
i ++;
}
if (j == 0 &&! Form.id.ecked) {
alerta ("Seleccione el registro Eliminar primero");
devolver falso;
}
devolver verdadero;
}
// activado cuando se hace clic en el botón "Eliminar"
función del (formulario)
{
if (! checkbox1 (form)) {
devolver falso;
}
demás
if (confirmar ('¿está seguro de que desea eliminar estos registros')) {
Window.location.href = "Deletemessage.asp? Page = <%= Clng (Page)%>"}
}
->
</script>
</ablo)
<Body>
<br> <br> <%
establecer conn = server.createObject ("ADODB.Connection")
Provider = "Provider = Microsoft.Jet.OLEDB.4.0;"
Dbpath = "data source =" & server.mappath ("webuuser.mdb")
Conn.open Provider & Dbpath
UserName = Session ("Nombre de usuario")
Si el nombre de usuario <> "" entonces
sql = "Seleccionar * de charlas donde fromName = '" & username & "' o toname = '" & username & "' orden por adddate descielo"
Establecer rs = server.createObject ("ADODB.Recordset")
Rs.open SQL, Conn, 3,3
rs.pagesize = 15
Página = CLNG (request ("Página"))
If página <1 entonces página = 1
If página> rs.pageCount entonces página = rs.pageCount
%>
<TABLE CELLPACING = "0" Width = 590CellPadding = "0" Alinee = Center>
<tr>
<TD> <font size = "2"> Ver mis mensajes históricos (<b> <font color = "#ff0000"> El historial de chat solo se guarda durante una semana, haga una copia de seguridad de los suyos </font> </b> ) </font> </b>) Font> </td>
</tr>
< % si rs.eof o rs.bof entonces %>
<tr>
<TD> <font color = "#ff0000"> Sin su registro histórico, ¡comuníquese con usted rápidamente </font>! ! ! </td>
</tr>
< % else %>
<tr>
<td align = "centro">
<Form Action = History.asp Name = F1>
< % Si página <> 1 entonces %>
<a href = History.asp? Page = 1> Página 1 </a>
<A href = History.asp? Page = <%= (Page-1)%>> Página anterior </a>
<% Final si
Si página <> rs.pageCount entonces%>
<A href = History.asp? Page = <%= (página+1)%>> Página siguiente </a>
<A href = History.asp? Page = <%= Rs.PageCount%>> Última página </a>
< % Final si %>
Páginas: <font color = "rojo"> <%= página%>/<%= rs.pageCount%> </font>
<Input type = text size = 4 maxLength = 4 name = página>
</form>
</td>
</tr>
<tr>
<TD> < % show rs, página %> </td>
</tr>
< % final si %>
<tr>
<TD>
<%
Sub Show (RS, Página)
Rs.AbsolutePage = Página
count = rs.pagesize
%>
<Form de nombre = "checkBoxForm1" método = post Action = "DeletEMessage.asp? Page = <%= Clng (Page)%>">
<table cellPacing = "0" width = "590" cellPadding = "0" alineando = Center>
<%
Haga mientras no rs.eof y cuente> 0
%>
<tr bgcolor = "#d8d3cd">
<TD> <input type = "checkbox" name = "id" value = "<%= rs (" id ")%>"> <b> <%= rs ("fromname")%> </b> < %= rs ("adddate")%> pagaging <b> <%= rs ("toname")%> </b> </td> </tr>
<tr>
<td altura = 22> <%
word = reemplazar (rs ("palabra"), vbcrlf, "<br>")
Respuesta. Escribe Word %>
</td>
</tr>
<%
recuento = recuento-1
Rs.Movenext
bucle
%>
<tr>
<TD>
<input type = "checkBox" id = "check1" name = "chkall" value = "en"> <etiqueta for = "check1"> Haga clic en la casilla de verificación o caracteres chinos para seleccionar todo Qing </etiqueta>
<input type = "enviar" valor = "eliminar datos seleccionados" name = "shanchu"> </td>
</tr>
</table>
</form>
<% final sub%>
</td>
</tr>
</table>
<%
sql = "Seleccione AddDate, ID de las conversaciones"
establecer obj = conn.execute (SQL)
Si no es obj.eof entonces
haz mientras no obj.eof
sql = "Eliminar de las charlas donde (día (ahora) -day (adddate)> 8)"
Conn.execute (SQL)
obj.movenext
bucle
final si
obj.clar
establecer obj = nada
final si
rs.
establecer RS = nada
Conn.clar
establecer conn = nada
%>
</body>
</html>