<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<link type="text/css" rel="stylesheet" href="../Css/style.css" />
<script language="javascript" type="text/javascript" src="../jQuery/lib/jquery.js"></script>
<script language="javascript" type="text/javascript" src="../js/WebSite.js"></script>
<script language="javascript" type="text/javascript" src="../js/ChkForm.js"></script>
<script language="JavaScript" type="text/javascript" src="../js/Calendar.js"></script>
</head>
<!--#include file="../inc/conn.asp"-->
<!--#include file="../inc/Function.asp"-->
<!--#include file="../../inc/Config.asp"-->
<body>
<%
Call ChkLogin(session("WebAdminsUserName"))
Call ConnectionDataBase(2)

id = Request.QueryString("id")
Call ChkIsNumber(id,"参数类型错误!")
IF id>0 Then
	Sql = "SELECT TOP 1 * FROM T_Ask WHERE ID=" & id
	SetRs Rs,Sql,conn,1,1
	IF Not Rs.EOF Then
		UserID = Rs("UserID")	
		ClassID = Rs("ClassID")	
		Title = Rs("Title")		
		Content = Rs("Content")
		iCount = Rs("iCount")
		IsOver = Rs("IsOver")		
		AddTime	 = Rs("AddTime")	
		
		Sql="Select UserName From T_Users Where ID=" & UserID
		SetRs Rs1,Sql,conn,1,1
		IF Not Rs1.Eof Then UserName=Rs1("UserName")
		DisRs Rs1
		Sql="Select ClassName From T_Class Where ID=" & ClassID
		SetRs Rs1,Sql,conn,1,1
		IF Not Rs1.Eof Then ClassName=Rs1("ClassName")
		DisRs Rs1
	End IF
	DisRs Rs
End IF
%>

<table width="100%" border="0" cellspacing="0" cellpadding="0">  
  <tr>
    <td width="10%" align="right">提问主题：</td>
    <td width="36%" align="left"><%=Title%>&nbsp;<%Response.Write "<font color='#ff0000'>["&iCount&"]</font>"%> &nbsp;<%IF IsOver Then Response.Write "<font color='#ff0000'>[结束]</font>"%></td>
    <td width="9%" align="center">所属类别：</td>
    <td width="45%" align="left"><%=ClassName%></td>
  </tr>
  <tr>
    <td width="10%" align="right">提问人：</td>
    <td align="left"><%=UserName%></td>
    <td align="center">发布时间：</td>
    <td align="left"><%=AddTime%></td>
  </tr>
  <tr>
    <td width="10%" align="right">详细描述：</td>
    <td colspan="3" align="left"><%=Content%></td>
  </tr>
  <tr>
    <td align="right">&nbsp;</td>
    <td colspan="3" align="left"><a href="javascript:window.history.back()">返回上一页</a></td>
  </tr>  
</table>
<form action="Delete.asp" method="post" name="frm" onsubmit="return Confirm('确定要删除所选记录吗?删除后,将无法恢复')">
<input type="hidden" name="Action" value="DelAnswer">
<%
Sql = "SELECT * FROM T_Answer WHERE AskID="&id&" and Recycle=0 ORDER BY Good Asc,AddTime DESC"
SetRs Rs,Sql,conn,1,1
IF Rs.eof And Rs.bof Then
Else
	n=0
	Rs.pagesize=10
	IF Not isempty(request("page")) And isnumeric(request("page")) Then 				  
		p=cint(request("page"))   
		IF p>Rs.pagecount Then p=Rs.pagecount
	Else   
		p=1
	End IF             
	Rs.AbsolutePage=p
	do while not Rs.eof	
	strsql="Select UserName from t_users where id="&Rs("UserID")
	SetRs Rs1,strsql,conn,1,1
	IF Not Rs1.Eof Then UserName=Rs1("UserName")
	DisRs Rs1
%>
<table width="100%" border="0" cellspacing="0" cellpadding="0" style="margin-top:20px">  
  <tr>
    <th width="10%" align="right"><input name="ChkBox" type="checkbox" value="<%=Rs("ID")%>" />回贴人：</th>
    <th width="36%" align="left"><%=UserName%>&nbsp;<%IF Rs("Good") Then Response.Write "<font color='#ff0000'>[最佳答案]</font>"%></th>
    <th width="9%" align="center">回帖时间：</th>
    <th width="45%" align="left"><%=Rs("AddTime")%></th>
  </tr>  
  <tr>
    <td width="10%" align="right">回复内容：</td>
    <td colspan="3" align="left"><%=Rs("Content")%></td>
  </tr>
</table>
<%  
	n=n+1     
	Rs.movenext
	IF n>=Rs.pagesize Then Exit Do
	Loop
End IF
%>
<table width="100%" border="0" cellspacing="0" cellpadding="0">  
  <tr>
    <th align="left" class="FontWeight"><input type="submit" name="submit" value="删除" class="btn" />
      <input name="Input" type="checkbox" value="" style="margin-left:10px" onclick="CheckAll(this.checked);"/> 全选/反选
	  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <%	
	Call showpage(Rs.pagesize,Rs.recordcount,p,Rs.pagecount,"&id=" & id)
	DisRs Rs
	Call CloseDataBase
	%>	</th>   
	</tr>
</table>
</form>
</body>
</html>
