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

📄 delhw.asp

📁 自做的购物网站
💻 ASP
字号:
<%
if session("admin_name")="" then response.end
set rs=server.createobject("adodb.recordset")
%>
<!--#include file="conn.asp"-->
<!--#include file="css.asp"-->
<%
keyword=trim(request.form("keyword"))
keyword=replace(keyword,"'","''")
stype=request.form("stype")

%>
<%
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
    response.write "货物删除成功"
    response.write "<br>"
    response.write "<a href=delhw.asp>返回</a>"
else
%>
<TABLE cellSpacing=1 cellPadding=0 width="560" align=center bgColor=#999999 
border=0>
  <TBODY> 
  <TR> 
      <TD width="735" background=images/pics/tile_back.gif id=maintitleback> 
      <TABLE cellSpacing=0 cellPadding=3 width="100%" border=0 height="28">
        <TBODY> 
        <TR> 
          <TD width="3%" height="28"><IMG height=8 src="images/pics/nav_m.gif" width=8 
            border=0></TD>
          <TD width="35%" height="28" valign="bottom" id=maintitle>商品管理 -&gt; 
            <strong>修改商品</strong></TD>
          <TD width="62%" height="28" valign="bottom" id=maintitle> 
            <table width="100%" border="0" cellspacing="0" cellpadding="0" height="28">
              <tr>
                <td valign="bottom"><form name="form1" method="post" action="delhw.asp">
             搜 索: 
        <select name="stype" size="1">
          <option value="hw_name" selected>商品名称</option>
          <option value="chubsh">作者</option>
          <option value="hw_cash">会员价格</option>
          <option value="isbn">ISBN号码</option>
          <option value="hw_date">加入日期</option>
        </select>
    <input size=15 type="text" value="输入关键字" onClick="Javascript:this.value=''" onFocus=this.select() onMouseOver=this.focus() name=keyword maxlength="30">
        <input type="submit" align="absmiddle" width="20" height="20" title="查询" id=Image1 name=Image1 value="搜索">
    </form></td>
              </tr>
            </table>
          </TD>
        </TR>
        </TBODY> 
      </TABLE>
    </TD>
    </TR>
    <TR> 
      <TD id=mainbg> <TABLE cellSpacing=1 cellPadding=4 width="100%" border=0 height="125">
          <TBODY>
            <TR> 
              <TD width="131" height="30" noWrap 
          background=images/pics/tile_sub.gif id=titlemedium><div align="center"><font color="#FFFFFF">商品名称</font></div></TD>
              <TD height="30" noWrap 
          background=images/pics/tile_sub.gif id=titlemedium><div align="center"><font color="#FFFFFF">录入</font></div></TD>
              <TD height="30" noWrap 
          background=images/pics/tile_sub.gif id=titlemedium><div align="center"><font color="#FFFFFF">会员价</font></div></TD>
              <TD height="30" align=middle noWrap 
          background=images/pics/tile_sub.gif id=titlemedium> <div align="center"><font color="#FFFFFF">编号</font></div></TD>
              <TD height="30" align=middle noWrap 
          background=images/pics/tile_sub.gif id=titlemedium><div align="center"><font color="#FFFFFF">加入日期</font></div></TD>
              <TD height="30" colspan="2" align=middle noWrap 
          background=images/pics/tile_sub.gif id=titlemedium><div align="center"><font color="#FFFFFF">操作</font></div></TD>
            </TR>
			        <%
  page=request.querystring("page")
  if page="" then page=1
  if not(isnumeric(page)) then page=1
  if page<1 then page=1
  page=int(page)
  if stype="hw_name" then
	sql="select * from hw where hw_name Like '%"& keyword &"%' order by hw_id desc"
elseif stype="chubsh" then 
	sql="select * from hw where chubsh Like '%"& keyword &"%' order by hw_id desc"
elseif stype="hw_cash" then
	sql="select * from hw where hw_cash Like '%"& keyword &"%' order by hw_id desc"
