<!--#include file="../include/Conn.jsp"-->
<!--#include file="Admin_IsLogin.jsp" -->
<!--#include file="../Include/char.jsp" -->
<%
'Define Variable 
dim i
dim rs,rst
dim mTypeName,mGrade,mSql,mFlag,mBgColor
Set rs=Server.CreateObject("Adodb.RecordSet")
''''''----------------------------------------
'提升排序
if request("action")="add_index" then
  f_ArticleID=request("ArticleID")
 if f_ArticleID="" or IsNumeric(f_ArticleID)=false then
 Call Msgbox("对不起，ID号错误！",1)
 Response.end
 end if
 
 mSql="update t_club_meet set f_index=f_index+1 where f_id="&f_ArticleID
  conn.execute mSql
  response.redirect "admin_meet.jsp"
end if

'降低排序
if request("action")="div_index" then
 f_ArticleID=request("ArticleID")
 if f_ArticleID="" or IsNumeric(f_ArticleID)=false then
 Call Msgbox("对不起，ID号错误！",1)
 Response.end
 end if
 
 mSql="update t_club_meet set f_index=f_index-1 where f_id="&f_ArticleID
  conn.execute mSql
  response.redirect "admin_meet.jsp"
end if






'initialization 
mFlag=true'add
m_modifyid=Request.QueryString("ModifyID")

'edit
if request("action")="edit" then 
 
  mSql="Select * From T_club_meet Where F_ID="&m_modifyid
  Set rs=Conn.Execute(mSql)
  If not rs.Eof then
    m_title=rs("F_title")
    m_area=rs("F_area")
	m_address=rs("F_address")
	m_time=rs("f_time")
	m_ren=rs("f_count")
	m_price=rs("f_price")
	m_content=rs("f_content")
	m_id=rs("f_id")	
    rs.Close
  End if
  mFlag=false
end if

'Insert Records
'if request("action")="Insert" then
 ' mSql="Select * From T_FriendLink"
 ' rs.open mSql,conn,1,3
 ' rs.AddNew
'  rs("F_Value")=Trim(Request.Form("txtValue"))
 ' rs("F_Value2")=Trim(Request.Form("txtValue2"))
'  rs("F_Value3")=Trim(Request.Form("selTarget"))
 ' rs.update
'  rs.close
 ' response.redirect "admin_Link.jsp?action=IsInsert&pageno="&Request("pageno")
'end if

'Modify Records
if request("action")="editsave" then
  mSql="Select * From T_club_meet Where F_ID="&m_ModifyID
  rs.open mSql,conn,1,3
  rs("F_title")=Trim(Request.Form("name"))
  rs("F_area")=Trim(Request.Form("area"))
   rs("F_address")=Trim(Request.Form("address"))
   rs("F_time")=Trim(Request.Form("time"))
   rs("F_count")=Trim(Request.Form("count"))
   rs("F_price")=Trim(Request.Form("price"))
  rs("F_content")=HTMLEncode(Request.Form("content"))
  rs.update
  response.redirect "admin_meet.jsp?action=IsModify&pageno="&Request.Querystring("pageno")
  flag=false
end if

%>

<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="Images/Style.css" rel="stylesheet" type="text/css">
<SCRIPT language="JavaScript">
function jDelete(url)
{
  if((confirm(" 警告:请确定是否删除,删除后不能恢复! "))==true) 
	self.location=url+'&action=del';
}
</SCRIPT>
<SCRIPT language=JavaScript>
function CheckAll(form)
  {
  for (var i=0;i<form.elements.length;i++)
    {
    var e = form.elements[i];
    if (e.name != 'chkall' )
       e.checked = form.chkall.checked;
    }
  }
//-->
    </SCRIPT>
<script language=Javascript>
<!--
function formsub(i){
if (i==1){
if (confirm('确定将以上活动通过审核？')==1){
   Del.action="admin_meetdel.jsp?Action=acc";
   Del.submit();
}
}
if (i==2){
	if (confirm('确定删除以上活动吗？')==1){
	Del.action="admin_meetdel.jsp?Action=del";
    Del.submit();
	}
}
}

