<!--#INCLUDE FILE="../HXINCLUDE/HXINCLUDEHEAD.ASP"-->
<%if WS_S.MemberPriv("WS_SystemSetDepartment")<>1 then HX_GoBack "对不起,您的权限不够!",""
ColumnName="":Tablename="HX_Talkear":style=request("style"):keywords=request("keywords"):Orderby=" where WS_TalkEarSubjectId=0"
if style<>"" then msg="对不起,没有搜索到你要找内容!" else  msg="暂 无 数 据!" 
select case style
case "title" Orderby=Orderby&" and WS_TalkEarSubject like '%"&keywords&"%'"
case "content"  Orderby=Orderby&" and WS_TalkEarcontent like '%"&keywords&"%'"
case "name"  Orderby=Orderby&" and WS_TalkEarName like '%"&keywords&"%'"
end select	
Orderby=Orderby&" ORDER BY WS_TalkEarSendTime DESC"
action=request("action"):WS_TAid=request("WS_TAid")
if action="talkdel" then
if WS_TAid<>"" and isnumeric(WS_TAid) then conn.execute("delete from HX_TalkEar where WS_TAid="&WS_TAid&" or WS_TalkEarSubjectId="&WS_TAid)
response.redirect "hxtalkear.asp":response.end
end if
set rs=WS_S.HX_SetRSD(ColumnName,Tablename,Orderby)
response.write "<head><meta http-equiv='Content-Type' content='text/html; charset=gb2312'><title></title><link rel=stylesheet type=text/css href='../HXinclude/HX_Style.css'><script src='../hxinclude/hx_function.js'></script></head><body topmargin='20' leftmargin='0' bottommargin='0'><table width='800'  border='0' cellspacing='1' cellpadding='0' align=center bgcolor='#613c25'><tr><td colspan='2' bgcolor=FFFBE8 background='../HXIMAGES/titlelinebg.gif'><table width='595'  border='0' cellspacing='0' cellpadding='0'><tr><td height='25' background='../hximages/titleline.gif'><font class='fontmenu'>讨论区</font></td></tr></table><table width='100%'  border='0' cellspacing='1' cellpadding='0' bgcolor=FFFBE8><tr bgcolor='#FFFBE8'><td><TABLE border=0 cellPadding=1 cellSpacing=1 width='100%' bgcolor=BF9B73><TR><TD height='21' colspan='7'><TABLE border=0 cellPadding=2 cellSpacing=0 width='100%'><TR><FORM action='' method='post' name=form1><TD width=18% align='center'><SELECT name=style><OPTION selected value=title>按标题查询</OPTION><OPTION alue=content>按内容查询</OPTION><OPTION value=name>按作者查询</OPTION></SELECT></TD><TD width=34% align='center'><input name=keywords size=30></TD><TD width=37% ><input type='submit' name='Submit' value=' 查 询 '></TD><TD width=11% align=center><input type='button' name='Submit2' value='发表新帖' onclick=""openwin(620,438,'addtalkear.asp');""></TD></FORM></TR></TABLE></TD></TR><TR bgColor=#FFFBE8><TD width='236' height='30' bgColor=#FFFBE8><div align='center'>标 题</div></TD><TD width='70' bgColor=#FFFBE8><div align='center'>所属部门</div></TD><TD width=87><div align='center'>作 者</div></TD><TD align=middle><div align='center'>回复/人气</div></TD><TD width='135' align=middle><div align='center'>最后更新时间</div></TD><TD width='71' align=middle><div align='center'>最后回复</div></TD><TD width=95><div align='center'>删 除</div></TD></TR>"
if rs.recordcount<=0 then
response.write "<TR bgColor=#FFFBE8><td colspan=7 height=25 align=center><font color=red>"&msg&"</font></td></tr>"
else
rs.PageSize =15 '每页记录条数
iCount=rs.RecordCount '记录总数
iPageSize=rs.PageSize
maxpage=rs.PageCount 
page=request("page")
if Not IsNumeric(page) or page="" then
   page=1
else
   page=cint(page)
end if
if page<1 then
   page=1
elseif  page>maxpage then
   page=maxpage
end if
rs.AbsolutePage=Page
if page=maxpage then
x=iCount-(maxpage-1)*iPageSize
else
x=iPageSize
end if
i=0
do while not rs.EOF	 
response.Write "<tr "
if i mod 2 =0 then response.write "bgcolor=#FFFBE8" else response.write "bgcolor=#FFFBE8" 
response.Write " onmouseover=javascript:this.bgColor='#F9F8F2' onmouseout=javascript:this.bgColor='#FFFBE8'><TD height='25'><IMG src='../HXIMAGES/talkear/"&rs("WS_TalkEarPic")&"' align='absmiddle'><a href='javascript:' onClick=""openwin(620,420,'readtalker.asp?SubjectId="&rs("WS_TAID")&"');"">"&rs("WS_TalkEarSubject")&"</A></TD><TD height='25'><div align='center'>"
if rs("WS_TalkEarMan")=0 then  response.write "全体" else  response.write WS_S.HX_OutDepartment(rs("WS_TalkEarMan"))
response.write "</div></TD><TD width=87 align=center><a href='../HXManpowerResource/userinfolook.asp?WS_ViewUserName="&rs("WS_TalkEarname")&"'>"&rs("WS_TalkEarname")&"</a></TD><TD width=80 align=center>"
set rers=WS_S.HX_SetRSD(ColumnName,"HX_Talkear"," where WS_TalkEarSubjectId="&rs("WS_TAID")):response.Write rers.recordcount&"/"&rs("WS_TalkEarKnock"):if rers.recordcount>0 then WS_ViewUserName=rers("WS_TalkEarname") else WS_ViewUserName="" end if:WS_S.HX_RSClose rers
response.write "</TD><TD align=center>"&rs("WS_TalkEarSendTime")&"</TD><TD align=center><div align='center'><a href='../HXManpowerResource/userinfolook.asp?WS_ViewUserName="&WS_ViewUserName&"'>"&WS_ViewUserName&"</a></div></TD><TD align='center'><input name='deltalk' type='button' value='删 除' onclick=""if(!confirm('您确认删除此话题及此话题下的回复吗！')) return false; else location.href='?action=talkdel&WS_TAid="&rs("WS_TAid")&"';""></TD></TR>"   	
i=i+1
if i>=rs.PageSize then Exit Do
rs.movenext
loop
call WS_S.PageControl(iCount,maxpage,page,"border=0 align=right","<p align=right>",7)
end if
 WS_S.HX_RSClose rs	  
response.write "</TABLE></td></tr></table></td></tr></table>"%>
