⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 admin_wish_list.asp

📁 于毕业设计与论文以及做课题用-MSK Simulink simulation program for the design and graduation thesis topic, and makin
💻 ASP
字号:
<!--#include file="../Conn.asp"-->
<!--#include file="Admin_Session.asp"-->
<%
Dim Action
Action=Trim(Request("Action"))
HX33_WishID=Trim(Request("HX33_WishID"))
IF Action="DelWish" Then
 	Conn.Execute("Delete From HX33_LoveWallPosts Where HX33_WishID In ("&HX33_WishID&")")
	 Response.Write "<script language='javascript'>alert('删除成功!');location='Admin_Wish_List.asp';</script>"
  Response.End() 
End If
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="css/style.css" rel="stylesheet" type="text/css">

</head>
<body>
<div align="center">
  <table cellpadding="3" cellspacing="1" border="0" width="100%" class="tableBorder" align=center>
    <tr>
      <th height=50 colspan="6" class="tableHeaderText">许愿列表</th>
    </tr>
	<form action="" method="post" name="myform">
      <tr>
        <td height="22" colspan="7" align="center"  class="forumRowHighlight">
		<select name="type" id="type">
		<option value="1">内容</option>
		</select>
		请输入关键字:
          <input name="KeyWord" type="text" id="KeyWord" size="30">
          &nbsp;&nbsp;
		  <input type="submit" name="Submit" value="搜索">	    </td>
      </tr>
	  </form>
    <form action="" name="form1" method="post">
      <tr>
        <td width="8%" align="center"  class="forumRowHighlight"> 选择</td>
        <td width="45%" align="center"  class="forumRowHighlight">许愿内容</td>
        <td width="10%" align="center"  class="forumRowHighlight">许愿人</td>
		<td width="10%" align="center"  class="forumRowHighlight">祝福对象</td>
        <td width="12%" align="center"  class="forumRowHighlight">发布时间</td>
        <td width="15%" align="center"  class="forumRowHighlight">操作</td>
      </tr>
      <%
	Set Rs= Server.CreateObject("ADodb.recordset")
	sqlstr="Select * From HX33_LoveWallPosts "
	type1=Cint(request.form("type"))
	KeyWord=request.form("KeyWord")
	if type1 =1 then
	Sqlstr=Sqlstr&" where HX33_WishContent like '%"&KeyWord&"%'"
	end if
	Sqlstr=Sqlstr&" Order by HX33_WishID DESC"
	'Response.Write Sqlstr
	
	Rs.Open Sqlstr ,conn,1,1
	IF Not Rs.Eof Then
	maxperpage=20
	dim currentpage '定义当前页的变量
	rs.pagesize=maxperpage
	currentpage=request("page")
	if currentpage="" or not Isnumeric(currentpage) then
	currentpage=1
	elseif currentpage<1 then
	currentpage=1
	else
	currentpage=clng(currentpage)
	if currentpage > rs.pagecount then
	currentpage=rs.pagecount
	end if
	end if
	'如果变量currentpage的数据类型不是数值型
	'就1赋给变量currentpage
	if not isnumeric(currentpage) then
	currentpage=1
	end if
	dim totalput,n '定义变量
	totalput=rs.recordcount
	if totalput mod maxperpage=0 then
	n=totalput\maxperpage
	else
	n=totalput\maxperpage+1
	end if
	if n=0 then
	n=1
	end if
	rs.move(currentpage-1)*maxperpage
	i=0
%>
      <% 