elseif stype="isbn" then
	sql="select * from hw where isbn Like '%"& keyword &"%' order by hw_id desc"
elseif stype="hw_date" then
	sql="select * from hw where hw_date Like '%"& keyword &"%' order by hw_id desc"
else
  sql="select * from hw order by hw_id DESC"
end if



  rs.open sql,conn,3,3
  if rs.eof then
      response.write "暂且没有货物资料"
      response.end
  else
      rs.pagesize=20
      totalrec=rs.recordcount
      totalpage=rs.pagecount
      if page>totalpage then page=totalpage
      rs.absolutepage=page
      'rs.absolutepage=page
      i=0
      dim hw_id(),hw_name(),hw_cash(),hw_pic(),hw_date(),sort_id(),isbn(),hw_sn(),Nsort_ind()
      do while not rs.eof and (i<rs.pagesize)
      i=i+1
      redim preserve hw_id(i),hw_name(i),hw_cash(i),hw_pic(i),hw_date(i),sort_id(i),isbn(i),hw_sn(i),Nsort_id(i)
      hw_id(i)=rs("hw_id")
      hw_name(i)=rs("hw_name")
      hw_cash(i)=rs("hw_cash")
      hw_pic(i)=rs("hw_pic")
      hw_date(i)=rs("hw_date")
      sort_id(i)=rs("sort_id")
      isbn(i)=rs("isbn")
      hw_sn(i)=rs("hw_sn")
Nsort_id(i)=rs("Nsort_id")
      rs.movenext
      loop
  end if
  rs.close
  %>
        <%for i = 1 to ubound(hw_id)%>
            <TR> 
              <TD bgColor=#ffffff height="30"><div align="center"><%=hw_name(i)%></div></TD>
              <TD width=76 height="30" align=middle bgColor=#ffffff><div align="center"><%=hw_sn(i)%></div></TD>
              <TD width=102 height="30" align=middle bgColor=#ffffff><div align="center"><%=hw_cash(i)%></div></TD>
              <TD width=105 height="30" align=middle bgColor=#ffffff><div align="center"><%=isbn(i)%></div></TD>
              <TD width=105 height="30" bgColor=#ffffff><div align="center"><%=hw_date(i)%></div></TD>
              <TD width=57 height="30" align=middle bgColor=#ffffff><div align="center"><a href="delhw.asp?hw_id=<%=hw_id(i)%>&action=del"><img src="images/pics/delete.gif" width="45" height="20" border="0"></a></div></TD>
              <TD width=58 align=middle bgColor=#ffffff><div align="center"><a href="changehw.asp?hw_id=<%=hw_id(i)%>&sort_id=<%=sort_id(i)%>&Nsort_id=<%=Nsort_id(i)%>"><img src="images/pics/mod.gif" width="45" height="20" border="0"></a></div></TD>
            </TR>
			<%next%>
            <TR> 
              <TD height="30" colspan="7" bgColor=#ffffff><div align="center"><img src="../IMAGES/pics/seperator.gif" width="359" height="1"></div></TD>
            </TR>
            <TR> 
              <TD id=mainfoot 
colSpan=7 height="30"> <div align="center">共<font color=red><%=totalpage%></font>页 
                  第<%=page%>页 <font color=666666> 
                  <%if page-1>0 then%>
                  <a href="delhw.asp?page=<%=page-1%>">上一页</a> 
                  <%else%>
                  <font color=666666>上一页</font> 
                  <%end if%>
                    
                  <%if page+1<=totalpage then%>
                  <a href="delhw.asp?page=<%=page+1%>">下一页</a> 
                  <%else%>
                  <font color=666666>下一页</font> 
                  <%end if%>
                  </font></div></TD>
            </TR>
          </TBODY>
        </TABLE>
		<%end if
set rs=nothing
conn.close
set conn=nothing
%>
		</TD>
    </TR>
  </TBODY>
</TABLE>

⌨️ 快捷键说明

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