Asp program (12:10:19)
ReprintedBytes
| Tags:It |
Classification: Programming |
Select All:
<Script language = 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 action = user1.asp method = post name = user>
<Input type = 'checkbox' value = ''name = num>
<Input type = 'checkbox' value = ''name = num>
<Input type = 'checkbox' value = ''name = num>
<Input type = 'checkbox' name = chkall onclick = 'checkall (this. form) '> select all
<Input type = hidden name = action value = "del">
<Input type = submit value = "delete" onClick = "{if (confirm ('Are you sure you want to delete the selected member? '{%%This.doc ument. user. submit (); return true ;}return false ;}"> </form>
</Div>
Batch Delete
<Div style = "clear: both">
<Script language = 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 action = "" method = "post" name = "user">
<%
Set rsw.conn.exe cute ("select * from guestbook order by xu desc ")
%>
<% If not (rs. eof and rs. bof) then
Do while not rs. eof %>
<Input type = 'checkbox' value = '<% = rs ("id") %> 'name = "num">
<Input name = "guest" type = "text" value = "<% = rs (" guest ") %>" size = "10" maxlength = "10"/>
<% Rs. movenext
Loop
End if
%>
<Input type = 'checkbox' name = chkall onclick = 'checkall (this. form) '> select all
<Input type = "hidden" name = "action" value = "del">
<Input type = "submit" value = "delete" onClick = "{if (confirm ('Are you sure you want to delete the selected member? '{%%This.doc ument. user. submit (); return true ;}return false ;}"> </form>
<%
Action = request. form ("action ")
If action = "del" then
Delnum = request ("num ")
If delnum = "" or isnull (delnum) then
Response. write "<script language = 'javascript '>"
Response. write "alert ('error, you have no choice! ');"
Response. write "location. href = 'guesttest. asp ';"
Response. write "</script>"
Response. end
End if
Conn.exe cute ("delete from guestbook where id in (" & delnum &")")
Response. write "<script language = 'javascript '>"
Response. write "alert ('Operation successful, the selected member has been deleted! ');"
Response. write "location. href = 'guesttest. asp ';"
Response. write "</script>"
Response. end
Conn. close
Set conn = nothing
End if
%>
</Div>
The current record set does not support bookmarks. This may be a restriction on the provider or the selected cursor type
It may be because: set rs1_conn.exe cute ("select * from kuan_type where kuanid like '%" & aboutid & "% 'order by id desc ")
To change it to: set rs = server. createobject ("adodb. recordset ")
SQL = "select * from kuan_type where kuanid like '%" & aboutid & "% 'order by id desc"
Rs. open SQL, conn, 1, 1
Paging jump page
<! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<Html xmlns = "http://www.w3.org/1999/xhtml">
<Head>
<Meta http-equiv = "Content-Type" content = "text/html; charset = gb2312"/>
<Title> log on... </title>
<Link type = "text/css" rel = "stylesheet" href = "style.css"/>
</Head>
<Body>
<! -- # Include file = "commonfile/conn. asp" -->
<! -- # Include file = "commonfile/rik. asp" -->
<% 'Start paging
Const MaxPerPage = 5
Dim totalPut
Dim CurrentPage
Dim TotalPages
Dim j
Dim SQL
If Not isempty (request ("page") then
CurrentPage = Cint (request ("page "))
Else
CurrentPage = 1
End if
Set rs = server. createobject ("adodb. recordset ")
Rs. open "select * from book order by id desc", conn, 1, 1
If err. number <> 0 then
Response. write "no data in the database"
End if
If rs. eof And rs. bof then
Response. Write "<p align = 'center' class = 'contents'> you have not added news! </P>"
Else
TotalPut = rs. recordcount
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, "0001.asp"
Else
If (currentPage-1) * MaxPerPage <totalPut then
Rs. move (currentPage-1) * MaxPerPage
Dim bookmark
Bookmark = rs. bookmark
ShowContent
Showpage totalput, MaxPerPage, "0001.asp"
Else
CurrentPage = 1
ShowContent
Showpage totalput, MaxPerPage, "0001.asp"
End if
End if
End if
Sub showContent
Dim I
I = 0
%>
<% Do while not rs. eof %>
<TABLE cellSpacing = 1 cellPadding = 0 align = center border = 0 class = "chuhuo" width = "1000">
<Form name = "form" method = "post" action = "0001.asp? Id = <% = rs ("id") %> "onSubmit =" return check (); ">
<TR onmouseover = "this. style. background = '# f0f9ff'" onmouseout = "this. style. background = '# fffff'">
<TD> <% = rs ("yiid") %> </TD>
<TD> <input name = "dantime" type = "text" value = "<% = rs (" dantime ") %> "size =" 9 "maxlength =" 20 "> </TD>
<Td> <input type = "submit" name = "Submit" value = "modify" onClick = "return edit ();" style = "cursor: pointer; color: # FF0000; border: 1px #999999 solid "/> <input type =" hidden "name =" update "value =" soedit "/> & nbsp; <a href =" 0001.asp? Shit = del & id = <% = rs ("id") %> "style =" color: # ff0000 "onClick =" return cform (); "> Delete </a> </td>
</TR>
</Form>
</TABLE>
<% I = I + 1
If I> = MaxPerPage then Exit Do
Rs. movenext
Loop
Rs. close
Set rs = nothing %>
<%
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 "<form method = Post action =" & filename & ">"
Response. Write "<p align = 'center' class = 'contents'>"
If CurrentPage <2 Then
Response. Write "<font class = 'contents'> Home page </font>"
Else
Response. Write "<a href =" & filename &"? Page = 1 class = 'contents'> homepage </a>"
Response. Write "<a href =" & filename &"? Page = "& CurrentPage-1 &" class = 'contents'> previous </a>"
End If
If n-currentpage <1 Then
Response. Write "<font class = 'contents'> next last page </font>"
Else
Response. Write "<a href =" & filename &"? Page = "& (CurrentPage + 1) &" class = 'contents'>"
Response. Write "next page </a> <a href =" & filename &"? Page = "& n &" class = 'contents'> last page </a>"
End If
Response. write "<font class = 'contents'> page: </font> <font class = 'contents'> "& CurrentPage &" </font> <font class = 'contents'>/"& n &" page </font>"
Response. Write "<font class = 'contents'> total" & totalnumber & "news"
Response. write "<font class = 'contents'>: </font> <input type = 'text' name = 'page' size = 2 maxlength = 10 class = "smallInput" value = "& currentpage &">"
Response. Write "& nbsp; <input type = 'submit 'class = 'contents' value = 'go 'name = 'cndok'> </form>"
End Function
%>
<%
If request. form ("update") = "soedit" then
Set rs2 = server. createobject ("adodb. recordset ")
Sql2 = "select * from book where id =" & request. QueryString ("id ")
Rs2.open sql2, conn, 1, 3
Rs2 ("dantime") = request ("dantime ")
Rs2.update
Rs2.close
Set rs2 = nothing
Response. write "<script language = 'javascript '>"
Response. write "alert ('Modified successfully ...');"
Response. write "location. href = '2014. asp ';"
Response. write "</script>"
End if
%>
</Body>