%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%><%option Explicit
response.charset="utf-8"
dim listnum,t,tlnum,totalPut, CurrentPage, TotalPages,filename,filen,thisn,totalnumber
Dim ThisID,lmid,p_id,m_id,s_id,Order_ID,Order_Num,CurID
CurID=0
ThisID=5
p_id=request("id")
If p_id="" Or Not IsNumeric(p_id) Then p_id=0
m_id=request("mid")
If m_id="" Or Not IsNumeric(m_id) Then m_id=0
s_id=request("sid")
If s_id="" Or Not IsNumeric(s_id) Then s_id=0%>
<%
Function Insert_Stock_P(id) 'id_sell
Dim rs,IMG
set rs=server.CreateObject("adodb.recordset")
sql="select * from ic_sell where id=" & id
rs.open sql,conn,1,1
If rs.eof Then Exit Function
IMG=rs("rs2")
If IMG="" Then IMG="/nopic.jpg"
Call ShowTable("P" , rs("id"),IMG,"" & rs("rs1") & "",rs("memo"),Replace(rs("rs7"),","," "),rs("rs8"),rs("rs9"))
rs.close
set rs=Nothing
End Function
Function Insert_Stock_M(id) 'model
Dim rs
set rs=server.CreateObject("adodb.recordset")
sql="select * from model where model_id=" & id
rs.open sql,conn2,1,1
If rs.eof Then Exit Function
Call ShowTable("M" , rs("model_id"),"/nopic.jpg",Trim(rs("model_name")),"原装","现货"," "," ")
rs.close
set rs=Nothing
End Function
Function Insert_Stock_S(id) 'stock
Dim rs
set rs=server.CreateObject("adodb.recordset")
sql="select sCJName,sfz,sPH,sPrice,sHeadid,sBName from stock where sHeadid=" & id
rs.open sql,conn2,1,1
If rs.eof Then Exit Function
Call ShowTable("S" , rs("sHeadid"),"/nopic.jpg",Trim(rs("sBName")),"原装现货" &rs(0),"现货","封装:" &rs(1) & " 批号:" &rs(2),rs(3))
rs.close
set rs=Nothing
End Function
Function ShowTable(pTID,pid,IMG,V1,V2,V3,V4,V5)
If Get_Top1("select id from Stock_Order where orderid=0 and userid=" & uId & " and pTID='" & pTID & "' and pID=" & pid,1)=0 Then
If V5="" Or Not IsNumeric(V5) Then V5=0
conn.execute("insert into Stock_Order (userid,pID,pTID,img,ic1,ic2,ic3,ic4,ic5,ic6) values (" & uId & "," & pid & ",'" & pTID & "','" & IMG & "','" & Func_QK(V1) & "','" & Func_QK(V2) & "','" & Func_QK(V3) & "','" & Func_QK(V4) & "','" & V5 & "',1)")
End if
End Function
Function Func_QK(V)
Dim L1,L2
If V<>"" Then
V=Replace(V,"
"," ")
L1=InStr(1,V,"<")
Do While L1>0
L2=InStr(L1,V,">")+1
If L2=1 Then Exit Do
V=replace(V,Mid(V,L1,L2-L1),"")
L1=InStr(1,V,"<")
Loop
V=Replace(V,"'","''")
End if
Func_QK=V
End Function
' response.write("
")
'Function SetCookie(id,id_n)
' Dim isAdd
' If Order_Num=0 Then
' Response.Cookies("zqUserOrder")("ID_1")=id
' Response.Cookies("zqUserOrder")("ID_Num")=1
' Order_Num=1
' Else
' isAdd=false
' For i=1 To Order_Num
' If request.Cookies("zqUserOrder")("ID_" & i)=id then
' isAdd=True
' Exit for
' End if
' Next
' If Not isAdd Then
' Response.Cookies("zqUserOrder")("ID_" & i)=id
' Response.Cookies("zqUserOrder")("ID_Num")=i
' Order_Num=i
' End if
' End If
' Response.Cookies("zqUserOrder").Expires=DateAdd("h",4,Now())
'End Function
%>