<!--#include file="conn.asp"-->
<!--#include file="check.asp"-->
<%
	useflag=1
%>
<!--#include file="flag.asp"-->
<!--#include file="../inc/setup.asp"-->
<!--#include file="../inc/sql.asp"-->
<%
	end if
	action=Trim(Request.QueryString("action"))
	if action="sh" then
		id=Trim(Request.QueryString("id"))
		conn.Execute ("update pk_comment set zhuangtai=1 where id="&id&"")
		response.write"<SCRIPT language=JavaScript>alert('论题观点审核成功，现在为您返回！');"
		response.write"this.location.href='gd_list.asp';</SCRIPT>"
		response.end
	end if
	if action="nosh" then
		id=Trim(Request.QueryString("id"))
		conn.Execute ("update pk_comment set zhuangtai=0 where id="&id&"")
		response.write"<SCRIPT language=JavaScript>alert('论题观点取消审核成功，现在为您返回！');"
		response.write"this.location.href='gd_list.asp';</SCRIPT>"
		response.end
	end if
	
	if action="nosh" then
		id=Trim(Request.QueryString("id"))
		conn.Execute ("delete from pk_comment where id="&id&"")
		response.write"<SCRIPT language=JavaScript>alert('论题观点删除成功，现在为您返回！');"
		response.write"this.location.href='gd_list.asp';</SCRIPT>"
		response.end
	end if
%>
<script src='Include/Common.js'></script>
<link href='Include/Admin_Style.CSS' rel='stylesheet' type='text/css'>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="sortbutton">
<tr>    
<td width="17%" height="23" align="center" valign="middle">Pk台观点管理
<td align="center" valign="middle"><table width="100%" border="0">
<form name="form2" method="get">
<input name="action" type="hidden" value="search" />
        <tr>
          <td width="22%">
		  <Input maxLength=30 name="uname" value="企业名称" onMouseOver="if(this.value=='企业名称'){this.value=''}" title="企业名称"></td>
          <td width="78%"><input class="button" type="submit" value="提交条件"></td>
          </tr>
		</form>
</table>
</tr>
</table>
<table width="100%" style="MARGIN-TOP: 3px" border="0" align="center" cellspacing="1" cellpadding="1"  class="Border">
<tr height="25" align="center" class='title'>
	<td width="4%" nowrap>编号</td>
	<td width="13%" nowrap>话题标题</td>
	<td width="13%" nowrap>观点主题</td>
	<td width="15%" nowrap>立场</td>
	<td width="16%" nowrap>昵称</td>
	<td width="17%" nowrap>观点</td>
	<td width="12%" nowrap>发布时间</td>
	<td width="10%" nowrap>状态</td>
</tr>
<%
	searchtype=" where pk_comment.PK_id=pk.id "
	
	if Trim(Request("action"))="search" then
	
		uname=Trim(Request("uname"))
		
		if uname<>"企业名称" and uname&"a"<>"a" then searchtype=searchtype&" and pk_comment.title like '%"&uname&"%' "
	
	end if

	dim i,intPage,page,pre,last,filepath'定义变量
	set rs_user = server.CreateObject("adodb.recordset")'创建对象
	sql="select pk_comment.*,pk.title ptitle from pk_comment,pk "&searchtype&" order by pk_comment.zhuangtai asc,pk_comment.id desc"
	'sql="select * from pk order by id desc"
	rs_user.PageSize = 13 '这里设定每页显示的记录数
	rs_user.CursorLocation = 3
	rs_user.Open sql,conn,0,2,1 '这里执行你查询SQL并获得结果记录集
	pre = true
	last = true
	page = trim(Request.QueryString("page"))'变量是跳转页面时的值

	if len(page) = 0 then
		intpage = 1
		pre = false
	else
		if cint(page) =< 1 then
			intpage = 1
			pre = false
		else
			if cint(page) >= rs_user.PageCount then
				intpage = rs_user.PageCount
				last = false
			else
				intpage = cint(page)
			end if
		end if
	end if
	if not rs_user.eof then
		rs_user.AbsolutePage = intpage
	end if
	if rs_user.eof then
		response.Write "<tr><td colspan=9><div align=center><font size=3 color=red><b>暂时还没有思想对决的观点，请查询后再重试</b></font></div></tr></td>"
		response.End
	else
		for i=1 to rs_user.PageSize
		if rs_user.EOF or rs_user.BOF then exit for
%>
<tr height="25" align=center class='tdbg' onMouseOver="this.className='tdbgmouseover'" onMouseOut="this.className='tdbg'">
	<td><%= rs_user("id") %></td>
	<td><a href="/pk/pkview.asp?pk_id=<%= rs_user("PK_id") %>" target="_blank" title="浏览详细信息?"><%=left(rs_user("ptitle"),10)%><% If len(rs_user("ptitle"))>10 Then Response.Write("...")%></a></td>
	<td><a href="JavaScript:alert('观点标题:<%= rs_user("title") %>')"><%=left(rs_user("title"),10)%><% If len(rs_user("title"))>10 Then Response.Write("...")%></a></td>
	<td><% if rs_user("point")=0 then Response.Write("正方") else Response.Write("反方") %></td>
	<td><%=left(rs_user("uname"),10)%><% If len(rs_user("uname"))>10 Then Response.Write("...")%></td>
	<td><a href="JavaScript:alert('观点内容:<%= rs_user("point_note") %>')"><%=left(rs_user("point_note"),10)%><% If len(rs_user("point_note"))>10 Then Response.Write("...")%></a></td>
	<td align="center"><%= rs_user("stime") %></td>
	<td><% if rs_user("zhuangtai")=0 then Response.Write("<a href='?action=sh&id="&rs_user("id")&"'><font color=red><b>未审核</b></font></a>")%>
      <% if rs_user("zhuangtai")=1 then Response.Write("<a href='?action=nosh&id="&rs_user("id")&"'>已审核")%> || <a href="?action=del&id=<%= rs_user("id") %>" onclick='{if(confirm("删除后将无法恢复，您真的要删除么？")){return true;}return false;}'>删除</a></td>
</tr>
<%
	rs_user.movenext
	next
	End If
%>
<tr>
<td colspan=8><table width="100%" border="0" align="center" cellpadding="2" cellspacing="2" bordercolorlight="#808080" bordercolordark="#ffffff">
  <tr>
    <%if rs_user.pagecount > 0 then%>
    <td width="13%" align="left">当前页<%=intpage%>/<%=rs_user.PageCount%></td>
    <%else%>
    <td width="41%" align="left">当前页0/0</td>
    <%end if%>
    <td width="46%" align="right"><a href="?page=1&amp;action=<%= Trim(Request.QueryString("action")) %>&amp;uname=<%= Trim(Request.QueryString("uname")) %>">首页</a>|
      <%if pre then%>
        <a href="?page=<%=intpage -1%>&amp;action=<%= Trim(Request.QueryString("action")) %>&amp;uname=<%= Trim(Request.QueryString("uname")) %>">上页</a>|
      <%end if%>
        <%if last then%>
        <a href="?page=<%=intpage +1%>&amp;action=<%= Trim(Request.QueryString("action")) %>&amp;uname=<%= Trim(Request.QueryString("uname")) %>">下页</a> |
      <%end if%>
        <a href="?page=<%=rs_user.PageCount%>&amp;action=<%= Trim(Request.QueryString("action")) %>&amp;uname=<%= Trim(Request.QueryString("uname")) %>">尾页</a>|转到第
      <select name="sel_page" onchange="javascript:location.href=this.options[this.selectedIndex].value">
          <%
	for i = 1 to rs_user.PageCount
	if i = intpage then
%>
          <option value="?page=<%=i%>&amp;action=<%= Trim(Request.QueryString("action")) %>&amp;uname=<%= Trim(Request.QueryString("uname")) %>" selected="selected"><%=i%></option>
          <%else%>
          <option value="?page=<%=i%>&amp;action=<%= Trim(Request.QueryString("action")) %>&amp;uname=<%= Trim(Request.QueryString("uname")) %>"><%=i%></option>
<%
	end if
	next
	rs_user.close
	set rs_user=nothing
	conn.close
	set conn=nothing
%>
        </select>
      页</font></td>
  </tr>
</table></td>
</tr>
<tr>
	<td  class='tdbg' onMouseOver="this.className='tdbgmouseover'" onMouseOut="this.className='tdbg'" colspan=9 align=right>	</td>
</tr>
</table>

