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

📄 admin_hw.asp

📁 是一个电子商务网站系统,提供前后台交易源码.
💻 ASP
字号:
<!--#include file="inc/Conn.asp" -->
<!--#include file="Admin_IsLogin.asp" --><%

if request("action")="sh" then 
conn.execute("Update hw set sh=1  where id = ("&request("id")&")")
Response.write("<script>alert(""信息审核成功!"");location.href=""Admin_hw.asp"";</script>")
Response.end
end if
if request("action")="sh1" then 
conn.execute("Update hw set sh=0  where id = ("&request("id")&")")
Response.write("<script>alert(""信息已被锁定!"");location.href=""Admin_hw.asp"";</script>")
Response.end
end if
if request("action")="tj" then 
conn.execute("Update hw set tj=1  where id = ("&request("id")&")")
Response.write("<script>alert(""信息推荐成功!"");location.href=""Admin_hw.asp"";</script>")
Response.end
end if
if request("action")="tj1" then 
conn.execute("Update hw set tj=0  where id = ("&request("id")&")")
Response.write("<script>alert(""信息已被取消推荐!"");location.href=""Admin_hw.asp"";</script>")
Response.end
end if
if request("action")="alldel" then 
rcID=trim(request("rcID"))
	if instr(rcID,",")>0 then
		dim idarr,i
		idArr=split(rcID)
		for i = 0 to ubound(idArr)
			call DelArticle(clng(idarr(i)))
		next
	else
		call DelArticle(clng(rcID))
	end if
	
sub DelArticle(ID)
sqlDel="select * from hw where id=" & CLng(ID)
Set rsDel= Server.CreateObject("ADODB.Recordset")
rsDel.open sqlDel,conn,1,3
		rsDel.delete
		rsDel.update
		set rsDel=nothing
end sub
Response.Write "信息删除成功..."
Response.write("<script>alert(""信息删除成功!"");location.href=""Admin_hw.asp"";</script>")
Response.end
end if
%>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="Images/Style.css" rel="stylesheet" type="text/css">
<SCRIPT language=javascript>
function unselectall()
{
    if(document.del.chkAll.checked){
	document.del.chkAll.checked = document.del.chkAll.checked&0;
    } 	
}

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;
    }
  }
function ConfirmDel()
{
   if(confirm("确定要删除选中的信息吗?一旦删除将不能恢复!"))
     return true;
   else
     return false;	 
}
</SCRIPT>
</head>
<BODY bgcolor="D6DFF7" leftMargin=0 topMargin=0 marginwidth="0" marginheight="0">
<table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td>  </td>
  </tr>
</table>
<table border="0" width="96%" cellspacing="0" cellpadding="0" align="center">
	    <tr>
		  <td width="50%" height="13">·货物信息管理</td>
		  <form method="post" action="?" name="Form1">
		  <td width="50%" height="13" align="right">信息搜索:<input type="text" name="KeyWord" size="20" value="<% = Request("KeyWord")%>" class="face"> <input type="submit" name="Submit" value="搜" class="button"></td>
		  </form>
		</tr>
	    </table>
<div align="center">
<table class=tableBorder width="98%" border=0 cellpadding=5 cellspacing=1>
  <tbody>
    <tr> 
      <th height=21 sytle="line-height:150%" width="33">选择</th>
      <th height=21 width="383">标题</th>
      <th height=21 width="215">货物名</th>
      <th height=21 width="44">状态</th>
      <th height=21 width="55">推荐</th>
      <th height=21 width="118">添加时间</th>
      <th height=21 width="33">修改</th>
    </tr><%
Dim rdsInfo    '/通告的数据库对象及SQL语句/
Dim sqlInfo
Dim rdsTotalRec   
Dim strKeyWord    '/关键字/
Dim intPage       '/当前页/
Dim intTotalRec	  '/所有记录/
Dim intInfoCot	  '/通告条数/
Dim intInfoCount
Dim n,p,ii	      '/定义一些临时变量/
Dim strState

strKeyWord = Request("KeyWord")
sh=Request("sh")
intPage = Trim(Request("Page"))
if intPage = "" then
	intPage = 1
else
	intPage = Clng(intPage)
end if
intInfoCot =20
strsql=""
if sh<>"" then
sh=cint(sh)
strsql=strsql&"and sh="&sh&""
end if
if strKeyWord <> "" then
strsql=strsql&" and (title like '%"&strKeyWord&"%' or hwname like '%"&strKeyWord&"%' or bz like '%"&strKeyWord&"%')"
end if
set rdsInfo = Server.CreateObject("ADODB.Recordset")
	set rdsTotalRec = Conn.Execute("Select Count(id) from hw Where title<>'' "&strsql&"")
	intTotalRec = rdsTotalRec(0)
	sqlInfo = "Select * from hw Where title<>'' "&strsql&" Order By id Desc"
rdsInfo.Open sqlInfo,Conn,1,1
if not rdsInfo.EOF then
	if intTotalRec mod intInfoCot = 0 then
		n = intTotalRec \ intInfoCot
	else
		n = intTotalRec \ intInfoCot + 1
	end if
	rdsInfo.MoveFirst
	if intPage > n then intPage = n
	if intPage < 1 then intPage = 1
	rdsInfo.Move (intPage - 1) * intInfoCot
	do while not rdsInfo.EOF and intInfoCount < Clng(intInfoCot)
		intInfoCount = intInfoCount + 1
		%>			  	  
