?? product_edit.asp
字號:
<!-- #include file="admin_protect.inc" -->
<!-- #include file="../opendb.inc" -->
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta Name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta Name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; chaRset=gb2312">
<title>配送商資料修改</title>
</head>
<body>
<%
Set Conn=Server.CreateObject("ADODB.Connection")
Conn.Open(sqlOpenDB) '打開數據庫
Set Rs=Server.CreateObject("ADODB.RecordSet")
Rs.Open "Product",Conn,1,3
If Request("Action")="delproduct" Then
killproductname=Request("killproductname")
Conn.Execute "Delete From Product Where Name='"&killproductname&"'"
Response.Redirect "Success.Asp?Success=012"
Rseponse.End
End If
%>
<p align="center"><font color="#0000FF"><b>商品資料修改</b></font></p>
<%
If Request("Action")="Editproduct" Then
Quantity=Request.Form("QuantityPerUnit")
Unit=Request.Form("Unit")
UnitPrice=Request.Form("UnitPrice")
UnitsInStock=Request.Form("UnitsInStock")
UnitsOnOrder=Request.Form("UnitsOnOrder")
Conn.Execute "Update Product Set QuantityPerUnit='"&Quantity&"',Unit='"&Unit&"',UnitsInStock='"&UnitsInStock&"',UnitsOnOrder='"&UnitsOnOrder&"' Where Name='"&Request("EditproductName")&"'"
Response.Redirect "Success.Asp?Success=011"
End If
%>
<%
Sql="Select * From Product Where Name='" & Request("SearchProduct") & "'"
Set Rs=Conn.Execute(Sql)
If Rs.Eof Then
Response.Write"<script language=Javascript>alert('對不起,沒有此商品!');"
Response.Write"javascript:history.go(-1)</script>"
end if
%>
<form method="POST" Name="form1" action="product_edit.asp">
<p align="center"> </p>
<div align="center">
<center>
<table border="1" cellspacing="1" width="50%" id="AutoNumber1" height="260">
<tr>
<td width="18%" height="14">名 稱</td>
<td width="82%" height="14"><%=Rs("Name")%></td>
</tr>
<tr>
<td width="18%" height="22">重 量</td>
<td width="82%" height="22">
<input type="text" Name="quantity" size="20" value="<%=Rs("quantityperunit")%>"></td>
</tr>
<tr>
<td width="18%" height="16">單個數目</td>
<td width="82%" height="16">
<input type="text" Name="unit" size="20" value="<%=Rs("unit")%>"></td>
</tr>
<tr>
<td width="18%" height="16">單 價</td>
<td width="82%" height="16">
<input type="text" Name="unitprice" size="20" value="<%=Rs("unitprice")%>"></td>
</tr>
<tr>
<td width="18%" height="17">庫存數目</td>
<td width="82%" height="17">
<input type="text" Name="unitsinstock" size="20" value="<%=Rs("unitsinstock")%>"></td>
</tr>
<tr>
<td width="18%" height="16">訂貨數目</td>
<td width="82%" height="16">
<input type="text" Name="unitsonorder" size="20" value="<%=Rs("unitsonorder")%>"></td>
</tr>
<tr>
<td width="18%" height="16">圖 片</td>
<td width="82%" height="16">
</td>
</tr>
<tr>
<td width="100%" colspan="2" height="36">
<p align="center">
<input type="submit" Name="Submit" value="修改此商品資料" class="Tips_bo">
<input type="hidden" Name="action" value="Editproduct">
<input type="hidden" Name="EditproductName" value="<%=request("SearchProduct")%>">
</td>
</tr>
</table>
</center>
</div>
</form>
<form Name="delproduct" method="POST" action="product_edit.asp">
<div align="center">
<input type="hidden" Name="action" value="delproduct"><input type="hidden" Name="killproductname" value="<%=request("SearchProduct")%>"><input type="submit" Name="Submit" value="刪除此商品" class="Tips_bo"></div>
</form>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -