?? delhw.asp
字號:
<%
if session("admin_name")="" then response.end
set rs=server.createobject("adodb.recordset")
%>
<!--#include file="../inc/adconn.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
%>
<%
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="kaiben" then
sql="select * from hw where kaiben 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(),chubsh(),kaiben()
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),chubsh(i),kaiben(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")
chubsh(i)=rs("chubsh")
kaiben(i)=rs("kaiben")
rs.movenext
loop
end if
rs.close
%>
<TABLE cellSpacing=1 cellPadding=0 width="560" align=center bgColor=#999999
border=0>
<TBODY>
<TR>
<TD width="735" bgcolor="f0f0f0" id=maintitleback>
<TABLE cellSpacing=0 cellPadding=3 width="100%" border=0 height="28">
<TBODY>
<TR>
<TD width="3%" height="28" valign="bottom"><IMG height=8 src="../images/pics/nav_m.gif" width=8
border=0></TD>
<TD width="35%" height="28" valign="bottom" id=maintitle>產品管理 ->
<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="kaiben">成份</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="image" align="absmiddle" border="0" src="../images/pics/search.gif">
</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" 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>
<%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"><%=chubsh(i)%></div></TD>
<TD width=102 height="30" align=middle bgColor=#ffffff><div align="center"><%=kaiben(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="80" align="center" bgcolor="#ffffff"><a href="../../product/views.asp?hw_id=<%=hw_id(i)%>" target=_blank><img alt="包含圖片" border="0" src="../images/prew.gif"></a></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="8" bgColor=#ffffff><div align="center"><img src="../../images/pics/seperator.gif" width="359" height="1"></div></TD>
</TR>
<TR>
<TD id=mainfoot
colSpan=8 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 + -