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

📄 delhw.asp

📁 自己开发的一个网站数据库系统,希望和大家一块交流学习
💻 ASP
字号:
<%
if session("admin_name")="" then response.redirect "login.asp"
set rs=server.createobject("adodb.recordset")
%>
<!--#include file="conn.asp"-->
<%
if request("action")="del" then
    sql="select * from hw where hw_id="&request("hw_id")
    rs.open sql,conn,3,3
    if rs.eof then
        response.redirect "delhw.asp"
    else
    rs.delete
    rs.update
    end if
    rs.close
end if%>
<%
if request("action")="pass" then
sql="select * from hw where hw_id="&request("hw_id")
rs.open sql,conn,3,3
if rs.eof then
    response.write "没有这个商品的信息,请确认通过了申请"
    response.end
else
    rs("admintuijian")=true
    rs.update
    response.write "<center>"
    response.write "<font color=red>已经成功在首页推荐!</font>"
end if
rs.close
end if
%>
<%
if request("action")="quit" then
sql="select * from hw where hw_id="&request("hw_id")
rs.open sql,conn,3,3
if rs.eof then
    response.write "没有这个商品的信息,请确认通过了申请"
    response.end
else
    rs("admintuijian")=false
    rs.update
    response.write "<center>"
    response.write "<font color=red>已经成功撤消在首页推荐!</font>"
end if
rs.close
end if
%>
<%

dim page,maxPerPage
maxPerPage=10 '每页显示的记录数
myKeyword=Request("myKeyword")
'response.write strSort
'response.End
page=Request("page")
if (page="" or isempty(page)) then page=1
thisUrl="delhw.asp?productSort="&productSort&"&myKeyword="&myKeyword
session("adminOldUrl")=thisUrl&"&page="&page
set rs=server.createobject("adodb.recordset")
sql="select * from hw where  1=1"
if not (myKeyword="" or isempty(myKeyword) ) then
	sql=sql&" and hw_name like '%"&myKeyword&"%'"
end if
sql=sql&" order by hw_id desc"
'response.write sql
'response.End
rs.open sql,conn,1,1
rs.pagesize=MaxPerPage
%>
<html>
<head>
<title>后台管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="css.css" type="text/css">
<script language="JavaScript">
<!--
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function jumpTo(i){
if(i==1){
	this.document.location="<%=thisUrl%>";}
if(i==2){
	this.document.location="<%=thisUrl%>&page=<%=page-1%>";}
if(i==3){
	this.document.location="<%=thisUrl%>&page=<%=page+1%>";}
if(i==4){
	this.document.location="<%=thisUrl%>&page=<%=rs.pageCount%>";}
}

function recommend(i){
	if (confirm("确定 推荐/取消推荐 该商品("+i+"号商品)?")==1){
		window.location="recommend.asp?id="+i;
	}
}
// -->
</script>
<script language=Javascript src="../include/opennew.js"></script>
</head>

<body bgcolor="#9CC7EF" text="#000000" leftmargin="0" topmargin="4">
<div align="center">商品管理 </div>
<table width="98%" border="1" bordercolordark=#9CC7EF bordercolorlight=#145AA0 cellspacing="0" cellpadding="4" align="center">
  <tr> 
      <form method="post" action="delhw.asp" name="form1">
    <td colspan="8" bgcolor="#4296E7"> 
        <div align="right"> 
          <input type="text" name="myKeyword" size="16">
        <input type="submit" name="Submit" value="搜索">
      </div>
    </td>
		</form>
  </tr>
  <tr bgcolor="#5EA5E6"> 
    <td width="6%" nowrap> 
      <div align="center"><font color="#FFFFFF">编号</font></div>
    </td>
    <td width="26%" nowrap> 
      <div align="center"><font color="#FFFFFF">商品名称</font></div>
    </td>
    <td width="9%" nowrap> 
      <div align="center"><font color="#FFFFFF">现价(¥)</font></div>
    </td>
    <td width="9%" nowrap> 
      <div align="center"><font color="#FFFFFF">原价(¥)</font></div>
    </td>
    <td width="13%" nowrap> 
      <div align="center"><font color="#FFFFFF">加入日期</font></div>
    </td>
    <td width="22%" nowrap> 
      <div align="center"><font color="#FFFFFF">状态</font></div>
    </td>
	<td width="15%" nowrap bgcolor="#5EA5E6"> 
      <div align="center"><font color="#FFFFFF">管理</font></div>
    </td>
  </tr>
<%
		dim rsID
		i=1
		if not (rs.eof or err) then rs.move (page-1)*maxPerPage
		do while not (rs.eof or err) 
		rsID=rs("hw_id")
                admintuijian=rs("admintuijian")
                tejia=rs("tejia")
%>
        <tr> 
    <td width="6%"><%=rsID%>&nbsp;</td>
    <td width="26%" style="cursor:hand" title="点击查看具体信息" onClick="Javascript:window.location='editgoods.asp?hw_id=<%=rsID%>'" bgcolor="#63B2FF"><%=rs("hw_name")%>&nbsp;</td>
    <td width="9%"><%=rs("hw_cash")%>&nbsp;</td>
    <td width="9%"><%=rs("hw_oldcash")%>&nbsp;</td>
    <td width="13%"><%=rs("hw_date")%></td>
    <td width="22%"><%
 if admintuijian=true then 
response.write "<font color=red>推荐</font>&nbsp;&nbsp;"
end if
 if tejia=true then 
response.write "<font color=blue>特价</font>&nbsp;&nbsp;"
end if
 if tejia=false and admintuijian=false then 
response.write "普通"
end if%></td>
	<td width="15%"> 
      <div align="center"> 
        <a href="delhw.asp?hw_id=<%=rsID%>&action=del">删除</a>&nbsp;&nbsp;
<%if admintuijian=0 then%>
<a href="delhw.asp?hw_id=<%=rsID%>&action=pass">推荐</A>
<%else%>
<a href="delhw.asp?hw_id=<%=rsID%>&action=quit"><font color=red>撤消</font></A>
<%end if%>
    </div>
		
    </td>
  </tr>
        <%
		i=i+1
		if i>maxPerPage then exit do
		rs.moveNext
		loop
%>
  <tr bgcolor="#4296E7"> 
    <td colspan="8"> 
            <div align="right"><font color=#FFFFFF><%=rs.recordCount%> 项 第<%=page%>/<%=rs.pageCount%> 
              页 </font> 
              <%if page>1 then%>
              <input type="button" name="Submit3" value="首页" onClick="Javascript:jumpTo(1)">
              <input type="submit" name="Submit4" value="上页" onClick="Javascript:jumpTo(2)">
<%else%>
              <input type="button" name="Submit3" value="首页" disabled>
              <input type="submit" name="Submit4" value="上页" disabled>
<%end if
if rs.recordCount>page*maxPerPage then%>
              <input type="submit" name="Submit5" value="下页" onClick="Javascript:jumpTo(3)">
              <input type="submit" name="Submit6" value="末页" onClick="Javascript:jumpTo(4)">
<%else%>
              <input type="submit" name="Submit5" value="下页" disabled>
              <input type="submit" name="Submit6" value="末页" disabled>
<%end if%>
            </div>
    </td>
  </tr>
</table>
</body>
</html>

⌨️ 快捷键说明

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