<!--#include file="conn.asp"-->
<!--#include file="check.asp"-->
<!--#include file="../inc/setup.asp"-->
<!--#include file="../inc/char.asp"-->
<!--#include file="../inc/sql.asp"-->
<%
	end if
	action=ReplaceBadChar(Request("action"))
	id=int(ReplaceBadChar(Trim(Request.Form("j_id"))))
	
	if action="delete" then
	
		conn.Execute "delete from pk where id in("&id&") and cid="& ReplaceBadChar(Request.Cookies("admin_company_id")) &""
		conn.Execute "delete from pk_comment where pk_id in("&id&")"
		conn.Execute "delete from pk_comment_pk where pk_id in("&id&")"
		
		response.write"<SCRIPT language=JavaScript>alert('该思想对决论题删除成功，现在正为您返回，请稍等');"
		response.write"window.location.href = 'pk_list.asp'"&" </script>"
		response.end
		
	end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title><%= homename %></title>
<LINK href="images/css.css" type=text/css rel=stylesheet>
<style type="text/css">
<!--
.style16 {color: #000000; font-weight: bold; }
.style16 {color: #000000; font-size: 12px; font-weight: bold; }
.style17 {	font-size: 14px;
	color: #125A55;
}
.style7 {	color: #188DCC;
	font-weight: bold;
}
-->
</style>
<script language="JavaScript">
function checkBoxStatus() {
    var someBoxChecked=false;
      if (document.all.JID_BOX!=null) {
       if (document.all.JID_BOX.length==null) {
         if (document.all.JID_BOX.checked==true) {
          someBoxChecked=true;
        }
      } else {
        for (var i=0 ;i<document.all.JID_BOX.length;i++) {
          if (document.all.JID_BOX[i].checked==true){
            someBoxChecked=true;
            break;
          }
        }
      }
    }
     if (!someBoxChecked) {
      return false;
    } else {
      return true;
    }
  }

function deleteJobs() {
  if (!checkBoxStatus()) {
    alert("请选中至少一个已购买的服务！");
    return ;
  }
  document.zwgl.action.value='delete';
  if (confirm("是否确定要删除该已购买的服务？")) {
    document.zwgl.submit();
  }
}
function checkAll() {
  if (document.all.JID_BOX!=null) {
      if (document.all.JID_BOX.length==null) {
        document.all.JID_BOX.checked=document.all.CKALL.checked;
      } else {
        for (var i=0;i<document.all.JID_BOX.length;i++) {
          document.all.JID_BOX[i].checked=document.all.CKALL.checked;
        }
      }
  }
}
function cloneJob() {
if (!checkBoxStatus()) {
    alert("请选中至少一个已购买的服务！");
    return ;
  }
  var jidString="";
if (document.all.JID_BOX.length==null) {
  if (document.all.JID_BOX.checked==true) {
    jidString=document.all.JID_BOX.value;
  }
} else {
  for (var i=0 ;i<document.all.JID_BOX.length;i++) {
    if (document.all.JID_BOX[i].checked==true){
      if (jidString=="") {
        jidString=document.all.JID_BOX[i].value;
      } else {
        jidString=jidString+","+document.all.JID_BOX[i].value;;
      }
    }
  }
}
  if (jidString=="") {
    alert("请至少选择一份已购买的服务来克隆！");
    return ;
  }
  document.clonejobform.jidlist.value=jidString;
  document.clonejobform.submit();
}
</script>
</head>
<body>
<!--#include file="bottom.asp"-->
<TABLE width="99%" height="43" border=0 align=center cellPadding=0 cellSpacing=0>
<form name="zwgl" action="?" method=post>
<input type="hidden" name="action" value="">
  <TBODY>
    <TR>
      <td height=43 valign="top" scope=col>
          <table width="100%"  border="0" cellpadding="0" cellspacing="1" bgcolor="#D2E9FB">
            <tr>
              <th scope="col"><div align="left"><span class="style7"><span class="style16"><img src="images/main_folder.gif" width="12" height="10"><span class="style17">已发布的意见话题 </span></span></span></div></th>
            </tr>
            <tr>
              <td height="76" bgcolor="#FFFFFF">
			  <table width="100%" border="0" cellpadding="0" cellspacing="1">
<%
	admin_company_id=ReplaceBadChar(Request.Cookies("admin_company_id"))
	set rs_user = server.CreateObject("adodb.recordset")
	sql="select * from pk where cid="&admin_company_id&" order by id desc"
	rs_user.Open sql,conn,1,1
	if rs_user.eof and rs_user.bof then
%>
                <tr>
                  <td height="60" align="center"><strong><font color="#FF0000">您 尚 未 发 布 任 何 意 见 话 题</font></strong></td>
                </tr>
<% Else %>
				<tr>
                  <td height="48" align="center"><table width="100%" border="0">
                    <tr>
                      <td colspan="2" align="center" bgcolor="#D2E9FB">观点标题</td>
                      <td width="15%" align="center" bgcolor="#D2E9FB">话题描述</td>
                      <td width="16%" align="center" bgcolor="#D2E9FB">正方观点</td>
                      <td width="16%" align="center" bgcolor="#D2E9FB">反方观点</td>
                      <td width="12%" align="center" bgcolor="#D2E9FB">发布时间</td>
                      <td width="7%" align="center" bgcolor="#D2E9FB">浏览数</td>
                      <td width="9%" align="center" bgcolor="#D2E9FB">投票数(正/反)</td>
                      <td width="9%" align="center" bgcolor="#D2E9FB">状态</td>
                    </tr>
<%
	rs_user.PageSize = 5 '这里设定每页显示的记录数
	rs_user.CursorLocation = 3
	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
	for i=1 to rs_user.PageSize
	if rs_user.EOF or rs_user.BOF then exit for
%>
                    <tr>
                      <td width="3%"><input name="j_id" type="checkbox" ID="JID_BOX" value="<%=rs_user("id")%>"></td>
                      <td width="13%"><a href="/pk/pkview.asp?pk_id=<%= rs_user("id") %>" target="_blank" title="浏览详细信息?"><%=left(rs_user("title"),10)%><% If len(rs_user("title"))>10 Then Response.Write("...")%></a></td>
                      <td align="center"><%=left(rs_user("notice"),10)%><% If len(rs_user("notice"))>10 Then Response.Write("...")%></td>
                      <td align="center"><%=left(rs_user("F_point"),10)%><% If len(rs_user("F_point"))>10 Then Response.Write("...")%></td>
                      <td align="center"><%=left(rs_user("W_point"),10)%><% If len(rs_user("W_point"))>10 Then Response.Write("...")%></td>
                      <td align="center"><%=rs_user("stime")%></td>
                      <td align="center"><%=rs_user("hits")%></td>
                      <td align="center"><%=rs_user("F_comment_num")%>/<%=rs_user("W_comment_num")%></td>
                      <td align="center">
						<% if rs_user("zhuangtai")=0 then Response.Write("<font color=red><b>未审核</b></font>")%>
						<% if rs_user("zhuangtai")=1 then Response.Write("<font color=red><b>已审核</b></font>")%>
					| <a href="pk.asp?id=<%= rs_user("id") %>&action=edit" title="修改?">修改</a></td>
                    </tr>
<%
	rs_user.movenext
	next
	End If
%>
 			<tr>
            <td align="right" colspan="5"><img src="images/button_15.gif" width="46" height="20" style="cursor:hand" onClick="deleteJobs()"></td>
            <td align="right" colspan="4"><input type="checkbox" ID="CKALL" name="checkallbox" onClick="checkAll()" value="checkbox">
              选中所有服务</td>
 			</tr>
                  </table>
<table width="99%" 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">首页</a>|
<%if pre then%>
<a href="?page=<%=intpage -1%>">上页</a>| <%end if%>
<%if last then%>
<a href="?page=<%=intpage +1%>">下页</a> |<%end if%>
<a href="?page=<%=rs_user.PageCount%>">尾页</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%>" selected><%=i%></option>
<%else%> 
<option value="?page=<%=i%>"><%=i%></option>
<%
	end if
	next
	rs_user.close
	set rs_user = nothing
	conn.close
	set conn = nothing
%>
</select>页</font>
</td>
</tr>
</table>
	 </td>
         </tr>
             </table>
			  </td>
            </tr>
          </table>
      </td>
    </tr>
</form>
</table>
</body>
</html>

