<!--#include file="conn.asp"-->
<!--#include file="inc/function.asp"-->
<%
dim bt,nr,dl,xl,fz,rs,qm,email,sql
bt=request.Form("bt")
nr=HTMLcode(RemoveHTML(request.Form("nr")))
dl=request.Form("dl")
xl=request.Form("xl")
fz=request.Form("fz")
if fz="" then 
  fz=0
end if
email=request.Form("email")
qm=request.Form("qm")

if dl="" then
dl="专家咨询"
end if

if xl="" then
if dl="专家咨询" then
xl="其它"
else
xl="其它"
end if
end if

if nr="" then
nr="如题"
end if

if qm="" then
qm="热心网友"
end if

if bt<>"" then

dim show_name
  randomize
  ranNum=int(90000*rnd)+10000
  show_name=year(now)&month(now)&"/"&year(now)&month(now)&day(now)&hour(now)&minute(now)&second(now)&ranNum&".html"
		
set rs=server.CreateObject("adodb.recordset")
sql ="Select * from kw_wt"
rs.open sql,conn,1,3
rs.addnew
rs("bt")=bt
rs("nr")=nr
rs("email")=email
rs("qm")=qm
rs("dalei")=dl
rs("xiaolei")=xl
rs("userid")=session("userid")
rs("usertx")=session("usertx")
rs("wt_filename")=show_name
rs("xsf")=fz
rs("zt")=1
rs("twtime")=now()
rs.update


	dim show
	show=ReadTemplate("template/show_temp.html")
	show=replace(show,"{$siteinfo}",rs("bt"))
	show=replace(show,"{$daohang}",daohang())
	show=replace(show,"{$show_wt}",show_wt())
	show=replace(show,"{$hd_count}","0")
	show=replace(show,"{$wt_filename}",show_name)
	show=replace(show,"{$show_best}","")
	show=replace(show,"{$show_hd}","&nbsp;&nbsp;&nbsp;&nbsp;暂时没有回答，欢迎你来答复！")
	webtop=ReadTemplate("template/webtop.html")
	webbottom=ReadTemplate("template/webbottom.html")
	webright=ReadTemplate("template/webright.html")
	show=replace(show,"{$WebTop}",webtop)
	show=replace(show,"{$WebBottom}",webbottom)
	show=replace(show,"{$WebRight}",webright)

	Call BuildFile(Server.MapPath("show/"&show_name),show)

dim rs1,sql1
set rs1=server.CreateObject("adodb.recordset")
sql1 ="Select * from kw_user where username='"&session("userid")&"'"
rs1.open sql1,conn,1,3
	
response.write "<script language=javascript>alert('恭喜！发表成功了');document.location.href='show/"&rs("wt_filename")&"'</script>"
else
response.write "<script language=javascript>alert('抱歉！发表没有成功');history.go(-1);</script>"
end if

rs.close
set rs=nothing
rs1.close
set rs1=nothing
closedb

Function Daohang()
Daohang="<a href=""../../index.html"">首页</a> → <a href=""../../list.asp?dl="&dl&""">"&dl&"</a> → <a href=""../../list.asp?dl="&dl&"&xl="&xl&""">"&xl&"</a>"
End Function

Function Show_wt()
dim rs,sql
set rs=server.CreateObject("adodb.recordset")
sql ="Select * from kw_wt where wt_filename='"&show_name&"'"
rs.open sql,conn,1,1
Show_wt="<table width=""98%""  border=""0"" cellspacing=""0"" cellpadding=""0"">"&vbcrlf
Show_wt=Show_wt&"<tr>"&vbcrlf
Show_wt=Show_wt&"<td height=""30""><font style=""font-size:14""><b>"&bt&"</b></font></td>"&vbcrlf
Show_wt=Show_wt&"</tr>"&vbcrlf
Show_wt=Show_wt&"<tr>"&vbcrlf
Show_wt=Show_wt&" <td height=""26""><img src=""../../images/jf_point.gif"">&nbsp;<font color=""#ff5400"">悬赏分："&fz&"</font>&nbsp;&nbsp;<script src=""../../wttime.asp?wtid="&rs("id")&"""></script></td>"&vbcrlf
Show_wt=Show_wt&"</tr>"&vbcrlf
Show_wt=Show_wt&"<tr>"&vbcrlf
Show_wt=Show_wt&"<td><font style=""font-size:14"">"&nr&"</font></td>"&vbcrlf
Show_wt=Show_wt&"</tr>"&vbcrlf
Show_wt=Show_wt&"<tr>"&vbcrlf
Show_wt=Show_wt&"<td align=""right""><font color=""#666666"">提问者：</font><font color=#000000><a href='/ask/list3.asp?key="&qm&"'>"&qm&"</a></font></td>"&vbcrlf
Show_wt=Show_wt&"</tr>"&vbcrlf
Show_wt=Show_wt&"<tr>"&vbcrlf
Show_wt=Show_wt&"<td align=""right"" height=""30""><script src=""../../change_wt.asp?id="&rs("id")&"""></script>&nbsp;&nbsp;&nbsp;&nbsp;</td>"&vbcrlf
Show_wt=Show_wt&"</tr>"&vbcrlf
Show_wt=Show_wt&"<tr>"&vbcrlf
Show_wt=Show_wt&"<td height=""40"">&nbsp;&nbsp;&nbsp;&nbsp;<input type=""button"" name=""whd"" value=""我来回答"" onClick=""document.location.href='#hd'"" class=""regbutton""></td>"&vbcrlf
Show_wt=Show_wt&"  </tr></table>"&vbcrlf
rs.close
set rs=nothing
End Function
%>

