<!--#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"
		Argue_Nav_Link()
If InStr(EB_Masterlist,"|"&Dvbbs.MemberName&"|")<0 Or Dvbbs.Master = False Then ShowErr(16)      '判断是否为管理员，不是则跳转到错误页面
%>
<!--#include file="EC_Argue_Const.asp"-->
<%
		Select Case Request.QueryString("Act")
			Case 1 : Edit_Argue()
			Case 2 : Del_Argue()
			Case 3 : YZ_Argue()
			Case 4 : Edit_ArgueSave()
			Case 5 : Del_Appear()
			Case Else
				ShowErr(17)
		End Select
Sub Edit_Argue()
Dim EB_ArgueDays,EB_I
Dim EB_Rs,EB_SQL
Dim EB_ArgueID,EB_ArgueVotes
EB_ArgueID = Replace(Request("ArgueID"),"'","''")
	If EB_ArgueID = "" Or Not IsNumeric(EB_ArgueID) Then ShowErr(10)
		Set EB_Rs = Server.CreateObject("Adodb.RecordSet")
		EB_SQL = "Select * From EC_ArgueTopic Where ArgueID="&EB_ArgueID
		EB_Rs.Open EB_SQL,ArgueConn,1,1
			If Not(EB_Rs.BOF and EB_Rs.EOF) Then
EB_ArgueVotes =  Split(EB_Rs("Argue_Votes"),"|")
%>
<script language="javascript">
  function ChkAppear()
  {
	  if (document.Appear_Argue.Argue_Title.value==""){
	      alert("请输入辩论标题！");
		  document.Appear_Argue.Argue_Title.focus();
		  return false
		  }
	  if (document.Appear_Argue.Argue_Text.value==""){
	      alert("请输入论题描述！");
		  document.Appear_Argue.Argue_Text.focus();
		  return false
		  }
	  if (document.Appear_Argue.ZText.value==""){
	      alert("请输入正方观点！");
		  document.Appear_Argue.ZText.focus();
		  return false
		  }
	  if (document.Appear_Argue.FText.value==""){
	      alert("请输入反方观点！");
		  document.Appear_Argue.FText.focus();
		  return false
		  }
	  if (document.Appear_Argue.Z_Votes.value==""){
	      alert("正方票数不能为空！");
		  document.Appear_Argue.Z_Votes.focus();
		  return false
		  }
	  if (document.Appear_Argue.F_Votes.value==""){
	      alert("反方票数不能为空！");
		  document.Appear_Argue.F_Votes.focus();
		  return false
		  }
	  if (document.Appear_Argue.Argue_Hits.value==""){
	      alert("人气不能为空！");
		  document.Appear_Argue.Argue_Hits.focus();
		  return false
		  }
  }
</script>
<table border="0" width="<%=Dvbbs.mainsetting(0)%>" cellpadding=2 cellspacing=0 align=center>    <tr>
        <td width="156" valign="top">
            <p class="Tableborder1" style="width:100%;" align="center"><%Argue_Master()%></p>
</td>
        <td valign="top">
<table border="0" cellpadding=3 cellspacing=1 align=center class=Tableborder1 Style="Width:100%" width="547">
	<tr>
	<th height=23 colspan="2" >                        <p>修改论题--《<%=EB_Rs("Argue_Title")%>》</p>
</th>
	</tr>
	<tr>
	<td align=center class=TableBody2 colspan="2">
                        <p align="left"><b>说明：<br></b>1、所有填写项目都为必填项<br>2、所有操作都是不可逆，请慎重操作<br>3、如非必须，请不要随意修改辩论内容<br>	</td>
	</tr>
