📄 sell_modi.asp
字号:
<%
if session("yida_username")="" then
%>
<script language="javascript">
top.location.href="../index.asp"
</script>
<%
response.end
end if
%>
<!-- #include file="../conn2.asp" -->
<!-- #include file="../const.asp" -->
<html>
<head>
<title><%=dianming%> - 产品销售</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../style/style.css" rel="stylesheet" type="text/css">
<style>
body {
background-color:#FFFFFF;
}
</style>
</HEAD>
<BODY>
<%
if fla17="0" and session("shiwei_id")<>"1" then
%>
<br><center><img src="../images/note.gif" align="absmiddle"> <font color="#FF0000">你不具备此权限,请与管理员联系!</font></center>
<%
response.end
end if
%>
<%
if request("hid1")="ok" then
set rs_id=conn.execute("select * from sell where id="&request("id"))
nowselldate=request("selldate")
nowbeizhu=request("beizhu")
nowid_login=request("id_login")
set rs_login=conn.execute("select * from login where id="&nowid_login)
nowhuiyuan=request("huiyuan")
if nowhuiyuan="" then
nowhuiyuan=0
end if
nowbianhao=rs_id("bianhao")
totalshulian=0
totalprice=0
totalprice2=0
for x=1 to maxproduit
nowku=request("ku"&x)
set rs_ku=conn.execute("select * from ku where id="&nowku)
nowhuohao=request("huohao"&x)
nowshulian=request("shulian"&x)
nowprice=request("price"&x)
if nowprice="" then
nowprice=0
end if
if nowhuohao<>"单击选择产品" and nowshulian<>"" then
set rs_produit=conn.execute("select * from produit where huohao='"&nowhuohao&"'")
set rs=server.createobject("ADODB.RecordSet")
sql="select * from produit where huohao='"&nowhuohao&"' and id_ku="&nowku
rs.open sql,conn,1,3
if rs.eof then
%>
<script language="javascript">
alert("<%=rs_ku("ku")%> 中没有产品 <%=rs_produit("title")%>!")
window.history.go(-1)
</script>
<%
response.end
exit for
elseif rs("shulian")-nowshulian<0 then
%>
<script language="javascript">
alert("<%=rs_ku("ku")%> 中 <%=rs_produit("title")%> 库存不足!")
window.history.go(-1)
</script>
<%
response.end
exit for
end if
end if
next
'-------------------------
set rs_huiyuan=conn.execute("select * from sell where bianhao='"&rs_id("bianhao")&"' and zu")
set rs=conn.execute("select * from sell where bianhao='"&rs_id("bianhao")&"' and zu=false")
totalprice=0
do while rs.eof=false
conn.execute("update produit set shulian=shulian+"&rs("shulian")&" where huohao='"&rs("huohao")&"' and id_ku="&rs("id_ku"))
totalprice=totalprice+rs("price")*rs("shulian")
rs.movenext
loop
conn.execute("update huiyuan set jifen=jifen-"&totalprice&" where id="&rs_huiyuan("id_huiyuan"))
sql="delete from sell where bianhao='"&rs_id("bianhao")&"'"
conn.execute(sql)
'-------------------------
totalshulian=0
totalprice=0
totalprice2=0
for x=1 to maxproduit
nowku=request("ku"&x)
set rs_ku=conn.execute("select * from ku where id="&nowku)
nowhuohao=request("huohao"&x)
nowshulian=request("shulian"&x)
nowprice=request("price"&x)
if nowprice="" then
nowprice=0
end if
if nowhuohao<>"单击选择产品" and nowshulian<>"" then
set rs_produit=conn.execute("select * from produit where huohao='"&nowhuohao&"'")
set rs=server.createobject("ADODB.RecordSet")
sql="select * from produit where huohao='"&nowhuohao&"' and id_ku="&nowku
rs.open sql,conn,1,3
rs("shulian")=rs("shulian")-nowshulian
rs.update
rs.close
sql="select bigclass from bigclass where id="&rs_produit("id_bigclass")
set rs_bigclass=conn.execute(sql)
sql="select smallclass from smallclass where id="&rs_produit("id_smallclass")
set rs_smallclass=conn.execute(sql)
if rs_smallclass.eof then
smallclass=""
else
smallclass=rs_smallclass(0)
end if
totalshulian=totalshulian+nowshulian
totalprice=totalprice+nowprice*nowshulian
totalprice2=totalprice2+rs_produit("price2")*nowshulian
sql="insert into sell(id_produit,bigclass,smallclass,title,huohao,id_ku,ku,shulian,guige,id_login,login,type,selldate,price,price2,id_huiyuan,photo,bianhao,beizhu) values("&rs_produit("id")&",'"&rs_bigclass(0)&"','"&smallclass&"','"&rs_produit("title")&"','"&nowhuohao&"',"&rs_ku("id")&",'"&rs_ku("ku")&"',"&nowshulian&",'"&rs_produit("guige")&"',"&nowid_login&",'"&rs_login("username")&"',0,#"&nowselldate&"#,"&nowprice&","&rs_produit("price2")&","&nowhuiyuan&",'"&rs_produit("photo")&"','"&nowbianhao&"','"&nowbeizhu&"')"
conn.execute(sql)
end if
next
if nowhuiyuan<>0 then
conn.execute("update huiyuan set jifen=jifen+"&totalprice&" where id="&nowhuiyuan)
end if
sql="insert into sell(shulian,id_login,login,type,selldate,price,price2,id_huiyuan,bianhao,zu,beizhu) values("&totalshulian&","&nowid_login&",'"&rs_login("username")&"',0,#"&nowselldate&"#,"&totalprice&","&totalprice2&","&nowhuiyuan&",'"&nowbianhao&"',true,'"&nowbeizhu&"')"
conn.execute(sql)
%>
<script language="javascript">
alert("订单修改成功!")
window.opener.location.reload();
window.close();
</script>
<%
response.end
end if
%>
<script language="javascript">
function isNumberString (InString,RefString)
{
if(InString.length==0) return (false);
for (Count=0; Count < InString.length; Count++) {
TempChar= InString.substring (Count, Count+1);
if (RefString.indexOf (TempChar, 0)==-1)
return (false);
}
return (true);
}
function check1()
{
if (document.form1.shulian1.value=="")
{
alert("请输入数量!");
return false;
}
}
</script>
<script language="javascript">
function chg(objName, objName2, zekou)
{
var obj;
obj = document.getElementById(objName);
obj2 = document.getElementById(objName2);
temp = obj2.value*zekou
//obj.value = temp.toFixed(2)
obj.value = Math.round(temp*100)/100
}
</script>
<script language="javascript">
function heji()
{
var temp;
temp = 0;
//obj.value = temp.toFixed(2)
for (i=1;i<=<%=maxproduit%>;i++)
{
obj = document.getElementById('shulian'+i);
//alert(obj.value);
obj2 = document.getElementById('price'+i);
temp=temp+obj.value*obj2.value;
}
document.all.heji.innerHTML = Math.round(temp*100)/100
}
</script>
<%
set rs=conn.execute("select * from sell where id="&request("id"))
set rs_buy=conn.execute("select * from sell where bianhao='"&rs("bianhao")&"' and zu=false")
set rs_huiyuan=conn.execute("select * from huiyuan where id="&rs("id_huiyuan"))
if rs_huiyuan.eof then
nowusername="单击选择会员"
nowcard=""
nowid="0"
else
nowusername=rs_huiyuan("username")
nowcard=rs_huiyuan("card")
nowid=rs_huiyuan("id")
end if
%>
<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#C4D8ED">
<tr>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -