<!--#include file="conn.asp"-->
<!--#include file="inc/const.asp"-->
<!--#include file="inc/plus_check.asp"-->
<%
'================================
'当前版本号：1.0
'程序作者：(21EClub)Andy
'21EClub网聚人 版权所有
'请尊重作者劳动成果，保留版权信息
'QQ:86093788 Http://Www.51Ent.Com
'================================
Dv_Plus.Name = "EC_Plus_Argue"
Dvbbs.stats = "论题列表"
Dvbbs.LoadTemplates("")
Dvbbs.nav()
	Dvbbs.Head_var 0,0,Dv_Plus.Plus_Name,"EC_Argue_Index.asp"
%>
<!--#include file="EC_Argue_Const.asp"-->
<%
		Argue_Nav_Link() '页面顶部导航栏
	Dim EB_Rs,EB_SQL,EB_ClassSQL
	Dim EB_ClassID,EB_ClassName,EB_ArgueVotes
	Dim EB_ListNum,EB_PageCount,EB_ArgueCount,EB_Page,EB_ThisNum,EB_PageI,EB_Action,EB_SearchTitle
	Dim EB_ArgueList,EB_PageList
		EB_ListNum = 8   '每页显示的论题数量
		EB_ClassID = Replace(Request("ArgueClassID"),"'","''")
		EB_Action = Request("Act")
			If EB_Action = 1 Then
				EB_SearchTitle = Replace(Request("Title"),"'","''")
					If EB_SearchTitle = "" Then ShowErr(18)
			End if
		
			If Request.Querystring("Page")="" Then
				EB_Page=1
			Else
				EB_Page=Cint(Request.Querystring("Page"))
			End if
		'论题列表
			If EB_ClassID <> "" Then
				EB_ClassSQL = "And Argue_Class = "&EB_ClassID
			Elseif EB_Action = 1 Then
				EB_ClassSQL = "And Argue_Title like '%"&Trim(Request.Form("Title"))&"%'"
			End if
		EB_ArgueList = ""
Set EB_Rs=Server.CreateObject("ADODB.Recordset")
    EB_Rs.PageSize = EB_ListNum
    EB_Rs.CacheSize = EB_ListNum
	    	 EB_SQL = "Select ArgueID,Argue_Title,Argue_Class,Argue_Votes,Argue_Hits,UserName,Appear_Date,Argue_Days From EC_ArgueTopic Where Argue_Open = 1 "&EB_ClassSQL&" Order By ArgueID desc"
    EB_Rs.Open EB_SQL,ArgueConn,1,1
	EB_PageCount = EB_Rs.PageCount
	EB_ArgueCount = EB_Rs.RecordCount
			If EB_Page > EB_PageCount Then EB_Page = EB_PageCount
			If EB_Page < 1 Then EB_Page = 1
 if EB_PageCount=0 then
	EB_ArgueList = EB_ArgueList&"Sorry！暂无任何论题！"        '没有任何数据时显示的内容
 Else
	EB_Rs.AbsolutePage = EB_Page
	EB_ThisNum = 0