<form name="Appear_Argue" action="EC_Argue_MasterArgue.asp?Act=4&ArgueID=<%=EB_ArgueID%>" method="post" onsubmit="return ChkAppear()"><tr>
	<td align=center class=TableBody1 width="80">
                        <p>辩论标题</p>
	</td>
	<td align=center class=TableBody1 width="452">
                        <p align="left"><input name="Argue_Title" class=form01 id="title"  size="60" maxlength="40" value='<%=EB_Rs("Argue_Title")%>'><font color="red">（限40字）</font>
	</td>
                </tr>
                <tr>
	<td align=center class=TableBody1 width="80">
                        <p>论题描述</p>
	</td>
	<td align=center class=TableBody1 width="452">
                        <p align="left"><textarea name="Argue_Text" class=form01 id="dis" style="WIDTH: 430px; HEIGHT: 150px"><%=TABLEEncode(EB_Rs("Argue_Text"))%></textarea><font color="red">（限<%=Dv_Plus.Plus_Settings(4)%>字）</font>

	</td>
                </tr>
                <tr>
	<td align=center class=TableBody1 width="80">
                        <p>正方主观点</p>
	</td>
	<td align=center class=TableBody1 width="452">
                        <p align="left"><input name="ZText" class=form01 id="title"  size="60" maxlength="40" value='<%=EB_Rs("Argue_ZText")%>'><font color="red">（限40字）</font>	</td>
                </tr>
                <tr>
	<td align=center class=TableBody1 width="80">
                        <p>反方主观点</p>
	</td>
	<td align=center class=TableBody1 width="452">
                        <p align="left"><input name="FText" class=form01 id="title"  size="60" maxlength="40" value='<%=EB_Rs("Argue_FText")%>'><font color="red">（限40字）</font>	</td>
                </tr>
                <tr>
	<td align=center class=TableBody1 width="80">
                        <p>所 属 分 类</p>
	</td>
	<td align=center class=TableBody1 width="452">
                        <p align="left">
