www.gusucode.com > 艺帆全站DIV+CSS体育用品公司网站源码 1.7.5源码程序 > i5808/admin_ly.asp
<!--#include file="../Conn.asp" --> <!--#include file="seeion.asp"--> <!--#include file="page.asp" --> <!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=utf-8" /> <link rel="stylesheet" type="text/css" id="css" href="images/style.css"> <title>留言管理</title> <script language="javascript"> <!-- function CheckAll(){ for (var i=0;i<eval(form1.elements.length);i++){ var e=form1.elements[i]; if (e.name!="allbox") e.checked=form1.allbox.checked; } } --> </script> </head> <body> <table width="99%" border="0" align="center" cellpadding="0" cellspacing="1" > <tr> <td height="30" background="images/bg_list.gif"><div style="padding-left:10px; font-weight:bold; color:#0075a9">留言管理</div></td> </tr> <tr> <td bgcolor="#FFFFFF"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="1"> <form id="form1" name="form1" method="post" action="?del=checkbox"> <tr> <td bgcolor="#FFFFFF"><% set rs=server.createobject("adodb.recordset") exec="select * from ly order by id desc" rs.open exec,conn,1,1 if rs.eof then response.write ("<div style=""padding:10px;"">暂无留言!</div>") else rs.PageSize =30 '每页记录条数 iCount=rs.RecordCount '记录总数 iPageSize=rs.PageSize maxpage=rs.PageCount page=request("page") if Not IsNumeric(page) or page="" then page=1 else page=cint(page) end if if page<1 then page=1 elseif page>maxpage then page=maxpage end if rs.AbsolutePage=Page if page=maxpage then x=iCount-(maxpage-1)*iPageSize else x=iPageSize end if %> <% for i=1 to rs.pagesize j=i if j mod 2=0 then bg="#F1F5F8" else bg="#FFFFFF" end if %> </td> </tr> <tr onmouseover="style.backgroundColor='#EEEEEE'" onmouseout="style.backgroundColor='<%=bg%>'" bgcolor="<%=bg%>"> <td colspan="2"><table width="100%" border="0" cellpadding="5" cellspacing="0"> <tr> <td width="8%" class="td"><input name="ID" type="checkbox" id="ID" value="<%=rs("id")%>" /> <%=rs("id")%></td> <td width="29%" height="25" class="td"><a href="xiugai_ly.asp?id=<%=rs("id")%>" style="color:#003399"><%=i5808(rs("title"),150)%></a></td> <td width="10%" class="td"><%=rs("name")%></td> <td width="11%" class="td"><% if IsNull(rs("hf")) or trim(rs("hf")&"")="" then response.Write("<font color=#FF0000>[未回复]</font>") else response.Write("[已回复]") end if %></td> <td width="12%" class="td"><%if rs("sh")=1 then response.Write("[已审核]") else response.Write("<font color=#FF0000>[未审核]</font>") end if%></td> <td width="17%" class="td"><%=rs("data")%></td> <td width="6%" class="td"> <input type="button" name="Submit3" value="回复" onclick="window.location.href='xiugai_ly.asp?id=<%=rs("id")%>' " class="btn"/></td> <%if session("qx")=2 then%> <td width="7%" class="td"> <input type="button" name="Submit" value="删除" onclick="javascript:if(confirm('确定删除?删除后不可恢复!')){window.location.href='?id=<%=rs("id")%>&del=ok';}else{history.go(0);}" class="btn"/></td><%end if%> </tr> </table> <% rs.movenext if rs.eof then exit for next %> <% end if %></td> </tr> <tr ><td height="30"> <input type="checkbox" name="allbox" onclick="CheckAll()" /><label> <select name="lx"> <option selected="selected" value="">操作类型</option> <option value="1">通过审核</option> <option value="2">取消审核</option> <option value="3">批量删除</option> </select> <input type="submit" name="button" id="button" value="提交" class="btn"/> </label></td></tr> <tr> <td height="30"><%call PageControl(iCount,maxpage,page,"border=0 align=right","<p align=right>") rs.close set rs=nothing %></td> </tr> </form> </table></td> </tr> </table> </body> </html> <% if request("del")="ok" then set rs=server.createobject("adodb.recordset") id=Request.QueryString("id") sql="select * from ly where id="&id rs.open sql,conn,2,3 rs.delete rs.update Response.Write "<script>alert('删除成功!');window.location.href='admin_ly.asp';</script>" end if %> <% if Request.QueryString("del")="checkbox" then if Request("id")="" then Response.Write "<script>alert('错误!请选择要操作的记录!');window.location.href='admin_ly.asp';</script>" response.end() end if dim sql lx=request.Form("lx") if lx="" then Response.Write "<script>alert('错误!请选择操作类型!');window.location.href='admin_ly.asp';</script>" response.end end if if lx=1 then sql="update ly set sh=1 where id in ("&Request("id")&")" conn.execute(sql) elseif lx=2 then sql="update ly set sh=0 where id in ("&Request("id")&")" conn.execute(sql) else sql="delete from ly where id in ("&Request("id")&")" conn.Execute ( sql ) end if conn.close set conn=nothing Response.Write "<script>alert('恭喜!操作成功!');window.location.href='admin_ly.asp';</script>" end if %>