<html xmlns="http://www.w3.org/1999/xhtml">
<!--#include file="../Inc/Conn.asp" -->
<!--#include file="../Inc/SK.Session.asp" -->
<!--#include file="../Inc/SK.Funtion.asp" -->
<%if Not (getconfig("SK_Office")="0" AND (Session("Manager")="1" OR (JudgePopedomTF(Session("UserName"),"SK100000000") AND JudgePopedomTF(Session("UserName"),"SK100000100")))) then Call ReturnError()%>
<%
if Not isnumeric(JCID(F("ID"))) then Call ReturnError10()
set rs=server.createobject("adodb.recordset")
sql="SELECT * from SK_OfficeForum where SK_Del=0 and ForumID="&JCID(F("ID"))&""
rs.Open sql,conn,1,3
if rs.eof and rs.bof then Call ReturnError4()
conn.execute(sql)
rs("SK_Click")=rs("SK_Click") + 1
rs.Update

'Delete begin
if RQ("Action")="DelTitle" and F("ID")<>"" then
if Session("Manager")="1" then
conn.execute("delete from SK_OfficeForum where ForumID="&JCID(F("ID"))&"")
conn.execute("delete from SK_OfficeForumReply where SK_ForumID="&F("ID")&"")
else
conn.execute("delete from SK_OfficeForum where SK_SalesID="&Session("UID")&" and ForumID="&JCID(F("ID"))&"")
conn.execute("delete from SK_OfficeForumReply where SK_ForumID="&F("ID")&"")
end if
'Event Begin
if getconfig("SK_Event")=0 then
set rsEvent=server.createobject("adodb.recordset")
sqlEvent="select * from SK_SystemEvent"
rsEvent.open sqlEvent,conn,1,3
rsEvent.AddNew
rsEvent("SK_Title")="删除帖子主题"
rsEvent("SK_User")=Session("UserName")
rsEvent("SK_Time")=Now()
rsEvent("SK_IP")=request.ServerVariables("Remote_Addr")
rsEvent.Update
rsEvent.Close 
set rsEvent=Nothing
end if
'Event End
Call Returnokclose()
end if

if RQ("Action")="DelRe" and F("RID")<>"" then
conn.execute("delete from SK_OfficeForumReply where ReForumID="&JCID(F("RID"))&"")
'Event Begin
if getconfig("SK_Event")=0 then
set rsEvent=server.createobject("adodb.recordset")
sqlEvent="select * from SK_SystemEvent"
rsEvent.open sqlEvent,conn,1,3
rsEvent.AddNew
rsEvent("SK_Title")="删除回复内容"
rsEvent("SK_User")=Session("UserName")
rsEvent("SK_Time")=Now()
rsEvent("SK_IP")=request.ServerVariables("Remote_Addr")
rsEvent.Update
rsEvent.Close 
set rsEvent=Nothing
end if
'Event End
Call Returnokback()
end if
'Delete end

if RQ("Action")="Send" and F("ID")<>"" and F("S_Content")<>"" and (Session("Manager")="1" OR JudgePopedomTF(Session("UserName"),"SK100000104")) then
'--------------------------------------------------------                                  
set rs=server.createobject("adodb.recordset")
sql="select * from SK_OfficeForumReply"
rs.open sql,conn,1,3                                                          
rs.AddNew
rs("SK_ForumID")=NoCSSHackInput(F("ID"))
rs("SK_Content")=NoCSSHackContent(F("S_Content"))
rs("SK_SalesID")=Session("UID")
rs("SK_Addor")=Session("Oname")
rs("SK_ATime")=Now()
rs("SK_Del")="0"
rs("SK_IP")=request.ServerVariables("Remote_Addr")
rs.Update
rs.Close 
set rs=Nothing
'Event Begin
if getconfig("SK_Event")=0 then
set rsEvent=server.createobject("adodb.recordset")
sqlEvent="select * from SK_SystemEvent"
rsEvent.open sqlEvent,conn,1,3
rsEvent.AddNew
rsEvent("SK_Title")="回复帖子："&F("S_Title")&""
rsEvent("SK_User")=Session("UserName")
rsEvent("SK_Time")=Now()
rsEvent("SK_IP")=request.ServerVariables("Remote_Addr")
rsEvent.Update
rsEvent.Close 
set rsEvent=Nothing
end if
'Event End
Response.Write("<script LANGUAGE='javascript'>alert('恭喜你,回复成功！');history.go(-1);</script>")
Response.End
end if
%>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GB2312" />
<title><%=Rs("SK_Title")%></title>
<META http-equiv=Page-Enter content=SKCRM>
<META http-equiv=Page-Exit content=SKCRM>
<META content="MSHTML 6.00.3790.2858" name=GENERATOR>
<LINK href="../images/style.css" type=text/css rel=stylesheet>
<script language="javascript" src="../Inc/Check.js"></script>
<script language="javascript" src="../Inc/Calendar.js"></script>
<script language="javascript" src="../Inc/jquery.js"></script>
<style type="text/css">
<!--
body {
margin: 5px 0px 5px 0px;
overflow-x: hidden;
}
-->
</style>
</head>
<body>
<table width="99%" border="0" align="center" cellpadding="0" cellspacing="0">
<TBODY>
<tr>
<td class="SK_Td_Top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="12" height="25"><img src="../images/tab_03.gif" width="12" height="25" /></td>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="46%" valign="middle">阅读帖子</td>
<td width="54%"></td>
</tr>
</table></td>
<td width="16"><img src="../images/tab_07.gif" width="16" height="25" /></td>
</tr>
</table></td>
</tr>
<tr>
<td>

<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="8" background="../images/tab_12.gif"></td>
<td>

<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="b5d6e6">
<tr>
  <td width="19%" class="SK_Title">&nbsp;</td>
  <td width="81%" class="SK_Title1">
  <table width="99%" border="0" cellspacing="2" cellpadding="2">
  <tr>
    <td align="left">主题：<b><%=Rs("SK_Title")%></b> <%
set RsClass=server.createobject("adodb.recordset")
SqlClass="select * from SK_SystemCategory where SK_Di=1 and CategoryID="&RS("SK_Di")&""
RsClass.open SqlClass,conn,1,1
%>
<font color="#999999">(<%=RsClass("SK_Name")%>)</font>
<%
RsClass.close
RsClass=Nothing
%></td>
    </tr>
</table></td>
</tr>

<tr>
  <td rowspan="2" valign="top" class="SK_Text">
<!--楼主信息开始-->
<%
set RsFuser=server.createobject("adodb.recordset")
SqlFuser="select * from SK_SystemUsers where UsersID="&Rs("SK_SalesID")&""
RsFuser.open SqlFuser,conn,1,1
%>
<table width="99%" border="0" align="center" cellpadding="5" cellspacing="2">
<tr>
<td class="SK_Text"><%if RsFuser("SK_Photo")<>"" then%><img src="../UpFiles/<%=RsFuser("SK_Photo")%>" width="100" height="100" title="个性签名：<%=RsFuser("SK_Maxim")%>"><%else%><img src="../images/nopic.jpg" width="100" height="100" title="个性签名：<%=RsFuser("SK_Maxim")%>">
<%end if%>
  </td>
</tr>
<tr>
<td class="SK_Text"><%=RsFuser("SK_Oname")%></td>
</tr>
<tr>
  <td class="SK_Text">楼主</td>
</tr>
</table>
<%
RsFuser.close
RsFuser=Nothing
%>
<!--楼主信息结束--></td>
<td valign="top" class="SK_BBSContent"><%=Rs("SK_Content")%></td>
</tr>

<tr>
  <td valign="top" class="SK_Text2"><font color=red>发帖时间：<%=Rs("SK_Atime")%>  <%if Rs("SK_Etime")<>"" then%> | 更新时间：<%=Rs("SK_Etime")%><%end if%></font> <%if (Session("UID")=Rs("SK_SalesID") AND JudgePopedomTF(Session("UserName"),"SK100000102")) OR Session("Manager")="1" then%>| <a href="javascript:void(0)" onClick="javascript:var win=window.open('SK.ModBBS.asp?id=<%=Rs("ForumID")%>','Mod','width=820,height=400,top=170,left=161,center:yes,status:no,help:no,toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=yes,scrollbars=yes'); win.focus()">修改</a><%end if%><%if (Session("UID")=Rs("SK_SalesID") AND JudgePopedomTF(Session("UserName"),"SK100000103")) OR Session("Manager")="1" then%>| <a onClick="return confirm('删除主题将连同删除回复，是否继续吗？')" href="?Action=DelTitle&ID=<%=Rs("ForumID")%>">删除</a><%end if%></td>
</tr>

<!--回帖列表开始-->
<%
Dim RsHF,i
set rsHF=Server.createobject("adodb.recordset")
sqlHF="select * from SK_OfficeForumReply where SK_ForumID="&Rs("ForumID")&" order by ReForumID asc"
rsHF.open sqlHF,conn,1,1
%>
<%
i=0
while not rsHF.eof
i=i+1
%>
<tr>
  <td rowspan="2" valign="top" class="SK_Text">
<!--回帖者信息开始-->
<%
set RsRen=server.createobject("adodb.recordset")
SqlRen="select * from SK_SystemUsers where UsersID="&RsHF("SK_SalesID")&""
RsRen.open SqlRen,conn,1,1
%>
<table width="99%" border="0" align="center" cellpadding="5" cellspacing="2">
<tr>
<td class="SK_Text"><%if RsRen("SK_Photo")<>"" then%><img src="../UpFiles/<%=RsRen("SK_Photo")%>" width="100" height="100" title="个性签名：<%=RsRen("SK_Maxim")%>">
  <%else%><img src="../images/nopic.jpg" width="100" height="100" title="个性签名：<%=RsRen("SK_Maxim")%>">
  <%end if%></td>
</tr>
<tr>
<td class="SK_Text"><%=RsRen("SK_Oname")%></td>
</tr>
<tr>
  <td class="SK_Text">第 <%=i%> 楼</td>
</tr>
</table>
<%
RsRen.close
set RsRen=Nothing
%>
<!--回帖者信息结束-->
</td>
<td valign="top" class="SK_BBSContent"><%=RsHF("SK_Content")%></td>
</tr>
<tr>
  <td valign="top" class="SK_Text2"><font color=red>回帖时间：<%=RsHF("SK_Atime")%> <%if RsHF("SK_Etime")<>"" then%> | 更新时间：<%=RsHF("SK_Etime")%><%end if%></font> <%if (Session("UID")=RsHF("SK_SalesID")) and (Session("Manager")="1" OR JudgePopedomTF(Session("UserName"),"SK100000102")) then%>| <a href="javascript:void(0)" onClick="javascript:var win=window.open('SK.ModReBBS.asp?id=<%=RsHF("ReForumID")%>','Mod','width=820,height=400,top=170,left=161,center:yes,status:no,help:no,toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=yes,scrollbars=yes'); win.focus()">修改</a><%end if%> <%if (Session("UID")=RsHF("SK_SalesID")) and (Session("Manager")="1" OR JudgePopedomTF(Session("UserName"),"SK100000103")) then%>| <a onClick="return confirm('删除回复内容，是否继续吗？')" href="?Action=DelRe&ID=<%=Rs("ForumID")%>&RID=<%=RsHF("ReForumID")%>">删除</a><%end if%></td>
</tr>
<%
rsHF.movenext
wend
rsHF.close
set rsHF=Nothing
%> 
<!--回帖列表结束-->
<%if Session("Manager")="1" OR JudgePopedomTF(Session("UserName"),"SK100000104") then%>
<form name="thisForm" id="form1" method="post" action="?Action=Send"> 
<tr>
  <td colspan="2" class="SK_Title1">回复主题</td>
  </tr>
<tr>
  <td valign="top" class="SK_Text2">快速回复：</td>
  <td valign="top" class="SK_BBSContent"><IFRAME ID="eWebEditor1" SRC="<%=getconfig("SK_EditorPath")%>/ewebeditor.htm?id=S_Content&style=mini" FRAMEBORDER="0" SCROLLING="no" WIDTH="600" HEIGHT="300"></IFRAME>
<input type="hidden" name="S_Content">
<input type="hidden" name="ID" value="<%=Rs("ForumID")%>">
<input type="hidden" name="S_Title" value="<%=Rs("SK_Title")%>">
<br>
<INPUT class="button1" type="submit" value=" 回帖 "></td>
</tr>
</form>
<%end if%>
<tr>
<td colspan="2" class="SK_Text">
<input type="button" value=" 关闭 " onClick="window.opener.location.reload();window.close();" class="button1" /></td>
</tr>
</table>

</td>
<td width="8" background="../images/tab_15.gif"></td>
</tr>
</table></td>
</tr>
<tr>
<td class="SK_Td_Foot">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="1%" height="20"><img src="../images/tab_18.gif" width="12" height="20" /></td>
<td width="98%" class="SK_Td_Page"></td>
<td width="1%"><img src="../images/tab_20.gif" width="16" height="20" /></td>
</tr>
</table>

</td>
</tr>
</TBODY>
</table>
</body>
<%
Call CloseDB()
%>
</html>