Do While EB_ThisNum < EB_ListNum And NOT EB_Rs.EOF
	EB_ThisNum = EB_ThisNum + 1
	EB_ArgueVotes = Split(EB_Rs("Argue_Votes"),"|")     'EB_ArgueVotes(0)=正方票数,EB_ArgueVotes(1)=反方票数

		EB_ArgueList = EB_ArgueList&"<table width=""100%""><TR>"
		EB_ArgueList = EB_ArgueList&"<TD colSpan=""3"" height=21 bgcolor=""#F2F2F2"">"
		EB_ArgueList = EB_ArgueList&"<STRONG><FONT color=#666666>论题：</FONT></STRONG>"
		EB_ArgueList = EB_ArgueList&"<a href='EC_DispArgue.asp?ArgueID="&EB_Rs("ArgueID")&"' title='"&EB_Rs("Argue_Title")&"'><b><font color=""#BD0000"">"&EB_Rs("Argue_Title")&"...</font></b></a>"
		EB_ArgueList = EB_ArgueList&"</TD><TD bgcolor=""#F2F2F2"">"
		EB_ArgueList = EB_ArgueList&"<STRONG><FONT color=#666666>发起人：</FONT></STRONG><a href=""dispuser.asp?name="&EB_Rs("UserName")&""" target=""_blank"">"&EB_Rs("UserName")&"</a>"
		EB_ArgueList = EB_ArgueList&"</TD></TR>"
		EB_ArgueList = EB_ArgueList&"<TR><TD background=""EC_Argue/line.gif"" colSpan=""4"" height=1></TD></TR>"
		EB_ArgueList = EB_ArgueList&"<TR><TD height=21>"
		EB_ArgueList = EB_ArgueList&"<b><font color=""blue"">类别：</font></b>"
		EB_ArgueList = EB_ArgueList&"<a href='EC_Argue_List.asp?ArgueClassID="&EB_Rs("Argue_Class")&"'><font color=""blue"">"
		EB_ArgueList = EB_ArgueList&EB_ArgueClass(EB_Rs("Argue_Class") - 1)
		EB_ArgueList = EB_ArgueList&"</font></a></TD>"
		EB_ArgueList = EB_ArgueList&"<TD height=21 colspan=""3"">"
		EB_ArgueList = EB_ArgueList&"<p align=""right""><b>正方得票：</b>"&EB_ArgueVotes(0)
		EB_ArgueList = EB_ArgueList&" &nbsp;&nbsp;<b>反方得票：</b>"&EB_ArgueVotes(1)
		EB_ArgueList = EB_ArgueList&"</TD></TR>"
		EB_ArgueList = EB_ArgueList&"<TR><TD background=""EC_Argue/line.gif"" colSpan=""4"" height=1></TD></TR>"
		EB_ArgueList = EB_ArgueList&"<TR><TD height=21 width=""25%"">"
		EB_ArgueList = EB_ArgueList&"<STRONG><FONT color=#666666>发起时间：</FONT></STRONG>"
		EB_ArgueList = EB_ArgueList&EB_Rs("Appear_Date")
		EB_ArgueList = EB_ArgueList&"</TD><TD height=21 width=""25%"">"
		EB_ArgueList = EB_ArgueList&"<STRONG><FONT color=#666666>结束时间：</FONT></STRONG>"
		EB_ArgueList = EB_ArgueList&EB_Rs("Appear_Date") + EB_Rs("Argue_Days")
		EB_ArgueList = EB_ArgueList&"</TD><TD height=21 width=""25%"">"
		EB_ArgueList = EB_ArgueList&"<STRONG><FONT color=#666666>论题状态：</FONT></STRONG>"
			If Date() > EB_Rs("Appear_Date") + EB_Rs("Argue_Days") Then        '论题当前的状态
					If EB_ArgueVotes(0) > EB_ArgueVotes(1) Then
						EB_ArgueList = EB_ArgueList&"<font color=red>辩论结束，正方胜出</font>"
					Elseif EB_ArgueVotes(1) > EB_ArgueVotes(0) Then
						EB_ArgueList = EB_ArgueList&"<font color=red>辩论结束，反方胜出</font>"
					Elseif EB_ArgueVotes(1) = EB_ArgueVotes(0) Then
						EB_ArgueList = EB_ArgueList&"<font color=red>辩论结束，双方持平</font>"
					End if
			Else
				EB_ArgueList = EB_ArgueList&"<font color=blue>辩论正在进行中</font>"
			End if
		EB_ArgueList = EB_ArgueList&"</TD><TD height=21 width=""25%"">"
		EB_ArgueList = EB_ArgueList&"<STRONG><FONT color=#666666>人气：</FONT></STRONG>"
		EB_ArgueList = EB_ArgueList&EB_Rs("Argue_Hits")
		EB_ArgueList = EB_ArgueList&"</TD></TR></table>"
EB_Rs.Movenext
Loop
End if
EB_Rs.Close : Set EB_Rs = Nothing
ArgueConn.Close : Set ArgueConn = Nothing
'分页代码
		EB_PageList = "<A  href=""EC_Argue_List.asp?ArgueClassID="&EB_ClassID&""">首页</a> "
			If EB_Page = 1 Then
		EB_PageList = EB_PageList&"| 上一页 "
			Else
		EB_PageList = EB_PageList&"| <A href=""EC_Argue_List.asp?ArgueClassID="&EB_ClassID&"&Page="&EB_Page-1&""">上一页</A> "
			End if
			If EB_PageCount = 1 Or EB_Page => EB_PageCount Then
		EB_PageList = EB_PageList&"| 下一页 "
			Else
		EB_PageList = EB_PageList&"| <A href=""EC_Argue_List.asp?ArgueClassID="&EB_ClassID&"&Page="&EB_Page+1&""">下一页</A> "
			End if
			If EB_Page = EB_PageCount Then
		EB_PageList = EB_PageList&"| 尾页"
			Else
		EB_PageList = EB_PageList&"| <A href=""EC_Argue_List.asp?ArgueClassID="&EB_ClassID&"&Page="&EB_PageCount&""">尾页</A>"
			End if
		EB_PageList = EB_PageList&" <font color=""blue"">快速跳转：</font>"
		EB_PageList = EB_PageList&"<select size=""1"" OnChange=""Argue_goto_byselect(this, 'self')"">"
			
		    For EB_PageI = 1 To EB_PageCount      '快速跳转
		EB_PageList = EB_PageList&"<option value=EC_Argue_List.asp?ArgueClass="&EB_ClassID&"&Page="&EB_PageI&"&Action="&EB_Action
			If EB_Page = EB_PageI Then
		EB_PageList = EB_PageList&" selected"
			End if
		EB_PageList = EB_PageList&">"&EB_PageI&"</option>"
		    Next
		EB_PageList = EB_PageList&"</select>"
%>
<script language="JavaScript">
<!--
function Argue_goto_byselect(sel, targetstr)
{
  var index = sel.selectedIndex;
  if (sel.options[index].value != '') {
     if (targetstr == 'blank') {
       window.open(sel.options[index].value, 'win1');
     } else {
       var frameobj;
       if (targetstr == '') targetstr = 'self';
       if ((frameobj = eval(targetstr)) != null)
         frameobj.location = sel.options[index].value;
     }
  }
}

// -->
</script>
<table border="0" width="<%=Dvbbs.mainsetting(0)%>" cellpadding=2 cellspacing=0 align=center><tr><td valign="top" width="156"><%Argue_ClassList("All")%></td><td valign="top"><table border="0" cellpadding=3 cellspacing=1 align=center class=Tableborder1 Style="Width:100%"><tr><th height=23 >
	<%
		If EB_ClassID = "" Then
			Response.Write "所有论题列表"
		Else
			If EB_ClassID = "" Or Not IsNumeric(EB_ClassID) Then
				ShowErr(9)
			Else
			Response.Write EB_ArgueClass(EB_ClassID - 1)
			Response.Write " 论题列表"
			End if
		End if
	%>
</th></tr><tr><td align=center class=TableBody2><table cellpadding="0" cellspacing="0" width="100%"><tr><td><p align="left"><!--#<input type="button" value="所有论题" OnClick="Argue_goto('EC_Argue_List.asp?ArgueClassID=<%=EB_ClassID%>', '')"><input type="button" value="正在进行中的论题" OnClick="Argue_goto('EC_Argue_List.asp?ArgueClassID=<%=EB_ClassID%>&Action=1', '')"><input type="button" value="往期论题" OnClick="Argue_goto('EC_Argue_List.asp?ArgueClassID=<%=EB_ClassID%>&Action=2', '')">--></td><td><p align="right">&nbsp;<%=EB_PageList%></p></td></tr></table></td></tr><tr><td align=center class=TableBody1 height="80"><%=EB_ArgueList%></td></tr><tr><td align=center class=TableBody2><table cellpadding="0" cellspacing="0" width="100%"><tr><td><p align="left">共 <%=EB_ArgueCount%> 个论题 每页 <%=EB_ListNum%> 个 共 <%=EB_PageCount%> 页 当前为第 <%=EB_Page%> 页</td><td><p align="right"><%=EB_PageList%></p></td></tr></table>
</td></tr></table></td></tr></table>
<%
Argue_Copyright()
%>