<!--#include file="conn.asp"-->
<!--#include file="inc/function.asp"-->
<!--#include file="chklogin.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>快问我知道 - 改变问题属性</title>
<link href="css.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
body {
	background-color: #E6E6FF;
}
-->
</style>
<script language=javascript>
function CheckForm()
{
 	  if (document.bcform.bcnr.value.length<10){
	  alert("补充问题至少10字符!");
	  document.bcform.bcnr.focus();
	  return false;
      }
}
</script>
</head>
<body>
<%
dim cz,id,rs,sql,fz,bcnr
cz=request("cz")
id=request("id")
fz=request("fz")
bcnr=HTMLcode(RemoveHTML(request("bcnr")))
   set rs=server.CreateObject("adodb.recordset")
   sql ="Select * from kw_wt where id="&id&""
   rs.open sql,conn,1,3
if cz="tg" then
%><br>
<br>

<table width="98%"  border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#62A11C">
  <tr>
    <td height="28" bgcolor="#EDF3FE"><B>&nbsp;★ 问题： <%=rs("bt")%></B></td>
  </tr>
  <form action="memo.asp?cz=tgform&id=<%=id%>" method="post">
    <tr>
      <td height="56" bgcolor="#EDF3FE">&nbsp;&nbsp;<img src="images/xs_point.gif"><font style="font-size:14px ">&nbsp;我要把该问的&nbsp;悬赏分由&nbsp;<%=rs("xsf")%>&nbsp;提高到&nbsp;
	 <%
	 dim rs1,sql1
	 set rs1=server.CreateObject("adodb.recordset")
		sql1 ="Select * from kw_user where username='"&session("userid")&"'"
        rs1.open sql1,conn,1,1
	 %>
	 
	  <select name="fz" id="fz">
          <%for i=rs("xsf")+10 to rs1("jifen") step 10
		    if i>100 then
			exit for
			end if
		  %>
		  <option value="<%=i%>"><%=i%></option>
          <%next
		  rs1.close
		  set rs1=nothing
		  %>
        </select>&nbsp;分&nbsp;&nbsp;
                  <input type="submit" name="Submit" value="确认">
      </font></td>
    </tr>
  </form>
</table>
<%elseif cz="tgform" then
rs("xsf")=fz
rs.update

	dim show,show_name
	show_name=rs("wt_filename")
	
	show=ReadTemplate("template/show_temp.html")
	show=replace(show,"{$siteinfo}",rs("bt"))
	show=replace(show,"{$daohang}",daohang())
	show=replace(show,"{$show_wt}",show_wt())
	            dim rs4,sql4
                set rs4=server.CreateObject("adodb.recordset")
                sql4 ="Select * from kw_hd where hdques='"&rs("wt_filename")&"'"
                rs4.open sql4,conn,1,1 
	show=replace(show,"{$hd_count}",rs4.recordcount)
	            rs4.close
				set rs4=nothing
	show=replace(show,"{$wt_filename}",show_name)
	show=replace(show,"{$show_hd}",show_hd())
	show=replace(show,"{$show_best}",show_best())
	Call BuildFile(Server.MapPath("show/"&show_name),show)
	
   rs.close
   set rs=nothing
   closedb
   response.write "<script>alert('悬赏修改成功!');window.opener.location.reload();window.close();</script> "

elseif cz="bc" then
%><br>
<table width="98%"  border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#62A11C">
  <tr>
    <td height="28" bgcolor="#EDF3FE"><B>&nbsp;★ 问题： <%=rs("bt")%></B></td>
  </tr>
  <form action="memo.asp?cz=bcform&id=<%=id%>" method="post" name="bcform" onsubmit="return CheckForm();">  <tr>
    <td height="171" align="center" bgcolor="#EDF3FE">请认真输入补充的内容!<br>
<textarea name="bcnr" cols="56" rows="8"></textarea><br>
<input type="submit" name="Submit" value="确 认">
</td>
  </tr>
  </form>
</table>
<%elseif cz="bcform" then
  if bcnr<>"" then
rs("nr")=rs("nr")&"<br><br><b>&nbsp;&nbsp;<font color=red>★★★ 问题补充 ★★★</font></b>&nbsp;&nbsp;<font color=#999999>("&now()&")</font><br>"&bcnr
rs.update
	show_name=rs("wt_filename")
	
	show=ReadTemplate("template/show_temp.html")
	show=replace(show,"{$siteinfo}",rs("bt"))
	show=replace(show,"{$daohang}",daohang())
	show=replace(show,"{$show_wt}",show_wt())
	           
                set rs4=server.CreateObject("adodb.recordset")
                sql4 ="Select * from kw_hd where hdques='"&rs("wt_filename")&"'"
                rs4.open sql4,conn,1,1 
	show=replace(show,"{$hd_count}",rs4.recordcount)
	            rs4.close
				set rs4=nothing
	show=replace(show,"{$wt_filename}",show_name)
	show=replace(show,"{$show_hd}",show_hd())
	show=replace(show,"{$show_best}",show_best())
	Call BuildFile(Server.MapPath("show/"&show_name),show)
	
   rs.close
   set rs=nothing
   closedb
   response.write "<script>alert('问题添加成功!');window.opener.location.reload();window.close();</script> "
  end if
end if
	
Function show_best()
dim rs,sql
set rs=server.CreateObject("adodb.recordset")
sql ="Select * from kw_hd where hdques='"&show_name&"' and zt='2'"
rs.open sql,conn,1,1
if rs.recordcount<>0 then
show_best="<table width=""100%""  border=""0"" cellspacing=""0"" cellpadding=""0"" class=""table_best"">"&vbcrlf
show_best=show_best&"<tr>"&vbcrlf
show_best=show_best&"<td class=""bg_best"">&nbsp;<img src=""../../images/cn_point.gif"">&nbsp;最佳答案</td>"&vbcrlf
show_best=show_best&"</tr>"&vbcrlf
show_best=show_best&"<tr>"&vbcrlf
show_best=show_best&"<td>"&vbcrlf
show_best=show_best&"<table width=""94%""  border=""0"" cellspacing=""0"" cellpadding=""0"">"&vbcrlf
show_best=show_best&"<tr>"&vbcrlf
show_best=show_best&"<td width=""2%"" rowspan=""4"">&nbsp;</td>"&vbcrlf
show_best=show_best&"<td width=""98%"" height=""60""><font style=""font-size:14"">"&rs("wtans")&"</font></td>"&vbcrlf
show_best=show_best&"</tr>"&vbcrlf
show_best=show_best&"<tr>"&vbcrlf
show_best=show_best&"<td align=""right""><font color=""#666666"">回答者：</font>"
   dim rs1,sql1
   set rs1=server.CreateObject("adodb.recordset")
   sql1 ="Select * from kw_user where username='"&rs("userid")&"'"
   rs1.open sql1,conn,1,1
   if rs1("zhuan")=1 then
show_best=show_best&"<img src=""../../images/zhuan.gif"">"
   end if
show_best=show_best&"<a href=""../../showuser.asp?userid="&rs("userid")&""" class=userk>"&rs("userid")&"</a>&nbsp; - <font color=#000000>头衔："&rs("usertx")&"</font>&nbsp;<font color=""#666666"">"&rs("hdtime")&"</font>&nbsp;&nbsp;</td>"&vbcrlf
show_best=show_best&"</tr>"&vbcrlf
   if rs1("zhuan")=1 then
show_best=show_best&"<tr>"&vbcrlf
show_best=show_best&"<td><img src="""&rs1("mark_logo")&""">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"&rs1("mark")&"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="""&rs1("mark_url")&""" target=_blank>"&rs1("mark_url")&"</a></td>"&vbcrlf
show_best=show_best&"</tr>"&vbcrlf
   end if
   rs1.close
   set rs1=nothing
show_best=show_best&"<tr>"&vbcrlf
show_best=show_best&"<td><hr color=""#666666"" align=""center"" width=""96%"" size=""1""></td>"&vbcrlf
show_best=show_best&"</tr>"&vbcrlf
show_best=show_best&"</table>"&vbcrlf
show_best=show_best&"</td></tr>"&vbcrlf
show_best=show_best&"</table>"&vbcrlf
show_best=show_best&"<table width=""100%""  border=""0"" cellspacing=""0"" cellpadding=""0"">"&vbcrlf
show_best=show_best&"<tr>"&vbcrlf
show_best=show_best&"<td height=""8""></td>"&vbcrlf
show_best=show_best&"</tr>"&vbcrlf
show_best=show_best&"</table>"&vbcrlf
end if
rs.close
set rs=nothing
End Function

Function show_hd()
dim rs,sql,i,str
set rs=server.CreateObject("adodb.recordset")
sql ="Select * from kw_hd where hdques='"&show_name&"' and zt='1' order by id desc"
rs.open sql,conn,1,1
if rs.bof and rs.eof then
show_hd="暂无回答,请你参与!"
else
for i=1 to rs.recordcount
str="<table width=""94%""  border=""0"" cellspacing=""0"" cellpadding=""0"">"&vbcrlf
str=str&"<tr>"&vbcrlf
str=str&"<td width=""2%"" rowspan=""4"">&nbsp;</td>"&vbcrlf
str=str&"<td width=""98%"" height=""60""><font style=""font-size:14"">"&rs("wtans")&"</font></td>"&vbcrlf
str=str&"</tr>"&vbcrlf
str=str&"<tr>"&vbcrlf
str=str&"<td align=""right""><script src=""../../cnhd.asp?hdid="&rs("id")&"&wtid="&id&"""></script>&nbsp;&nbsp;&nbsp;&nbsp;<font color=""#666666"">回答者：</font>"
   dim rs1,sql1
   set rs1=server.CreateObject("adodb.recordset")
   sql1 ="Select * from kw_user where username='"&rs("userid")&"'"
   rs1.open sql1,conn,1,1
   if rs1("zhuan")=1 then
str=str&"<img src=""../../images/zhuan.gif"">"
   end if
str=str&"<a href=""../../showuser.asp?userid="&rs("userid")&""" class=userk>"&rs("userid")&"</a>&nbsp; - <font color=#000000>头衔："&rs("usertx")&"&nbsp;</font><font color=""#666666"">"&rs("hdtime")&"</font>&nbsp;&nbsp;</td>"&vbcrlf
str=str&"</tr>"&vbcrlf
   if rs1("zhuan")=1 then
str=str&"<tr>"&vbcrlf
str=str&"<td><img src="""&rs1("mark_logo")&""">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"&rs1("mark")&"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="""&rs1("mark_url")&""" target=_blank>"&rs1("mark_url")&"</a></td>"&vbcrlf
str=str&"</tr>"&vbcrlf
   end if
   rs1.close
   set rs1=nothing
str=str&"<tr>"&vbcrlf
str=str&"<td><hr color=""#666666"" align=""center"" width=""96%"" size=""1""></td>"&vbcrlf
str=str&"</tr>"&vbcrlf
str=str&"</table>"&vbcrlf
show_hd=show_hd&str
rs.movenext
next
end if
rs.close
set rs=nothing
End Function

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

Function Show_wt()
Show_wt="<table width=""98%""  border=""0"" cellspacing=""0"" cellpadding=""0"">"&vbcrlf
Show_wt=Show_wt&"<tr>"&vbcrlf
Show_wt=Show_wt&"<td><font style=""font-size:14""><b>"&rs("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"">悬赏分："&rs("xsf")&"</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"">"&rs("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>"&rs("userid")&"&nbsp; - 头衔："&rs("usertx")&"&nbsp;&nbsp;&nbsp;</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=""input1""></td>"&vbcrlf
Show_wt=Show_wt&"  </tr></table>"&vbcrlf
End Function
%>
</body>
</html>
