<!--#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 citycard_leagueploy set f_index=f_index+1 where f_id="&f_ArticleID
  conn.execute mSql
  response.redirect "admin_ploy.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 citycard_leagueploy set f_index=f_index-1 where f_id="&f_ArticleID
  conn.execute mSql
  response.redirect "admin_ploy.jsp"
end if






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





%>

<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 formsub(i){
if (i==1){
if (confirm('确定将以上活动通过审核？')==1){
   Del.action="admin_ploydel.jsp?Action=acc";
   Del.submit();
}
}
if (i==2){
	if (confirm('确定删除以上活动吗？')==1){
	Del.action="admin_ploydel.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=",0|13|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="11%" align="center" class=forumHeaderBackgroundAlternate><strong>排序设置</strong></td>
    <td class=forumHeaderBackgroundAlternate width="31%"><b>活动名称</b></td>
    <td width="23%" class=forumHeaderBackgroundAlternate><b>商家名称</b></td>
    <td width="9%" align="center" class=forumHeaderBackgroundAlternate> <div align="center"><strong>活动分类</strong></div></td>
    <td width="16%" 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 citycard_leagueploy order by f_addtime 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> <font color="#FF0000"><b><%=rs("F_index")%></b></font> </td>
      <td width="11%" align="center"  class=forumRow><a title="上升" href="admin_ploy.jsp?action=add_index&ArticleID=<%=rs("f_id")%>">[+]</a> 
        <a  title="降低" href="admin_ploy.jsp?action=div_index&ArticleID=<%=rs("f_id")%>">[-]</a></td>
      <td class=forumRow width="31%" ><a target="_blank" href="../jubao/ShowPloy.jsp?id=<%=rs("F_ID")%>" title='查看： <%=rs("f_title")%>'><%=rs("f_title")%></a>
	  <%
	  if rs("f_image")<>"" then
	  response.write "<font color=#FF0000>[图]</font>"
	  end if
	  %>
	   </td>
      <td class=forumRow > &nbsp;
	    <%
		  m_SQL = "SELECT companyid,name FROM CityCard_League where companyid="&rs("F_companyid")
	      Set rst = conn.Execute(m_SQL)
		  if not rst.eof then
		  %>
		  <%=rst("name")%>
		  <%
		  end if 
		  rst.close
		  set rst=nothing
		  %>
	  </td>
      <td align="center" class=forumRow > 
        <%
		  m_SQL = "SELECT * FROM CityCard_LeaguePloyclass where f_id="&rs("f_classid")
	      Set rst = conn.Execute(m_SQL)
		  if not rst.eof then
		  %>
		  <%=rst("f_value")%>
		  <%
		  end if 
		  rst.close
		  set rst=nothing
		  %>
      </td>
      <td class=forumRow width="16%" align="center" ><%=rs("F_addtime")%> </td>
    </tr>
    <%
 rs.movenext
 re=re+1
 rc=rc-1
 loop
 end if
%>
    <tr  > 
      <td colspan="9" align="center"  class=forumRow> 
        <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_ploy.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_ploy.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_ploy.jsp?pageno="&pno&"'>"&pno&"</a></b>"
 end if
next
response.write "&nbsp"

if int(pageno) < int(rs.pagecount) then
  response.write "<a href='admin_ploy.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_ploy.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> 
</body>
</html>
<%
 rs.close
 set rs=nothing
 conn.close
 set conn=nothing
%>