//-->
</script>
<SCRIPT language="JavaScript">
function jDelete(url)
{
  if((confirm(" 警告:请确定是否删除,删除俱乐部后其下所有数据将不能恢复!（建议使用前台修改） "))==true) 
	self.location=url+'&action=delete';
}
</SCRIPT>
<script language="javascript">
function CheckData(){
  if (document.SignUpForm.name.value=="")
   {
    alert("俱乐部名称不能为空，请输入！");
	document.SignUpForm.name.focus();
	return false;
   }
  if (document.SignUpForm.content.value=="")
   {
    alert("介绍不能为空，请输入！");
	document.SignUpForm.content.focus();
	return false;
   }

}
</script>
</head>
<body text="#000000" >

<%
	admin_flag=",4|5|0,"
	if instr(session("flag"),admin_flag)=0 or isnull(session("flag"))=true then
	Response.write "<br><br><br><br><b><font color=red>对不起，您没有管理本页面的权限!</font></B>"
	Response.end
	end if
%>
<br>
<table class=tableBorder width="95%" border="0" align="center" cellpadding="2" cellspacing="1">
  <tr > 
    <th height="21" colspan="10"> 俱乐部活动列表</span> <font color="#FF0000">(前台排序越小越前)</font></th>
  </tr>
  <tr > 
    <td colspan="2" align="center" class=forumHeaderBackgroundAlternate><strong>次序</strong></td>
    <td width="9%" align="center" class=forumHeaderBackgroundAlternate><strong>排序设置</strong></td>
    <td class=forumHeaderBackgroundAlternate width="16%"><b>活动名称</b></td>
    <td width="9%" class=forumHeaderBackgroundAlternate><b>发布人</b></td>
    <td width="17%" align="center" class=forumHeaderBackgroundAlternate> <div align="center"><strong>活动地点</strong></div></td>
    <td width="13%" align="center" class=forumHeaderBackgroundAlternate><strong>审核状态</strong></td>
    <td width="14%" align="center" class=forumHeaderBackgroundAlternate><b>注册时间</b></td>
    <td width="12%" align="center" class=forumHeaderBackgroundAlternate><b>管理</b></td>
  </tr>
<form name="Del" method="Post">
    <%  
	Set rs=Server.createobject("Adodb.RecordSet")
    pageno=request.querystring("pageno")
    pmcount=16  
    mSql="select * from t_club_meet order by f_regtime desc"
	rs.open mSql,conn,1,1
	if rs.eof then
	   'response.write "<br><p  align='center'><font color=red><B> 对不起，数据已清空！</B></font></p>"
    else
    rs.pagesize=pmcount
    mpage=rs.pagecount
    if pageno="" then pageno=1
    if  cint(pageno)<1 or cint(pageno)>mpage then  pageno=1
    rs.absolutepage=pageno

 Dim rc,re
 rc=rs.pagesize
 re=1
 do while not rs.eof and rc>0
 mBgColor=Request.Querystring("BgColor")
 if Trim(rs("F_ID"))=Trim(mBgColor) then mColor= "D6DFFF" else mColor= "ffffff"
%>
    <tr  > 
      <td width="5%" align="center"  class=forumRow> <input name='ArticleID' type='checkbox' id="ArticleID" value="<%=rs("f_id")%>"> 
      </td>
      <td width="5%" align="center"  class=forumRow><% if cint(rs("f_index"))>0 and cint(rs("f_index"))<9 then %>
        <font color="#FF0000"><b><%=rs("F_index")%></b></font>
