<!--#include file="../conn/conn2.asp" -->
<!--#include file="top.asp" -->
<%
'----------------------清除HTML格式2------------------------------
Function RemoveHTML(str) 
Dim re 
Set re=New RegExp 
re.Pattern="<[FONT|font]+[^>]*>"    '请参考学习正则表达式
re.IgnoreCase=True 
re.Global=True 
str=re.Replace(str,"") 
Set re=Nothing 
RemoveHTML=str 
End Function

B_id=request.QueryString("id")
action=request.QueryString("action")
M_login=session("M_login")





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> 
<html> 
<head> 
	<meta charset="gb2312" />
    <meta name="viewport" content="user-scalable=no,width=device-width" />
    <meta name="format-detection" content="telephone=no"/>
<title><%=B_title%>-<%=title%></title>
<meta name="keywords" content="<%=keywords%>" />
<meta name="description" content="<%=content%>" />
    <link rel="stylesheet" href="style/mobile.css" /> 
	<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>  
    <script src="jquery/jquery-1.10.1.min.js"></script>    
    <script src="jquery/myjs.js"></script>    
</head> 
<%
if action="input" then
if M_login="" then
Response.Write"<script>alert('请先登录!');window.location='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("<script>alert('提交订单成功!前往订单记录支付');window.location='order.asp';</script>")
response.End()
end if
%>
<body onResize="loadtop();loadmain();loadfoot();">
<script src="js/0.js"></script>
<script src="js/1.js"></script>

<div id="dvtopbg"><img src="images/bg_header.png" ></div>
<div id="dvtop" >
<p id="topback"><a href="javascript:history.go(-1);"><img src="images/ico_back.png"></a></p>
<p id="tophome"><a href="index.asp"><img src="images/ico_home.png"></a></p>
<p id="toplogo"><img onLoad="loadlogo(this);" id="tiglog" style="display:none;" src="../media/<%=C_mlogo%>" /></p>
</div>

<script>loadtop();</script>

<div id="dvmain">
<%
if GetBody(D_domain)="" then
%>
<embed src="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' size='+1'>您使用的为免费版！请尽快升级到商业授权版保证正常使用！</font></div>"
}
}
</script>
<div id="old"></div>
<%
else 
if split(GetBody(D_domain),"|")(1)="1" then
%>
<%else%>
<div align='center' style='margin:10px 10px 10px 10px;padding:5px 5px 5px 5px;border:1px solid #ff0000'><font color='red' size='+1'>您使用的为免费版！请尽快升级到商业授权版保证正常使用！</font></div>
<%
end if
end if
%>
<div id="dvphototit"><%=B_title%></div>
<div id="dvmimg"><img src="images/loadimg.gif" id="ilimg" /><img onload="loadfimg(this);" id="acfimg" src="../<%=B_pic%>" style="border:1px solid #d0d0d0;-moz-border-radius:8px;-webkit-border-radius:8px;border-radius:8px;box-shadow: 2px 2px 2px #d8d8d8;display:none;" /></div>

<div id="dvminfo">
<form action="buyit.asp?action=input" method="post">
<div style=" background-color:#FF0000; color:#FFFFFF; padding:10px; margin:10px 0 10px 0; font-size:20px;" align="center"><b>￥<span id="price"><%=B_price%></span></b></div>
<div style=" line-height:200%">
<%
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
%>
购买数量：<input type="text" name="no" class="input3" value="1" > 件
<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:80px;height:30px; border:hidden; font-family:'微软雅黑'; font-size:15px;">
</div>
</form>
<div style="margin:10px 0 10px 0; padding:5px; background-color:#FFFFFF; border:#CCCCCC solid 1px;"><%=B_content%></div>
</div>
	 
	 </div>
	 
	 <img onClick="this.style.width='0px';this.style.display='none';" id="imgpromptf88a0" style="z-index:999; position:absolute; display:none;"><script src="js/2.js"></script>
<script>loadmain();</script>
<div id="dvfoot"><ul><li><a id="aphone" href="tel:<%=C_mobile%>"><img src="images/butphone.jpg" /></a><a id="aemail" href="mailto:<%=C_email%>"><img src="images/butemail.jpg" /></a><a id="amap" href="map.asp"><img src="images/butmap.jpg" /></a><a id="ashare" onClick="shareopen();"><img src="images/butshare.jpg" /></a><a id="aleave" style="border:0px;" href="guestbook.asp"><img src="images/butleave.jpg" /></a></li></ul></div>
<script>loadfoot();</script>
</body>
</html>
