<!--#include file="conn.asp"-->
<%
dim pkid,num,records

pkid=request("pkid")
    'e_guige
num=request("num")
lkgm=request("lkgm")   'Á¢¿Ì¹ºÂò


if isnumeric(num) and not isnull(num) then
	num=abs(num) 
else
	num="1"
end if




if request.Cookies("notemp")="" then
	mytime=now()
	myyear=right(year(mytime),2)
	mymonth=month(mytime)
	myday=day(mytime)
	myhour=hour(mytime)
	myminute=minute(mytime)
	mysec=second(mytime)
	
	if cint(mymonth)<10 then
		mymonth="0"&mymonth
	end if
	
	if cint(myday)<10 then
		myday="0"&myday
	end if
	
	dim num1
	dim rndnum
	Randomize
	Do While Len(rndnum)<4
		num1=CStr(Chr((57-48)*rnd+48))
		rndnum=rndnum&num1
	loop

	billno=myyear&mymonth&myday&myhour&myminute&mysec&"-"&rndnum
	response.Cookies("notemp")=billno
end if

if pkid<>"" then
	sql="insert into x_order(notemp,pkid,num) values('"&request.Cookies("notemp")&"','"&pkid&"','"&num&"')"
	'response.write sql
	'response.end
	conn.execute(sql)
end if


conn.close
set conn=nothing
if lkgm="1" then
response.Redirect("orderjs.asp?action=quickly")
else
response.Redirect("order2.asp")
end if
%>



