%
dim action
action=request.Form("action")
if action="save" then
dim pname,ptype,pcolor,pnum,ptime,tel,email,sheng,shi,qu,username,content,addr
pname=server.HTMLEncode(request.Form("pname"))
ptype=server.HTMLEncode(request.Form("ptype"))
pcolor=server.HTMLEncode(request.Form("pcolor"))
pnum=server.HTMLEncode(request.Form("pnum"))
ptime=server.HTMLEncode(request.Form("ptime"))
tel=server.HTMLEncode(request.Form("tel"))
email=server.HTMLEncode(request.Form("email"))
username=server.HTMLEncode(request.Form("username"))
content=server.HTMLEncode(request.Form("content"))
sheng=server.HTMLEncode(request.Form("sheng"))
shi=server.HTMLEncode(request.Form("shi"))
qu=server.HTMLEncode(request.Form("qu"))
addr=sheng&" "&" "&shi&" "&qu
conn.execute("insert into bill(pname,ptype,pcolor,pnum,ptime,username,tel,email,addr,content,updatetime) values('"&pname&"','"&ptype&"','"&pcolor&"','"&pnum&"','"&ptime&"','"&username&"','"&tel&"','"&email&"','"&addr&"','"&content&"','"&now()&"')")
dim comeUrl
comeUrl=request.Form("comeUrl")
if comeUrl="" then
comeUrl="order.asp"
end if
response.write ""
response.End()
end if
dim cId
cId=request.QueryString("cId")
if cId="" or not isnumeric(cId) then
cId=0
else
cId=cint(cId)
end if
if cId=0 then
set Rs=conn.execute("select top 1 cname,readme,content from company order by orderid")
else
set Rs=conn.execute("select top 1 cname,readme,content from company where cid="&cid)
if rs.eof and rs.bof then
rs.close
set rs=nothing
set Rs=conn.execute("select top 1 cname,readme,content from company order by orderid")
cId=0
end if
end if
dim typeArr,nameArr(10),colorArr,typeRow,nameRow,colorRow
if rs.eof and rs.bof then
typeRow=-1
colorRow=-1
else
nowName=rs("cname")
typeArr=rs("readme")
colorArr=rs("content")
if typeArr<>"" then
typeArr=split(typeArr,chr(13)&chr(10))
typeRow=ubound(typeArr)
else
typeRow=-1
end if
if colorArr<>"" then
colorArr=split(colorArr,chr(13)&chr(10))
colorRow=ubound(colorArr)
else
colorRow=-1
end if
end if
rs.close
set rs=nothing
set Rs=server.CreateObject("adodb.recordset")
rs.open "select cname from company order by orderid",conn,1,3
if rs.eof and rs.bof then
nameRow=-1
else
i=0
do while not rs.eof
nameArr(i)=rs("cname")
rs.movenext
i=i+1
loop
end if
rs.close
set rs=nothing
%>