📄 admindeliver.asp
字号:
<%dim nowplace
nowplace="article"
dim dbpath
dbpath="../"
%>
<!--#include file="chk.asp"-->
<!--#include file="../db_conn.asp" -->
<!--#include file="../comm/my_request.asp" -->
<%
action=my_request("action",0)
select case action
case "wadd"
call wadd()
case "modifyz"
call modifyz()
case "del"
call del()
case ""
case else
response.write "操作错误"
end select
%>
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>送货管理</title>
<link href=AdminStyle.css rel=stylesheet type=text/css>
<SCRIPT language="javascript">
<!--
function checksubmit()
{
if (document.form2.deliver_name.value == "")
{
window.alert("请输入送货方式!");
document.form2.deliver_name.focus();
return (false);}
if (document.form2.price.value == "")
{
window.alert("请输入送货费用!");
document.form2.price.focus();
return (false);}
document.form2.B1.disabled=true
document.form2.B1.value="正在保存数据……"
}
//--></SCRIPT>
</head>
<body>
<div align="center">
<table border="0" width="100%" id="table1" cellspacing="0" style="border-collapse: collapse" cellpadding="0">
<tr>
<td bgcolor="#DAE3F5" height="25">
<b>送货设置</b></td>
</tr>
<tr>
<td bgcolor="#FFFFFF" height=5></td>
</tr>
</table>
<table border="0" width="100%" style="border:1px solid #183789; padding-left:4px; padding-right:4px; padding-top:1px; padding-bottom:1px" bordercolor="#D4D0C8" cellspacing="1" cellpadding="4">
<tr>
<td bgcolor="#DDDDDD" height="25" background="Image/admin_bg_1.gif">
<font style="font-size: 14px" color="#FFFFFF"><b>ID</b></font></td>
<td bgcolor="#DDDDDD" height="25" background="Image/admin_bg_1.gif">
<font style="font-size: 14px" color="#FFFFFF"><b>送货方式</b></font></td>
<td bgcolor="#DDDDDD" height="25" background="Image/admin_bg_1.gif">
<font color="#FFFFFF">
<span style="font-size: 14px"><b>属性</b></span></font></td>
<td bgcolor="#DDDDDD" height="25" background="Image/admin_bg_1.gif">
<font style="font-size: 14px" color="#FFFFFF"><b>费用</b></font></td>
<td bgcolor="#DDDDDD" height="25" background="Image/admin_bg_1.gif">
<font style="font-size: 14px" color="#FFFFFF"><b>添加时间</b></font></td>
<td colspan="2" bgcolor="#DDDDDD" height="25" background="Image/admin_bg_1.gif">
<font style="font-size: 14px" color="#FFFFFF">
<b>操作</b></font></td>
</tr>
<%
sql="select * from deliver order by flagp"
set rs=server.CreateObject ("adodb.recordset")
rs.open sql,conn,1,1
if rs.eof then
response.write "<td width=726 colspan=6>暂时还没有任何数据,请添加</td>"
else
i=1
do while not rs.eof
set id=rs("id")
set deliver_name=rs("deliver_name")
set price=rs("price")
set addtime=rs("addtime")
set flagp=rs("flagp")
%>
<form action="Admindeliver.asp">
<tr>
<td width="74"><%=i%></td>
<td width="249">
<input type="text" name="deliver_name" size="35" maxlength="50" value="<%=deliver_name%>"></td>
<td width="178">
<select size="1" name="flagp">
<option value="1" <%if flagp=1 then response.write "selected"%>>平邮</option>
<option value="2" <%if flagp=2 then response.write "selected"%>>快递</option>
<option value="3" <%if flagp=3 then response.write "selected"%>>虚拟品(无运费)</option>
</select></td>
<td width="104">
<input type="text" name="price" size="7" maxlength="10" value="<%=FormatNumber(price,2,-1)%>">元
<input type="hidden" name="id" value="<%=id%>">
<input type="hidden" name="action" value="modifyz"></td>
<td width="157"><%=addtime%></td>
<td width="83"><input type="submit" value="修改保存" name="B4"></td>
<td width="82"><%response.write "<a href=""Admindeliver.asp?id="&id&"&action=del"">删除</a>"%></td>
</tr>
</form>
<%
rs.movenext
i=i+1
loop
end if
rs.close
set rs=nothing
%>
<form action="Admindeliver.asp?action=wadd" method=post name=form2 onsubmit="return checksubmit();">
<tr>
<td colspan="7">添加送货方式:<input type="text" name="deliver_name" size="20" maxlength="50">
属性:<select size="1" name="flagp">
<option value="1">平邮</option>
<option value="2">快递</option>
<option value="3">虚拟品(无运费)</option>
</select> 费用:<input type="text" name="price" size="7" maxlength="10">元
<input type="submit" value="保存数据" name="B1"></td>
</tr>
</form>
</table>
</div>
</body>
</html>
<%
sub wadd()
deliver_name=my_request("deliver_name",0)
price=my_request("price",1)
flagp=my_request("flagp",1)
if deliver_name="" or price="" then
response.write"<SCRIPT language=JavaScript>alert('信息未填写完整');"
response.write"javascript:history.go(-1)</SCRIPT>"
response.end
end if
sql="insert into deliver (deliver_name,price,addtime,flagp) values('"&deliver_name&"',"&price&",'"&now()&"',"&flagp&")"
conn.execute(sql)
response.redirect "Admindeliver.asp"
end sub
sub modifyz()
id=my_request("id",1)
deliver_name=my_request("deliver_name",0)
price=my_request("price",1)
flagp=my_request("flagp",1)
if deliver_name="" or price="" or id="" then
response.write"<SCRIPT language=JavaScript>alert('信息未填写完整或操作错误');"
response.write"javascript:history.go(-1)</SCRIPT>"
response.end
end if
sql="update deliver set deliver_name='"&deliver_name&"',price="&price&",flagp="&flagp&" where id="&id
conn.execute(sql)
response.redirect "Admindeliver.asp"
end sub
sub del()
id=my_request("id",1)
sql = "delete from deliver where id="&id
conn.execute(sql)
response.redirect "Admindeliver.asp"
end sub
'conn.close
'set conn=nothing
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -