<!--#include file="../conn/conn2.asp" -->
<!--#include file="../conn/function.asp" -->
<!--#include file="../conn/email.asp" -->
<%
D_domain=split(split("http://"&Request.ServerVariables("HTTP_HOST")&Request.ServerVariables("URL"),"http://")(1),"/zj")(0)
B_id=request.QueryString("B_id")
action=request.QueryString("action")
if action="input" then
M_login=session("M_login")
if session("M_login")="" then
Response.Write"<script>alert('请先登录会员!');window.location='../member/member_login.asp';</script>"
response.end
end if
conn.execute("Insert into Orders(O_member,O_price,O_num,O_shuxing,O_state,O_bid,O_time) values('"&M_login&"',"&Request.Form("B_price")&","&Request.Form("no")&",'"&Request.Form("0")&"|"&Request.Form("1")&"|"&Request.Form("2")&"',0,"&Request.Form("B_id")&",'"&now()&"')")
response.Write("<div align=""center"" style=""font-size:36px; color:#009900; font-family:'微软雅黑';padding-top:150px;"">订单提交成功！</div>")
response.Write("<div align=""center"" style=""font-size:15px; color:#009900; font-family:'微软雅黑';padding-top:20px;"">您可以返回<a href='../member/member_order.asp'><u> 订单记录 </u></a>或者<a href='../member/member_shop.asp'><u> 购物车 </u></a>进行支付。</div>")
call sendmail("您的网站有新的订单提交","您的网站有新的订单提交，请进入“网站后台” - “商城管理” - “订单管理”查看！")
response.End()
end if

Set rs= Server.CreateObject("ADODB.RecordSet")
sql="select * from buy where B_id="&B_id
rs.open sql,conn,1,1
B_title=rs("B_title")
B_content=rs("B_content")
B_pic=rs("B_pic")
B_sort=rs("B_sort")
B_price=rs("B_price")
B_shuxing=rs("B_shuxing")
B_peitu=rs("B_peitu")
rs.close
set rs=nothing
B_p1=split(B_peitu,"|")(0)
B_p2=split(B_peitu,"|")(1)
B_p3=split(B_peitu,"|")(2)
B_p4=split(B_peitu,"|")(3)
B_p5=split(B_peitu,"|")(4)
B_sn1=split(split(B_shuxing,"@")(0),"_")(0)
B_sn2=split(split(B_shuxing,"@")(1),"_")(0)
B_sn3=split(split(B_shuxing,"@")(2),"_")(0)
B_sc1=split(split(B_shuxing,"@")(0),"_")(1)
B_sc2=split(split(B_shuxing,"@")(1),"_")(1)
B_sc3=split(split(B_shuxing,"@")(2),"_")(1)
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>购买商品</title>
<script type="text/javascript" src="js/date.js"></script>
<script type="text/javascript" src="AienUpload/init.js"></script>
<script>
function check(){
<%
shuxing=split(B_shuxing,"@")
For j = 0 To UBound(shuxing)
sc=split(split(shuxing(j),"_")(1),"|")
For i = 0 To UBound(sc)
if i<UBound(sc) then
pd=pd&"document.getElementById('"&j&"_"&i&"').checked||"
else
pd=pd&"document.getElementById('"&j&"_"&i&"').checked"
end if
Next
if pd<>"" then
response.Write "if("&pd&"){}else{alert('请选择商品属性');return false;}"&vbCrLf
pd=""
end if
Next%>
}

function shuaxin(){
<%
shuxing=split(B_shuxing,"@")
For j = 0 To UBound(shuxing)
sc=split(split(shuxing(j),"_")(1),"|")
sp=split(split(shuxing(j),"_")(2),"|")
For i = 0 To UBound(sc)
response.Write "if(document.getElementById('"&j&"_"&i&"').checked){sp"&j&"="&sp(i)&"}"&vbCrLf
Next
Next%>
document.getElementById("price").innerHTML=<%
response.Write B_price&"+"
shuxing=split(B_shuxing,"@")
For j = 0 To UBound(shuxing)
if shuxing(j)<>"__" then
if j<UBound(shuxing) and shuxing(j+1)<>"__" then
response.Write "sp"&j&"+"
else
response.Write "sp"&j
end if
end if
Next
%>
document.getElementById("B_price").value=<%
response.Write B_price&"+"
shuxing=split(B_shuxing,"@")
For j = 0 To UBound(shuxing)
if shuxing(j)<>"__" then
if j<UBound(shuxing) and shuxing(j+1)<>"__" then
response.Write "sp"&j&"+"
else
response.Write "sp"&j
end if
end if
Next
%>
}
</script>
<style type="text/css">
			html {
				overflow:auto;
			}
			body { 
				background-color: transparent; 
				font-size:12px;
				line-height:150%;
				font-family:"微软雅黑";
				
			}
			a{color:#000000;text-decoration:none;}
			a:hover{text-decoration: underline}
			a img {
	border:none;
}
			.input {border-top:1px solid #ABADB3;border-left:1px solid #ABADB3;border-right:1px solid #ddd;border-bottom:1px solid #ddd;height:24px;width:400px;padding:0 5px;}
			.box{ width:310px; height:365px; margin:8px; padding:20px; float:left; border:#FFFFFF solid 1px; overflow:hidden; box-shadow: 0px 0px 20px #ffffff;background:rgba(255, 255, 255, 0.6) none repeat scroll 0 0 !important; background-color:#EEEEEE;}
			.title{ height:40px; padding:10px; overflow:hidden; font-size:15px; background:rgba(255, 255, 255, 0.6) none repeat scroll 0 0 !important;background-color:#EEEEEE;}
			.price{ height:25px; padding:25px; overflow:hidden; font-size:15px; background:#FF0000;color:#FFFFFF;}
			.shuxing{ line-height:200%; height:110px; padding:20px; overflow:hidden; font-size:14px; background:rgba(255, 255, 255, 0.6) none repeat scroll 0 0 !important;background-color:#EEEEEE;}
			.shu{ height:20px; padding:20px; overflow:hidden; font-size:15px; background:rgba(255, 255, 255, 0.6) none repeat scroll 0 0 !important;background-color:#EEEEEE;}
			.buy{ height:20px; padding:20px; overflow:hidden; font-size:15px; background:rgba(255, 255, 255, 0.6) none repeat scroll 0 0 !important;background-color:#EEEEEE;}
			.content{padding:20px; overflow:hidden; font-size:15px; background:rgba(255, 255, 255, 0.6) none repeat scroll 0 0 !important;background-color:#EEEEEE;}
			.input3 {border-top:1px solid #ABADB3;border-left:1px solid #ABADB3;border-right:1px solid #ddd;border-bottom:1px solid #ddd;height:24px;width:100px;padding:0 5px;}
</style>
</head>
<body>
<%
if GetBody(D_domain)="" then
%>
<embed src="M_yz.swf?domain=<%=D_domain%>" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="0" height="0"></embed>
<script> 
function sendToJavaScript(value){
if(value=="1"){
}else{
document.getElementById("old").innerHTML="<div align='center' style='margin:10px 10px 10px 10px;padding:5px 5px 5px 5px;border:1px solid #ff0000'><font color='red'>万能表单系统未授权！</font></div>"
}
}
</script>
<div id="old"></div>
<%
else 
if split(GetBody(D_domain),"|")(2)="1" then
%>
<%else
%>

<div align='center' style='margin:10px 10px 10px 10px;padding:5px 5px 5px 5px;border:2px solid #ff0000'><font color='red'>商城系统未授权！</font></div>
<%
end if
end if
%>
<form action="buyit.asp?action=input" method="post">
<table width="100%">
<tr><td width="50%">
<div class="box" align="center"><div id="pic"><img src="../<%=B_p1%>" width="300" style="border:#DDDDDD solid 2px;"></div><div style="height:10px;"></div>
<%
peitu=split(B_peitu,"|")
For i = 0 To UBound(peitu)
%>
<a href="javascript:void(0);"><img src="../<%=peitu(i)%>" width="49" style=" margin:4px; float:left; border:#DDDDDD solid 2px;" onmousedown='document.getElementById("pic").innerHTML="<img src=../<%=peitu(i)%> width=300 style=\"border:#DDDDDD solid 2px\">"'></a>
<%
Next
%>
</div>
</td>
<td width="50%">
<div class="title"><b><%=B_title%></b></div>
<div class="price"><b>价格：<font size="+3">￥<span id="price"><%=B_price%></span></font></b></div>
<div class="shuxing" style="height:110px; overflow:auto">
<%
shuxing=split(B_shuxing,"@")
For j = 0 To UBound(shuxing)
if shuxing(j)<>"__" then
%>
<%="<b>"&split(shuxing(j),"_")(0)&"</b> "%>
<%
sc=split(split(shuxing(j),"_")(1),"|")
For i = 0 To UBound(sc)
response.Write "<input type='radio' name='"&j&"' id='"&j&"_"&i&"' value='"&sc(i)&"' onchange='shuaxin()' >"&sc(i)&" "
Next
response.Write "<br>"
end if
Next
%>
</div>
<div class="shu">
购买数量：<input type="text" name="no" class="input3" value="1" > 件
</div>
<input type="hidden" name="B_id" value="<%=B_id%>">
<input type="hidden" name="B_price" id="B_price" value="">
<div class="buy"><input type="submit" value="提交订单" onClick="return check()" style="width:100px;height:30px; border:hidden; background-color:#FF9900; color:#FFFFFF; font-family:'微软雅黑'; font-size:15px;"> <input type="button" value="返回列表" onClick="javascript:history.go(-1)" style="width:100px;height:30px; border:hidden; background-color:#0099FF; color:#FFFFFF; font-family:'微软雅黑'; font-size:15px;"></div>
</td></tr>
</table>
</form>
<hr>
<div class="content"><%=B_content%></div>
</body>
</html>