do while i< maxperpage and not rs.eof'
%>
      <tr>
        <td align="center"  class="forumRowHighlight"><input name="HX33_WishID" type="checkbox" id="HX33_WishID" value="<%=Rs("HX33_WishID")%>"></td>
        <td  class="forumRowHighlight"><a href="../default.asp?HX33_WishID=<%=Rs(0)%>" target="_blank"><%=Rs("HX33_WishContent")%></a></td>
        <td align="center"  class="forumRowHighlight"><%=Rs("HX33_Sender")%></td>
		<td align="center"  class="forumRowHighlight"><%=Rs("HX33_Picker")%></td>
        <td align="center"  class="forumRowHighlight"><%=Year(Rs("HX33_WishDate"))%>-<%=Month(Rs("HX33_WishDate"))%>-<%=Day(Rs("HX33_WishDate"))%></td>
        <td align="center"  class="forumRowHighlight"><a href="Admin_Wish_Edit.asp?HX33_WishID=<%=Rs("HX33_WishID")%>">修改</a>&nbsp;&nbsp;</td>
      </tr>
      <%
	i=i+1
	rs.movenext
	loop
	Else
	%>
      <tr>
        <td align="center"  class="forumRowHighlight">&nbsp; </td>
        <td colspan="4" align="center"  class="forumRowHighlight">没有任何许愿!</td>
        <td align="center"  class="forumRowHighlight">&nbsp;</td>
      </tr>
      <%End IF%>
      <tr>
        <td align="center"  class="forumRowHighlight">&nbsp; </td>
        <td colspan="4" align="center"  class="forumRowHighlight"><input name="chkAll" type="checkbox" id="chkAll2" onClick="CheckAll(form1)" value="checkbox">
        全选&nbsp;
        <input name="DelWish" type="button" class="button" id="DelWish" onClick="return SubmitForm();" value="删除许愿"></td>
        <td align="center"  class="forumRowHighlight">&nbsp;</td>
      </tr>
    </form>
	  <tr>
        <td colspan="6" align="center"  class="forumRowHighlight"> 
		页数:<font color="red"><%=currentpage%></font>/
		<% =n%>
   	    <% k=currentpage                    
   	if k<>1 then%>
   	[<a class="link" href="Admin_Wish_List.asp?keyword=<%=keyword%>&page=1">首页</a>]                    
   	[<a class="link" href="Admin_Wish_List.asp?keyword=<%=keyword%>&page=<%=k-1%>">上一页</a>]                    
   	<%else%>
   	[首页]&nbsp;[上一页]
    <%end if%>
   	<%if k<>n then%>                    
   	[<a class="link" href="Admin_Wish_List.asp?keyword=<%=keyword%>&page=<%=k+1%>">下一页</a>]                    
   	[<a class="link" href="Admin_Wish_List.asp?keyword=<%=keyword%>&page=<%=n%>">尾页</a>]                    
   	<%else%>
   	[下一页]&nbsp;[尾页]
    <%end if%>
        共有<font color="red"><%=totalput%></font>条记录 <font color="red"><%=maxperpage%></font>个/页
		共有<font color="red"><%=n%></font>页		</td>
      </tr>
  </table>
</div>
</body>
</html>
<%
Rs.CLose
Set Rs=Nothing
Call ConnClose()
%>
<script language="javascript">
function count_checked_items() 
	{
		var number_checked=0;
		var box_count=document.form1.HX33_WishID.length;
		if ( box_count==null ) 
		{
		if ( document.form1.HX33_WishID.checked==true )
		 {
		number_checked=1;}
		else {
		number_checked=0;}
		}
		else {
		for ( var i=0; i < (box_count); i++ ) {
		if ( document.form1.HX33_WishID[i].checked==true ) {
		number_checked++;}}}
		return number_checked;
	}
  
	  function SubmitForm() {
      if (count_checked_items()>0){           
          if(confirm("您真的要删除所选的许愿吗?")){           
          document.form1.action="Admin_Wish_List.asp?Action=DelWish";
          document.form1.submit();
          }
      }
      else
          alert('请您先选择要删除的许愿!');
          return false;       
      }
function CheckAll(form)
{
for (var i=0;i<form.elements.length;i++)
{
var e = form.elements[i];
if (e.Name != "chkAll"&&e.disabled==false)
e.checked = form.chkAll.checked;
}
}
</script>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -