<!--#include file="conn/conn.asp" -->
<!--#include file="conn/function.asp" -->

<!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=utf-8" />
<meta name="author" content="qinuoli">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="format-detection" content="telephone=no">
<title>个人中心</title>
</head>
<body>
<%
if request.QueryString("action")="input" then
if session("M_login")="" then
session("from")=Server.URLEncode("http://"&request.servervariables("HTTP_HOST")&C_dir&"index.asp?type=productinfo&S_id="&Request.Form("P_id"))
call box("请先登录会员!",C_dir&"member/member_login.asp","error")
end if

For Each x In Request.Form
if split(x,"_")(0)="scvvvvv" then
sc=sc&Request.Form(x)&"|"
end if
next
sc=left(sc,len(sc)-1)

if sc="" then
sc="标配"
end if

Set rs= Server.CreateObject("ADODB.RecordSet")
sql="select * from SL_product where P_id="&Request.Form("P_id")
rs.open sql,conn,1,1
if not rs.eof then
P_title=rs("P_title")
P_price=rs("P_price")
end if
rs.close
set rs=nothing

if Request.Form("P_price")="" then
price=P_price
else
price=Request.Form("P_price")
end if

conn.execute("Insert into SL_orders(O_member,O_price,O_num,O_shuxing,O_state,O_pid,O_time) values("&session("M_id")&","&price&","&Request.Form("no")&",'"&sc&"',0,"&Request.Form("P_id")&",'"&now()&"')")

Set rs= Server.CreateObject("ADODB.RecordSet")
sql="select top 1 * from SL_orders order by O_id desc"
rs.open sql,conn,1,1
if not rs.eof then
O_id=rs("O_id")
end if
rs.close
set rs=nothing
call sendmail("您的网站有新的订单提交","<h2>您的网站“"&C_webtitle&"”有新的订单提交</h2><hr>商品名称："&P_title&"<br>数量："&Request.Form("no")&"<br>属性："&sc&"<br>价格："&formatnumber(price,2,-1)&"元<hr>请进入“网站后台” - “商城管理” - “订单管理”查看详情！",C_email)
If WAPstr()=true and W_show=2 Then
call box("订单提交成功！",C_dir&"wapmember/member_pay.asp?O_id="&O_id,"success")
else
call box("订单提交成功！",C_dir&"member/member_pay.asp?O_id="&O_id,"success")
end if
end if
%>
</body>
</html>