<%@language=vbscript codepage=936 %>

<!--#include file="inc/conn_user.asp"-->

<html>
<head>
<title>模版管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href="Admin_Style.css">
<link href="Common/Style.css" rel="stylesheet" type="text/css">
<div id="All">
<div id="ShowMain">
  <div class="TitleBar">通过丰富的配置,您可以建立一个属于您自己的播客家园.</div>
  <div id="TabContent">
    <div class="ShowSimpleCon">
<DIV id=All>
<body leftmargin="2" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="1" bgcolor="#D6D5D9"></td>
    <td height="34" align=left bgcolor="#F8F8F9"><table width="100%">
      <tr>
        <td width="80"><strong>&nbsp;&nbsp;管理导航：</strong></td>
        <td><a href="Admin_gadd.asp">添加新挂饰</a> &nbsp;<a href="Admin_g.asp">所有挂饰</a></td>
      </tr>
    </table></td>

<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="1" bgcolor="#F8F8F9"></td>
    <td height="1" bgcolor="#D6D5D9" ></td>
    <td width="1" bgcolor="#F8F8F9"></td>
  </tr>
  <tr>
    <td width="1" bgcolor="#D6D5D9"></td>
    <td height="25" align=center bgcolor="#F8F8F9"><strong>挂饰管理</strong></td>
    <td width="1" bgcolor="#D6D5D9"></td>
  </tr>

</table>

<%
myPagesize=10
set rs=server.createobject("adodb.recordset")
rs.open "select * from usergs order by id desc ",conn_user,1,1
call myPages(rs,myPagesize)
%>
<table width="100%" height="24" border="0" cellpadding="6" cellspacing="1" bgcolor="#CCCCCC">
  <tr>
    <td width="5%" align="center" bgcolor="#FFFFFF"><strong>ID</strong></td>
    <td width="30%" align="center" bgcolor="#FFFFFF"><strong>标题</strong></td>
    <td width="40%" align="center" bgcolor="#FFFFFF"><strong>简介</strong></td>
    <td align="center" bgcolor="#FFFFFF"><strong>点数</strong></td>
    <td width="10%" align="center" bgcolor="#FFFFFF"><strong>操作</strong></td>
  </tr>
<%line=myPagesize

do while not rs.eof and line>0
%>
               
  <tr>
    <td width="5%" align="center" bgcolor="#FFFFFF"><%=rs("id")%></td>
    <td width="30%" bgcolor="#FFFFFF"><%=rs("gname")%></td>
    <td width="40%" bgcolor="#FFFFFF"><%=rs("gintor")%></td>
    <td align="center" bgcolor="#FFFFFF"><%=rs("point")%></td>
    <td width="10%" align="center" bgcolor="#FFFFFF"><a href="admin_gdel.asp?id=<%=rs("id")%>" target="main" >删除</a></td>
  </tr>
<%rs.movenext
   line=line-1
loop
  %>
           
</table>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="1" bgcolor="#D6D5D9"></td>
    <td height="28" align=center bgcolor="#F8F8F9"><%call listpages(mycondition)%></td>
    <td width="1" bgcolor="#D6D5D9"></td>
  </tr>
  <tr>
    <td width="1" bgcolor="#F8F8F9"></td>
    <td height="1" bgcolor="#D6D5D9" ></td>
    <td width="1" bgcolor="#F8F8F9"></td>
  </tr>
</table>
<%sub listpages(mycondition)
	response.write "<table height=22  border=0 cellpadding=0 cellspacing=0><Tr><td><table width='100%' border=0 cellspacing=0 cellpadding=0><tr><td height=3></td></tr></table>"
	if pages<1 then
		exit sub
	end if
	
	
	if p>0 then
		response.write	"<a href="&request.ServerVariables("script_name")&"?userid="&userid&"&currentpage=10&p="&p-1&mycondition&"><img src=user/prepre.gif alt=前十页 border=0></a>&nbsp;&nbsp;&nbsp;"
    else
	response.write	"<img src=user/prepre.gif alt=前十页 border=0>&nbsp;&nbsp;&nbsp;"
    end if
	'-------------------下面写出当前十个页码
	response.write "</td><td><img src=user/lined.gif border=0><img src=user/k.gif border=0 width=5>"
	for i=1 to 10
		if (p*10+i)>pages then exit for
		if currentpage=i then
		
			response.write "<b><a style='color:ff6600'"
		else
			response.write "<a"
		end if 
		response.write " href="&request.ServerVariables("script_name")&"?userid="&userid&"&currentpage="&i&"&p="&p&mycondition&"><font class=no >"&(p*10+i)&"</font></a></b>&nbsp;&nbsp;<img src=user/lined.gif border=0><img src=user/k.gif width=5 border=0>"	
     next
	 response.write "</td><td><table width='100%' border=0 cellspacing=0 cellpadding=0><tr><td height=3></td></tr></table>"
	 '--------------------察看下十页的连接
    if (p*10+10)<pages then
		response.write "<img src=user/k.gif border=0><a href="&request.ServerVariables("script_name")&"?userid="&userid&"&currentpage=1&p="&p+1&mycondition&"><img src=user/nextnext.gif alt=后十页 border=0></a>&nbsp;&nbsp;" 
		else
		response.write "<img src=user/k.gif border=0><img src=user/nextnext.gif alt=后十页 border=0>&nbsp;&nbsp;"
	end if
	'-----------------------------------------------上下页导航
	response.write "&nbsp;</td>"
	

	  response.write "</tr></table>"
end sub

sub myPages(myRS,mysize)  '------mysize为内部变量（主页面没有定义），myRS为主页面传递过来的RS对象（地址传递）
	if myRS.eof and myRS.bof then str="没有纪录"
	if str="" then
		if mysize="" or NOT IsNumeric(mysize) then
			mysize=15
		end if
		myRS.PageSize=mysize
		pages=myRS.pagecount
		records=myRS.recordcount
		On Error Resume Next '取得数字
		currentPage=request("currentPage")
		if currentPage="" then
			currentPage=1
		end if
		currentPage=CInt(currentPage)
		if Err.Number <> 0 Then
			currentPage=1
			Err.Clear
		end if
		if currentPage<1 then
			currentPage=1
		elseIf currentPage>10 then
			currentPage=10
		end if
		'----------------处理p
		p=request("p")
		if p="" then
			p=0
		end if
		p=CLng(p)
		if Err.Number <> 0 Then
			p=0
			Err.Clear
		end if
		if p<0 then
			p=0
		end if
		'--判断是否出了页数范围
		nowPage=p*10+currentPage
		if nowPage>pages then
			p=(pages-1)\10
			currentPage=((pages-1) mod 10)+1
		end if
		myRS.absolutepage=p*10+currentPage
	else
	   currentPage=1
	   records=0
	   pages=1
	end if
end sub

dim pages,records,currentPage,p '--------定义变量，这些变量在主页面中，进行地址传递%>
    </div>
    <div style="clear:both"></div>
  </div>
</div>
<div class="FooterDiv">
<p class="Text"><span>Copyright &copy; 2006-2007 <a href="Http://Www.WuhU263.Cn/" target="_blank">芜湖播客家园</a> 版权所有. 并保留一切权利.</p>
</div>
</div>
</body>
</html>