<!-----------------------------此页代码参照user_csAdd_fun.asp页面--------------------------->
<!--#include file="userCheck.asp"-->
<!--#include file="conn.asp"-->
<!--#include file="inc/exportPinPai.asp"-->
<%
dim dates(4)
dates(0)         = request.Form("s1")					'国产还是进口
dates(1)         = request.Form("s2")					'厂家
dates(2)         = request.Form("s3")					'品牌
dates(3)         = request.Form("s4")					'型号

province         = request.form("province")				'省份
province_shi      = request.form("city")				'城市
carYear          = trim(request.form("caryear"))
carMonth         = trim(request.form("carMonth"))
carDay           = trim(request.form("carDay"))
marketPrice      = request.form("marketPrice")
seatnumber       = request.form("seatnumber")
sqyear           = request.form("sqyear")

productSortPath   = dates(0)&","&dates(1)&","&dates(2)&","&dates(3)
'以上已经在上一步做过验证

jqx            = trim(request.form("jqx"))
csx     	   = trim(request.form("csx"))
dqx            = trim(request.form("dqx"))
dszx           = trim(request.form("dszx"))
jsyx       	   = trim(request.form("jsyx"))
cyx    		   = trim(request.form("cyx"))
blx            = trim(request.form("blx"))
zrx	   		   = trim(request.form("zrx"))
eyxwx		   = trim(request.form("eyxwx"))
bjmp		   = trim(request.form("bjmp"))

'验证第三者险
'if dszx = "" then call wrong("请选择第三者险保额！")
'验证驾驶员险
'if jsyx = "" then call wrong("请选择驾驶员险保额！")
'验证乘员险
'if cyx = "" then call wrong("请选择乘员险保额！")
'验证玻璃险
'if blx = "" then call wrong("请选择玻璃险保额！")
'验证恶意行为险
'if eyxwx = "" then call wrong("请选择恶意行为险保额！")

'================================================

dim sql
Set InsertCursor = Server.CreateObject("ADODB.Recordset")

InsertCursor.Open "SELECT top 1 * FROM bxinfo order by bxid desc",conn,1,3
InsertCursor.addnew

InsertCursor("caryear")     = caryear
InsertCursor("carmonth") 	= carmonth	
InsertCursor("carday") 		= carday 
InsertCursor("province")     = province
InsertCursor("province_shi") = province_shi
InsertCursor("marketPrice") = marketPrice
InsertCursor("seatnumber")  = seatnumber
InsertCursor("sqyear")      = sqyear
InsertCursor("jqx") 		= jqx
InsertCursor("csx")    		= csx
InsertCursor("dqx")    		= dqx	
InsertCursor("dszx") 		= dszx	
InsertCursor("jsyx")        = jsyx
InsertCursor("cyx")   		= cyx
InsertCursor("blx")     	= blx
InsertCursor("zrx") 		= zrx
InsertCursor("eyxwx")    	= eyxwx
InsertCursor("bjmp")    	= bjmp

InsertCursor("userId")    	= session("userId23")

InsertCursor("productSort")		= productSortPath

InsertCursor("ifchuli")		= "0"


InsertCursor.Update
InsertCursor.close
conn.close
set InsertCursor=nothing
set conn=nothing

response.write "<script>alert('提交成功！');window.open('Bxonline.asp','_self')</script>"

'===================
'获得编号
function getBianhao(hh)
	if hh = "" then
		getBianhao = ""
	else
		hh = replace(hh," ","")
		hh = replace(hh,"-","")
		hh = replace(hh,":","")
		hh = replace(hh,"上午","")
		hh = replace(hh,"下午","")
		hh = replace(hh,"AM","")
		hh = replace(hh,"PM","")
		getBianhao = hh
	end if
end function
%>
<%
'================================================
'获取字符串中分隔符的数量
function countpg(str1,str2)
	dim i,counter
	counter=0
	if InStr(str2,str1) then
		for i=1 to len(str2)
			if mid(str2,i,len(str1))=str1 then
				counter=counter+1
			end if
		next 
	end if
	countpg=counter
 end function
%>