<% else %> <%=rs("F_index")%><% end if %></td>
      <td width="9%" align="center"  class=forumRow><a title="上升" href="admin_meet.jsp?action=div_index&ArticleID=<%=rs("f_id")%>">[+]</a> 
        <a  title="降低" href="admin_meet.jsp?action=add_index&ArticleID=<%=rs("f_id")%>">[-]</a></td>
      <td class=forumRow width="16%" ><a href="../member/club_lookmeet.jsp?id=<%=rs("F_club_id")%>&meetid=<%=rs("F_id")%>" target="_blank"><%=rs("F_title")%></a> </td>
      <td class=forumRow > &nbsp;<%=rs("F_username")%></td>
      <td class=forumRow >&nbsp;&nbsp;&nbsp;<%=rs("F_address")%></td>
      <td align="center" class=forumRow > <% 
	if rs("f_ischeck")=true then
	%>
        通过 
        <% else %> <font color="#FF0000">待审核</font> <% end if %> </td>
      <td class=forumRow width="14%" align="center" ><%=rs("F_regtime")%> </td>
      <td class=forumRow width="12%" align="center" ><a title="修改记录" href='admin_meet.jsp?action=edit&ModifyID=<%=rs("F_ID")%>&BgColor=<%=rs("F_ID")%>&pageno=<%=cstr(pageno)%>'><font color="#666666">[修改]</font></a><a title="请确定是否删除,删除后不能恢复!" href="javascript:jDelete('admin_club.jsp?DeleteID=<%=rs("F_ID")%>&pageno=<%=cstr(pageno)%>')"></a></td>
    </tr>
  
    <%
 rs.movenext
 re=re+1
 rc=rc-1
 loop
 end if
%>
    <tr  > 
      <td colspan="9" align="center"  class=forumRow><input onClick=CheckAll(this.form) type=checkbox value=on name=chkall>
      选中所有  <input type="button" name="Submit2" value="通过审核" onClick="formsub(1)"> 
        &nbsp;&nbsp; <input type="button" name="Submit3" value="删除活动"  onclick="formsub(2)" > 
   </td>
    </tr>
  </form>
  <tr  > 
    <td class=forumRow align="center" colspan="12"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr> 
          <td width="38%" height="22"> &nbsp;共 <font color=red><strong> 
            <% = rs.recordcount%>
            </strong></font> 条记录 当前第 <font color=red><strong> 
            <% = Trim(pageno)%>
            </strong></font>页/共 <font color=red><strong> 
            <% = Trim(mpage)%>
            </strong></font>页 </td>
          <td width="62%" align="right"> <%
if pageno>1 then
   response.write "<a href='admin_meet.jsp'> <img alt='首页' src='Images/boqb02.gif' border=0 width='15' height='14'></a>"
else
   response.write "<img alt='首页' src='Images/boqb02.gif' border=0 width='15' height='14'>"
end if

if pageno>1 then
   response.write "<a href='admin_meet.jsp?pageno="&pageno-1&"'><img alt='上一页' src='Images/bob02.gif' border=0 width='15' height='14'></a>"
else
   response.write "<img alt='上一页' src='Images/bob02.gif' border=0 width='15' height='14'>"
end if

add=5'数字分页个数+1
if pageno-int(add/2)<=1 then m=1 else m=pageno-int(add/2)
if m+add>mpage then 
   n=mpage
   if mpage-add<=1 then m=1 else m=mpage-add
else
   n=m+add
end if

for pno=m to n
 if pno=cint(pageno) then
   response.write "&nbsp;<font color=red>"&pno&"</font>"
 else
   response.write "<b>&nbsp;<a href='admin_meet.jsp?pageno="&pno&"'>"&pno&"</a></b>"
 end if
next
response.write "&nbsp"

if int(pageno) < int(rs.pagecount) then
  response.write "<a href='admin_meet.jsp?pageno="&pageno+1&"'><img alt='下一页' src='Images/fbob02.gif' border=0 width='15' height='14'></a>"
else 
  response.write "<img alt='下一页' src='Images/fbob02.gif' border=0 width='15' height='14'>"
end if