<form name="del" method="Post" action="?action=alldel" onsubmit="return ConfirmDel();">
<tr> 
      <td class=forumRow height=21 sytle="line-height:150%">
		<p align="center"><input name='rcID' type='checkbox' onclick="unselectall()" id="rcID" value='<% = rdsInfo("id")%>'></td>
      <td class=forumRow height=21 sytle="line-height:150%" align="center"><a href="../showhw.asp?id=<% = rdsInfo("id")%>"><% = rdsInfo("title")%></a></td>
      <td class=forumRow height=21 sytle="line-height:150%" align="center"><% = rdsInfo("hwname")%></td>
      <td class=forumRow height=21 sytle="line-height:150%" align="center"><% if rdsInfo("sh")<>"1" then%>
          <a href='Admin_hw.asp?action=sh&id=<% = rdsInfo("id")%>' onclick="{if(confirm('确定审核此信息吗?')){return true;}return false;}"><font color="#428EFF">锁定</font></a>
          <%else%>
         <a href='Admin_hw.asp?action=sh1&id=<% = rdsInfo("id")%>' onclick="{if(confirm('确定取消审核吗?')){return true;}return false;}"><font color="#ff0000">开通</font></a>
          <%end if%></td>
      <td class=forumRow height=21 sytle="line-height:150%" align="center"><% if rdsInfo("tj")<>"1" then%>
          <a href='Admin_hw.asp?action=tj&id=<% = rdsInfo("id")%>' onclick="{if(confirm('确定把此信息设为推荐吗?')){return true;}return false;}"><font color="#428EFF">否</font></a>
          <%else%>
         <a href='Admin_hw.asp?action=tj1&id=<% = rdsInfo("id")%>' onclick="{if(confirm('确定取消对此信息的推荐吗?')){return true;}return false;}"><font color="#ff0000">是</font></a>
          <%end if%></td>
      <td class=forumRow height=21 sytle="line-height:150%" align="center"><% = rdsInfo("time")%></td>
      <td class=forumRow height=21 sytle="line-height:150%" align="center">
		<a href="mod_hw.asp?id=<% = rdsInfo("id")%>">修改</a></td></tr><%
		rdsInfo.MoveNext
	loop
else
	Response.Write "<tr><td colspan=""7"" class=""forumRow"">&nbsp;<font color=""#FF0000"">没有符合条件的信息...</font></td></tr>"
end if
rdsInfo.Close
set rdsInfo = nothing

if intPage - 1 mod 10 = 0 then
	p = (intPage - 1) \ 10
else
	p = (intPage - 1) \ 10
end if	
%>
      <tr> 
      <td class=forumRow colspan="7"><input name="chkAll" type="checkbox" id="chkAll" onclick=CheckAll(this.form) value="checkbox">
              选中本页显示的所有记录<input name="submit" type='submit' value='删除选定的信息'></td>
    </tr>
      <tr> 
      <td class=forumRow colspan="7"><table border="0" width="96%" cellspacing="0" cellpadding="0" align="center">
	    <form method="post" action="InfoEaa.asp" name="Form2">
	    <input type="hidden" name="KeyWord" value="<% = strKeyWord%>">
	    <input type="hidden" name="strfcclass" value="<% = strfcclass%>">
	    <input type="hidden" name="sh" value="<% =sh%>">
	    <input type="hidden" name="class" value="<% =strclass%>">
	    <tr>
		  <td width="30%" height="30" valign="middle">页次:<b><%= intPage %></b>/<b><%= n %></b>页 每页<b><%= intInfoCot %></b>条 共<b><%= intTotalRec %></b>条</td>
		  <td width="70%" height="30" valign="middle"><div align="right">分页:
			<%
				if intPage = 1 then
					Response.Write "<font face=webdings>9</font>   "
				else
					Response.Write "<a href='?Page=1&KeyWord="& strKeyWord &"&strfcclass="& strfcclass &"&sh="&sh&"&class="&strclass&"' title=首页><font face=webdings>9</font></a>   "
				end if
				if p * 10 > 0 then Response.Write "<a href='?Page="&Cstr(p*10)&"&sh="&sh&"&class="&strclass&"&KeyWord="& strKeyWord &"&strfcclass="& strfcclass &"' title=上十页><font face=webdings>7</font></a>   "
				Response.Write "<b>"
				for ii = p * 10 + 1 to P * 10 + 10
					   if ii = intPage then
				          Response.Write "<font color=""#FF0000"">"+Cstr(ii)+"</font> "
					   else
					      Response.Write "<a href='?Page="&Cstr(ii)&"&sh="&sh&"&class="&strclass&"&KeyWord="& strKeyWord &"&strfcclass="& strfcclass &"'>"+Cstr(ii)+"</a>   "
					   end if
					if ii = n then exit for
				next
				Response.Write "</b>"
				if ii < n then Response.Write "<a href='?Page="&Cstr(ii)&"&sh="&sh&"&class="&strclass&"&KeyWord="& strKeyWord &"&strfcclass="& strfcclass &"' title=下十页><font face=webdings>8</font></a>   "
				if intPage=n then
					Response.Write "<font face=webdings>:</font>   "
				else
					Response.Write "<a href='?Page="&Cstr(n)&"&sh="&sh&"&class="&strclass&"&KeyWord="& strKeyWord &"&strfcclass="& strfcclass &"' title=尾页><font face=webdings>:</font></a>   "
				end if
			%>
			</div></td>
		</tr>
		</form>
	  </table>
</td>
    </tr>
  </tbody>
</table>
	</div>
<br>
<br>
<!--#include file="end.asp"-->
</body>
</html>

⌨️ 快捷键说明

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