<%
					Response.Write "<select name=""Argue_ClassID"" size=""1"">"
							For EB_i = 0 to Ubound(EB_ArgueClass)
					Response.Write "<option "
								If EB_Rs("Argue_Class") - 1 = EB_i Then Response.Write "selected " 
					Response.Write "value="""&EB_i+1&""">"
					Response.Write EB_ArgueClass(EB_i)
					Response.Write "</option>"
							Next
					Response.Write "</select>"
%>	</td>
                </tr>
                <tr>
	<td align=center class=TableBody1 width="80">
                            <p>辩论开始时间</p>
	</td>
	<td align=center class=TableBody1 width="452">
                            <p align="left"><input name="Appear_Date" class=form01 id="title"  size="25" maxlength="40" value='<%=EB_Rs("Appear_Date")%>'> 
                            <font color="red">（格式：年-月-日，此项留空则自动填写为当前日期）</font></p>
	</td>
                </tr>
                <tr>
	<td align=center class=TableBody1 width="80">
                        <p>辩论进行时间</p>
	</td>
	<td align=center class=TableBody1 width="452">
                        <p align="left"><select name="ArgueDays" size="1">
					<%For EB_ArgueDays = 1 To 30%>
                                <option value="<%=EB_ArgueDays%>" <%If EB_Rs("Argue_Days") = EB_ArgueDays Then Response.Write "Selected"%>><%=EB_ArgueDays%></option>
					<%Next%>
                                </select> 天</p>
	</td>
                </tr>
                <tr>
	<td align=center class=TableBody1 width="80">
                        <p>是否允许第三方看法</p>
	</td>
	<td align=center class=TableBody1 width="452">
                                <p align="left">
				<input type="radio" name="IsMiddle" value="1" <%If EB_Rs("Argue_IsMiddle") = 1 Then Response.Write "checked"%>>
            允许 
              <input name="IsMiddle" type="radio" value="0" <%If EB_Rs("Argue_IsMiddle") = 0 Then Response.Write "checked"%>>
            不允许
				</p></td></tr><tr>
	<td align=center class=TableBody1 width="80">
                            <p>验 证 状 态</p>
	</td>
	<td align=center class=TableBody1 width="452">
                                <p align="left">
<input type="radio" name="Argue_Open" value="1" <%If EB_Rs("Argue_Open") = 1 Then Response.Write "checked"%>>
            通过验证 
              <input name="Argue_Open" type="radio" value="0" <%If EB_Rs("Argue_Open") = 0 Then Response.Write "checked"%>>
            &nbsp;未通过验证<font color="red"> &nbsp;（当选择通过验证时，方在论题列表中显示）</font>
				</p>	</td>
                </tr>
                    <tr>
	<td align=center class=TableBody1 width="80">
                            <p>得 票 数</p>
	</td>
	<td align=center class=TableBody1 width="452">
                            <p align="left">正方得票：<input name="Z_Votes" class=form01 id="title"  size="8" maxlength="40" value="<%=EB_ArgueVotes(0)%>"> 
                            反方得票：<input name="F_Votes" class=form01 id="title"  size="8" maxlength="40" value="<%=EB_ArgueVotes(1)%>"></p>
	</td>
                    </tr>
                    <tr>
	<td align=center class=TableBody1 width="80">
                            <p>人 气 值</p>
	</td>
	<td align=center class=TableBody1 width="452">
                            <p align="left"><input name="Argue_Hits" class=form01 id="title"  size="8" maxlength="40" value='<%=EB_Rs("Argue_Hits")%>'>&nbsp;</p>
	</td>
                    </tr>
                    <tr>
	<td align=center class=TableBody1 width="80">
                            <p>辩论发起人</p>
	</td>
	<td align=center class=TableBody1 width="452">
                            <p align="left"><input name="UserName" class=form01 id="title"  size="17" maxlength="40" value='<%=EB_Rs("UserName")%>'>&nbsp;<font color="red">（此项不可修改）</font></p>
	</td>
                    </tr>
<tr>
	<td align=center class=TableBody1 width="80">
                        <p>&nbsp;</p>
	</td>
	<td align=center class=TableBody1 width="452">
                        <p align="left"><input type="submit" name="Submit" value="修改论题"> 
                        &nbsp; 
                            <input type="reset" name="Cancel" value="恢复初始状态"></p>
	</td>
                </tr></form>
</table>
        </td>
    </tr>
</table>
<%
			Else
				ShowErr(10)
			End if
						EB_Rs.Close : Set EB_Rs = Nothing
						ArgueConn.Close : Set ArgueConn = Nothing
	End Sub
		Sub Edit_ArgueSave()    '修改论题数据
			Dim EB_ArgueID,EB_Title,EB_ArgueText,EB_ZText,EB_FText,EB_ClassID,EB_IsMiddle,EB_ArgueDays,EB_Argue_Open,EB_AppearDate
			Dim EB_Rs
			EB_ArgueID = Replace(Request("ArgueID"),"'","''")
			EB_Title = FilterHTML(Replace(Request.Form("Argue_Title"),"'","''"))
			EB_ArgueText = Replace(HTMLEncode(FilterHTML(Request.Form("Argue_Text"))),"'","''")
			EB_ZText = Replace(Request.Form("ZText"),"'","''")
			EB_FText = Replace(Request.Form("FText"),"'","''")
			EB_ClassID = Replace(Request.Form("Argue_ClassID"),"'","''")
			EB_IsMiddle = Replace(Request.Form("IsMiddle"),"'","''")
			EB_ArgueDays = Replace(Request.Form("ArgueDays"),"'","''")
			EB_Argue_Open = Replace(Request.Form("Argue_Open"),"'","''")
			EB_AppearDate = Replace(Request.Form("Argue_Date"),"'","''")
				If Len(EB_Title) > 40 Or Len(EB_Title) < 5 Then
					ShowErr(2)
				Elseif Len(EB_ArgueText) > Dv_Plus.Plus_Settings(4) Or Len(EB_ArgueText) < 5 Then
					ShowErr(3)
				Elseif Len(EB_ZText) > Dv_Plus.Plus_Settings(4) Or Len(EB_ZText) < 5 Then
					ShowErr(4)
				Elseif Len(EB_FText) > Dv_Plus.Plus_Settings(4) Or Len(EB_FText) < 5 Then
					ShowErr(5)
				Elseif EB_ClassID = "" Then
					ShowErr(6)
				Elseif EB_IsMiddle = "" Then
					ShowErr(7)
				End if
					Set EB_Rs = Server.Createobject("Adodb.Recordset")
						EB_Rs.Open "Select * From EC_ArgueTopic Where ArgueID = "&EB_ArgueID,ArgueConn,3,3
							EB_Rs("Argue_Title") = EB_Title
							EB_Rs("Argue_Text") = EB_ArgueText
							EB_Rs("Argue_FText") = EB_FText
							EB_Rs("Argue_ZText") = EB_ZText
							EB_Rs("Argue_Class") = EB_ClassID
							EB_Rs("Argue_IsMiddle") = EB_IsMiddle
							EB_Rs("Argue_Open") = EB_Argue_Open
							EB_Rs("Argue_Days") = EB_ArgueDays
							EB_Rs("Argue_Hits") = Replace(Request.Form("Argue_Hits"),"'","''")
							EB_Rs("Argue_Votes") = Replace(Request.Form("Z_Votes"),"'","''")&"|"&Replace(Request.Form("F_Votes"),"'","''")
								If EB_AppearDate = "" Then EB_Rs("Appear_Date") = Date()
						EB_Rs.Update
						EB_Rs.Close : Set EB_Rs = Nothing
						ArgueConn.Close : Set ArgueConn = Nothing
%><table border="0" width="<%=Dvbbs.mainsetting(0)%>" cellpadding=2 cellspacing=0 align=center>    <tr>
        <td width="156" valign="top">
            <p class="Tableborder1" style="width:100%;" align="center"><%Argue_Master()%></p>
</td>
        <td valign="top">
<table border="0" cellpadding=3 cellspacing=1 align=center class=Tableborder1 Style="Width:100%" width="547">
	<tr>
	<th height=23 >                        <p>管理操作提示</p>
</th>
	</tr>
	<tr>
	<td align=center class=TableBody2 height="50">
                        <p align="center"><font color="red">辩论主题已成功修改</font><br>	</td>
	</tr><tr>
	<td align=center class=TableBody1 height="83">
                        <p align="center"><a href="javascript:history.go(-1)">按此返回此一页</a></p>
	</td>
</tr>
</table>
        </td>
    </tr>
</table>
<%
		End Sub
		Sub Del_Argue()
Dim EB_ArgueID
			EB_ArgueID = Replace(Request("ArgueID"),"'","''")
			ArgueConn.execute "Delete From EC_ArgueTopic Where ArgueID="&EB_ArgueID
			ArgueConn.execute "Delete From EC_ArgueList Where ArgueID="&EB_ArgueID
			ArgueConn.Close : Set ArgueConn = Nothing
%>
<table border="0" width="<%=Dvbbs.mainsetting(0)%>" cellpadding=2 cellspacing=0 align=center>    <tr>
        <td width="156" valign="top">
            <p class="Tableborder1" style="width:100%;" align="center"><%Argue_Master()%></p>
</td>
        <td valign="top">
<table border="0" cellpadding=3 cellspacing=1 align=center class=Tableborder1 Style="Width:100%" width="547">
	<tr>
	<th height=23 >                        <p>管理操作提示</p>
</th>
	</tr>
	<tr>
	<td align=center class=TableBody2 height="50">
                        <p align="center"><font color="red">辩论主题及此主题下的所有观点已成功删除</font><br>	</td>
	</tr><tr>
	<td align=center class=TableBody1 height="83">
                        <p align="center"><a href="javascript:history.go(-1)">按此返回此一页</a></p>
	</td>
</tr>
</table>
        </td>
    </tr>
</table>
<%
		End Sub
		Sub YZ_Argue
Dim EB_ArgueDays,EB_I
Dim EB_Rs,EB_SQL
Dim EB_ArgueID
EB_ArgueID = Replace(Request("ArgueID"),"'","''")
	If EB_ArgueID = "" Or Not IsNumeric(EB_ArgueID) Then ShowErr(10)
		Set EB_Rs = Server.CreateObject("Adodb.RecordSet")
		EB_SQL = "Select * From EC_ArgueTopic Where ArgueID="&EB_ArgueID
		EB_Rs.Open EB_SQL,ArgueConn,1,1
			If Not(EB_Rs.BOF and EB_Rs.EOF) Then
%>
<script language="javascript">
  function ChkAppear()
  {
	  if (document.Appear_Argue.Argue_Title.value==""){
	      alert("请输入辩论标题！");
		  document.Appear_Argue.Argue_Title.focus();
		  return false
		  }
	  if (document.Appear_Argue.Argue_Text.value==""){
	      alert("请输入论题描述！");
		  document.Appear_Argue.Argue_Text.focus();
		  return false
		  }
	  if (document.Appear_Argue.ZText.value==""){
	      alert("请输入正方观点！");
		  document.Appear_Argue.ZText.focus();
		  return false
		  }
	  if (document.Appear_Argue.FText.value==""){
	      alert("请输入反方观点！");
		  document.Appear_Argue.FText.focus();
		  return false
		  }
  }
</script>
<script language="JavaScript">
<!--
function Argue_goto(url, targetstr)
{
  if (url == 'backward')
    history.back(1);
  else if (url == 'forward')
    history.forward(1);
  else {
     if (targetstr == 'blank') {
       window.open(url, 'win1');
     } else {
       var frameobj;
       if (targetstr == '') targetstr = 'self';
       if ((frameobj = eval(targetstr)) != null)
         frameobj.location = url;
     }
  }
}

// -->
</script>
<table border="0" width="<%=Dvbbs.mainsetting(0)%>" cellpadding=2 cellspacing=0 align=center>    <tr>
        <td width="156" valign="top">
            <p class="Tableborder1" style="width:100%;" align="center"><%Argue_Master()%></p>
</td>
        <td valign="top">
<table border="0" cellpadding=3 cellspacing=1 align=center class=Tableborder1 Style="Width:100%" width="547">
	<tr>
	<th height=23 colspan="2" >                        <p>修改论题--《<%=EB_Rs("Argue_Title")%>》</p>
</th>
	</tr>
	<tr>
	<td align=center class=TableBody2 colspan="2">
                        <p align="left"><b>说明：<br></b>1、所有填写项目都为必填项<br>2、所有操作都是不可逆，请慎重操作<br>3、如非必须，请不要随意修改辩论内容<br>4、<font color="blue">如已验证的论题，重新进行此操作后，除观点外所有的数值将被重置</font>	</td>
	</tr>
<form name="Appear_Argue" action="EC_Argue_MasterArgue.asp?Act=4&ArgueID=<%=EB_ArgueID%>" method="post" onsubmit="return ChkAppear()"><tr>
	<td align=center class=TableBody1 width="80">
                        <p>辩论标题</p>
	</td>
	<td align=center class=TableBody1 width="452">
                        <p align="left"><input name="Argue_Title" class=form01 id="title"  size="60" maxlength="40" value='<%=EB_Rs("Argue_Title")%>'><font color="red">（限40字）</font>
	</td>
                </tr>
                <tr>
	<td align=center class=TableBody1 width="80">
                        <p>论题描述</p>
	</td>
	<td align=center class=TableBody1 width="452">
                        <p align="left"><textarea name="Argue_Text" class=form01 id="dis" style="WIDTH: 430px; HEIGHT: 150px"><%=TABLEEncode(EB_Rs("Argue_Text"))%></textarea><font color="red">（限<%=Dv_Plus.Plus_Settings(4)%>字）</font>

	</td>
                </tr>
                <tr>
	<td align=center class=TableBody1 width="80">
                        <p>正方主观点</p>
	</td>
	<td align=center class=TableBody1 width="452">
                        <p align="left"><input name="ZText" class=form01 id="title"  size="60" maxlength="40" value='<%=EB_Rs("Argue_ZText")%>'><font color="red">（限40字）</font>	</td>
                </tr>
                <tr>
	<td align=center class=TableBody1 width="80">
                        <p>反方主观点</p>
	</td>
	<td align=center class=TableBody1 width="452">
                        <p align="left"><input name="FText" class=form01 id="title"  size="60" maxlength="40" value='<%=EB_Rs("Argue_FText")%>'><font color="red">（限40字）</font>	</td>
                </tr>
                <tr>
	<td align=center class=TableBody1 width="80">
                        <p>所 属 分 类</p>
	</td>
	<td align=center class=TableBody1 width="452">
                        <p align="left">
<%
					Response.Write "<select name=""Argue_ClassID"" size=""1"">"
							For EB_i = 0 to Ubound(EB_ArgueClass)
					Response.Write "<option "
								If EB_Rs("Argue_Class") - 1 = EB_i Then Response.Write "selected " 
					Response.Write "value="""&EB_i+1&""">"
					Response.Write EB_ArgueClass(EB_i)
					Response.Write "</option>"
							Next
					Response.Write "</select>"
%>	</td>
                </tr>
                <tr>
	<td align=center class=TableBody1 width="80">
                        <p>辩论进行时间</p>
	</td>
	<td align=center class=TableBody1 width="452">
                        <p align="left"><select name="ArgueDays" size="1">
					<%For EB_ArgueDays = 1 To 30%>
                                <option value="<%=EB_ArgueDays%>" <%If EB_Rs("Argue_Days") = EB_ArgueDays Then Response.Write "Selected"%>><%=EB_ArgueDays%></option>
					<%Next%>
                                </select> 天</p>
	</td>
                </tr>
                <tr>
	<td align=center class=TableBody1 width="80">
                        <p>是否允许第三方看法</p>
	</td>
	<td align=center class=TableBody1 width="452">
                                <p align="left">
				<input type="radio" name="IsMiddle" value="1" <%If EB_Rs("Argue_IsMiddle") = 1 Then Response.Write "checked"%>>
            允许 
              <input name="IsMiddle" type="radio" value="0" <%If EB_Rs("Argue_IsMiddle") = 0 Then Response.Write "checked"%>>
            不允许
				</p></td></tr><tr>
	<td align=center class=TableBody1 width="80">
                        <p><input type="hidden" name="Appear_Date" value="<%=Date()%>"><input type="hidden" name="Argue_Open" value="1"><input type="hidden" name="Z_Votes" value="0"><input type="hidden" name="F_Votes" value="0"><input type="hidden" name="Argue_Hits" value="0"></p>
	</td>
	<td align=center class=TableBody1 width="452">
                        <p align="left"><input type="submit" name="Submit" value="通过验证"> 
                        &nbsp;<input type="button" value="删除该论题" OnClick="Argue_goto('EC_Argue_MasterArgue.asp?Act=2&ArgueID=<%=EB_ArgueID%>', '')">&nbsp; 
                            <input type="reset" name="Cancel" value="恢复初始状态"></p>
	</td>
                </tr></form>
</table>
        </td>
    </tr>
</table>
<%
			Else
				ShowErr(10)
			End if
						EB_Rs.Close : Set EB_Rs = Nothing
						ArgueConn.Close : Set ArgueConn = Nothing
	End Sub
	Sub Del_Appear()
Dim EB_AppearID
			EB_AppearID = Replace(Request("AppearID"),"'","''")
			ArgueConn.execute "Delete From EC_ArgueList Where AppearID="&EB_AppearID
%><table border="0" width="<%=Dvbbs.mainsetting(0)%>" cellpadding=2 cellspacing=0 align=center>    <tr>
        <td width="156" valign="top">
            <p class="Tableborder1" style="width:100%;" align="center"><%Argue_Master()%></p>
</td>
        <td valign="top">
<table border="0" cellpadding=3 cellspacing=1 align=center class=Tableborder1 Style="Width:100%" width="547">
	<tr>
	<th height=23 >                        <p>管理操作提示</p>
</th>
	</tr>
	<tr>
	<td align=center class=TableBody2 height="50">
                        <p align="center"><font color="red">所选观点已成功删除</font><br>	</td>
	</tr><tr>
	<td align=center class=TableBody1 height="83">
                        <p align="center"><a href="javascript:history.go(-1)">按此返回此一页</a></p>
	</td>
</tr>
</table>
        </td>
    </tr>
</table>
<%
						ArgueConn.Close : Set ArgueConn = Nothing
	End Sub
Argue_Copyright()
%>