if int(pageno) < int(rs.pagecount) then
   response.write "<a href='admin_meet.jsp?pageno="&mpage&"'><img alt='末页' src='Images/fboqb02.gif' border=0 width='15' height='14'></a>"
else
   response.write "<img alt='末页' src='Images/fboqb02.gif' border=0 width='15' height='14'>"
end if
Response.write "&nbsp;&nbsp;"
%> </td>
        </tr>
      </table></td>
  </tr>
</table> 
        <%if mFlag=true then'add%>
<%else%>
<br>
<TABLE cellSpacing=1 cellPadding=5 width=95% align=center 
            bgColor=#ececec border=0>
  <FORM method="post" name=theform  action="admin_meet.jsp?pageno=<%=request("pageno")%>&action=editsave&ModifyID=<%=request("ModifyID")%>">
    <TBODY>
      <TR bgColor=#f2f2f2> 
        <TD colSpan=3 align="center">发起本俱乐部的活动</TD>
      </TR>
      <TR bgColor=#ffffff> 
       <TD width="151" align=right>活动名称：</TD>
        <TD width="558" colSpan=2> <FONT color=#ff0000> 
          <input name="name" type="text" id="name" value="<%=m_title%>" size="40">
          </FONT></TD>
      </TR>
      <TR bgColor=#ffffff> 
        <TD align=right>所在地区：</TD>
        <TD colSpan=2> <font class=cha2><font class=cha2> 
          <select 
      name=area id="area" style="BACKGROUND-COLOR: #ffffff; WIDTH: 170px">
            <option value=<%=m_area%> selected><%=m_area%></option>
                        <option value=新罗区>新罗区</option>
                            <option value=漳平市>漳平市</option>
                            <option value=永定县>永定县</option>
							<option value=上杭县>上杭县</option> 
						    <option value=武平县>武平县</option> 
						    <option value=连城县>连城县</option> 
							<option value=长汀县>长汀县</option>
							<option value=其它市>其它市</option>
          </select>
          </font></font></TD>
      </TR>
      <TR bgColor=#ffffff> 
        <TD align=right>活动地点：</TD>
        <TD colSpan=2><FONT color=#ff0000> 
          <input name="address" type="text" id="address" value="<%=m_address%>" size="40">
          </FONT></TD>
      </TR>
      <TR bgColor=#ffffff> 
        <TD align=right>活动时间：</TD>
        <TD colSpan=2><FONT color=#ff0000>
          <input name="time" type="text" id="time" value="<%=m_time%>">
          注意时间格式</FONT></TD>
      </TR>
      <TR bgColor=#ffffff> 
        <TD align=right>限止人数：</TD>
        <TD colSpan=2><FONT color=#ff0000> 
          <SELECT 
            style="WIDTH: 60px; BACKGROUND-COLOR: #ffffff" name=count>
            <OPTION value=<%=m_ren%>><%=m_ren%>人</OPTION>
            <% for n=5 to 200 %>
            <OPTION value=<%=n%>><%=n%>人</OPTION>
            <% next %>
          </SELECT>
          </FONT></TD>
      </TR>
      <TR bgColor=#ffffff> 
        <TD align=right>收费方式：</TD>
        <TD colSpan=2><FONT color=#ff0000> 
          <input name="price" type="text" id="price" value="<%=m_price%>">
          例:AA制</FONT></TD>
      </TR>
      <TR bgColor=#ffffff> 
        <TD align=right valign="top">具体说明：</TD>
        <TD colSpan=2><textarea name="content" cols="50" rows="8" id="content"><%=RN_HTMLEncode(m_content)%></textarea></TD>
      </TR>
      <TR bgColor=#f2f2f2> 
        <TD colSpan=3 align="center"> 
          <INPUT type=submit value="确定修改此活动" name=submit> </TD>
      </TR>
  </FORM>
</TABLE>
<%end if%>

</body>
</html>
<%
 rs.close
 set rs=nothing
 conn.close
 set conn=nothing
%>
