<% Option Explicit %>
<!--#include file="../../Inc/Cls_DB.asp" -->
<!--#include file="../../Inc/Const.asp" -->
<%
Dim DBC,Conn
Set DBC = New DataBaseClass
Set Conn = DBC.OpenConnection()
Set DBC = Nothing
'==============================================================================
'软件名称：风讯网站信息管理系统
'当前版本：Foosun Content Manager System 2.0 
'最新更新：2004.12
'==============================================================================
'商业注册联系：028-85098980-601,602 技术支持：028-85098980-606、607,客户支持：608
'产品咨询QQ：159410,655071,66252421
'技术支持:所有程序使用问题，请提问到bbs.foosun.net我们将及时回答您
'程序开发：风讯开发组 & 风讯插件开发组
'论坛支持：风讯在线论坛(http://bbs.foosun.net)
'官方网站：www.Foosun.net  演示站点：test.cooin.com    
'网站建设专区：www.cooin.com
'==============================================================================
'免费版本请在新闻首页保留版权信息，并做上本站LOGO友情连接
'==============================================================================
%>
<!--#include file="../../Inc/Session.asp" -->
<!--#include file="../../Inc/CheckPopedom.asp" -->
<%
if Not JudgePopedomTF(Session("Name"),"P119") then Call ReturnError1()
 dim FriendLinkObj,FriendLinkContent,FLType,FLAdressList,TempStr,TempNum,i
     Set  FriendLinkObj = Server.CreateObject("ADODB.recordset")
	 FriendLinkObj.open "select * from FriendLink order by Type desc,ID asc",conn,1,1
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<link href="../../CSS/css.css" rel="stylesheet" type="text/css">
<script src="../JS/PublicJS.js" language="JavaScript"></script>
<body topmargin="0" leftmargin="0" oncontextmenu="SelectFriendLink();showMenu(MouseRightMenu);return false;"  ondragstart="return false;" onselectstart="//return false;">
<table id="MainTable" width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
	<td valign="top">
	<table width="100%"  onclick="SelectFriendLink();" border="0" cellspacing="0" cellpadding="0">
  <tr> 
    <td width="21%" class="ButtonList"><div align="center">名称</div></td>
    <td width="29%" class="ButtonList"><div align="center">显示内容</div></td>
    <td width="11%" class="ButtonList"><div align="center">类型</div></td>
    <td width="22%" class="ButtonList"><div align="center">显示页面</div></td>
    <td width="17%" class="ButtonList"><div align="center">添加时间</div></td>
  </tr>
  <%
	  if FriendLinkObj.eof then 
	  page_size = 20
	%>
  <tr> 
    <td colspan="5"><div align="center"><font color="#FF0000">暂时没有友情链接记录</font></div></td>
  </tr>
  </table>
  </td>
  </tr>
  <% else
    Dim page_size,page_no,page_total,record_all,PageNums
	page_size=Request.QueryString("page_size")
	if page_size<=0 or page_size="" then page_size=20
	If isnumeric(Request.Form("PageNums")) then
		if Request.Form("PageNums")<>0 then
			page_size = Cint(Request.Form("PageNums"))
		end if
	End if
	page_no=request.querystring("page_no")
	if page_no<=1 or page_no="" then page_no=1
	If Request.QueryString("page_no")="" then
		page_no=1
	end if
	FriendLinkObj.PageSize=page_size
	page_total=FriendLinkObj.PageCount
	if (cint(page_no)>page_total) then page_no=page_total
	FriendLinkObj.AbsolutePage=page_no
	record_all=FriendLinkObj.RecordCount
	for i=1 to FriendLinkObj.PageSize
	if FriendLinkObj.eof then exit for
	 if FriendLinkObj("Type") = "0" then
	 	FriendLinkContent = "<a href="&FriendLinkObj("Url")&">"&left(FriendLinkObj("Content"),10)&"</a>"
		FLType = "文字"
	 else
	 	FriendLinkContent = "<a href="&FriendLinkObj("Url")&"><img src="&confimsn("Domain")& FriendLinkObj("Content") &" width=30 height=20 border=0></a>"
		FLType = "图片"
	 end if
     if Instr(1,FriendLinkObj("Address"),"1",1)<>0 then
		FLAdressList = "首页 "
	 else
		FLAdressList = ""
	 end if
	 if Instr(1,FriendLinkObj("Address"),"2",1)<>0 then
		FLAdressList = FLAdressList & "栏目 "
	  else
		FLAdressList = FLAdressList & ""
	  end if
     if Instr(1,FriendLinkObj("Address"),"3",1)<>0 then
		FLAdressList = FLAdressList & "新闻 "
	 else
		FLAdressList = FLAdressList & ""
	 end if
     if Instr(1,FriendLinkObj("Address"),"4",1)<>0 then
		FLAdressList = FLAdressList & "专题 "
	 else
		FLAdressList = FLAdressList & ""
	 end if
  %>
  <tr FLID="<%=FriendLinkObj("ID")%>" style="background:white;cursor:default;"> 
    <td><div align="left">&nbsp;&nbsp;&nbsp;<%=FriendLinkObj("Name")%></div></td>
    <td height="25"><div align="center"><%=FriendLinkContent%></div></td>
    <td><div align="center"><%=FLType%></div></td>
    <td><div align="center"><%=FLAdressList%></div></td>
    <td><div align="center"><%=FriendLinkObj("AddTime")%></div></td>
  </tr>
  <tr height="5"><td colspan="5"></td></tr>
  <%FriendLinkObj.MoveNext
   Next
  %>
</table></td></tr>
<%
end if
if page_total>1 then%>
<tr>
<td height="18">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr height="1">
	  <td width="42%" height="18"><table width="99%" border="0" cellspacing="0" cellpadding="0">
		  <tr>
		  </tr>
	   </table> </td>
	
	<td width="51%" height="25" valign="middle"> <div align="right">
		<% =  "NO.<b>"& page_no &"</b>,&nbsp;&nbsp;" %>
		<% = "Totel:<b>"& page_total &"</b>,&nbsp;RecordCounts:<b>" & record_all &"</b>&nbsp;&nbsp;&nbsp;"%>
		<%
			if Page_Total=1 then
					response.Write "&nbsp;<img src=../images/First1.gif border=0 alt=首页></img>&nbsp;"
					response.Write "&nbsp;<img src=../images/prePage.gif border=0 alt=上一页></img>&nbsp;"
					response.Write "&nbsp;<img src=../images/nextPage.gif border=0 alt=下一页></img>&nbsp;"
					response.Write "&nbsp;<img src=../images/endPage.gif border=0 alt=尾页></img>&nbsp;"
			else
				if cint(Page_No)<>1 and cint(Page_No)<>Page_Total then
					response.Write "&nbsp;<a href=?page_no=1&page_size="& page_size &"&Keywords="&Request("Keywords")&"><img src=../images/First1.gif border=0 alt=首页></img></a>&nbsp;"
					response.Write "&nbsp;<a href=?page_no="&cstr(cint(Page_No)-1)&"&page_size="&page_size&"&Keywords="&Request("Keywords")&"><img src=../images/prePage.gif border=0 alt=上一页></img></a>&nbsp;"
					response.Write "&nbsp;<a href=?page_no="&cstr(cint(Page_No)+1)&"&page_size="&page_size&"&Keywords="&Request("Keywords")&"><img src=../images/nextPage.gif border=0 alt=下一页></img></a>&nbsp;"
					response.Write "&nbsp;<a href=?page_no="& Page_Total &"&page_size="& page_size &"&Keywords="&Request("Keywords")&"><img src=../images/endPage.gif border=0 alt=尾页></img></a>&nbsp;"
				elseif cint(Page_No)=1 then
					response.Write "&nbsp;<img src=../images/First1.gif border=0 alt=首页></img></a>&nbsp;"
					response.Write "&nbsp;<img src=../images/prePage.gif border=0 alt=上一页></img>&nbsp;"
					response.Write "&nbsp;<a href=?page_no="&cstr(cint(Page_No)+1)&"&page_size="& page_size &"&Keywords="&Request("Keywords")&"><img src=../images/nextPage.gif border=0 alt=下一页></img></a>&nbsp;"
					response.Write "&nbsp;<a href=?page_no="& Page_Total &"&page_size="& page_size &"&Keywords="&Request("Keywords")&"><img src=../images/endpage.gif border=0 alt=尾页></img></a>&nbsp;"
				else
					response.Write "&nbsp;<a href=?page_no=1&page_size="& page_size &"&Keywords="&Request("Keywords")&"><img src=../images/First1.gif border=0 alt=首页></img>&nbsp;"
					response.Write "&nbsp;<a href=?page_no="&cstr(cint(Page_No)-1)&"&page_size="& page_size &"&Keywords="&Request("Keywords")&"><img src=../images/prePage.gif border=0 alt=上一页></img></a>&nbsp;"
					response.Write "&nbsp;<img src=../images/nextPage.gif border=0 alt=下一页></img></a>&nbsp;"
					response.Write "&nbsp;<img src=../images/endpage.gif border=0 alt=尾页></img>&nbsp;"
				end if
			end if
			%>
	</div></td>
	<td width="7%" valign="middle"><select onChange="ChangePage(this.value);" style="width:50;" name="select">
	  <% for i=1 to Page_Total %>
	  <option <% if cint(Page_No) = i then Response.Write("selected")%> value="<% = i %>">
	  <% = i %>
	  </option>
	  <% next %>
	</select></td>
  </tr>
</table>
</td>
</tr>
<%
end if
   FriendLinkObj.close
   Set FriendLinkObj = Nothing
   Set Conn = Nothing
%>
</table>
</body>
</html>
<!-- 鼠标右键菜单 -->
<div id=MouseRightMenu onclick="ClickMenu(this);" onmouseover="MouseOverRightMenu();" onmouseout="MouseOverRightMenu();" class="menu"> 
  <div class="MouseRightItem" id="Add" ExeFunction="OpenWindow('FriendLinkTip.asp?FileName=OrdinaryFriendLinkAdd.asp',380,190,window);">新建</div>
  <div class="MouseRightItem" id="Edit" ExeFunction="OpenWindow('FriendLinkTip.asp?FileName=OrdinaryFriendLinkModify.asp&Types=Modify&FLID='+FLID,380,190,window);">修改</div>
  <div class="MouseRightItem" id="Del" ExeFunction="OpenWindow('FriendLinkTip.asp?FileName=OrdinaryFriendLinkModify.asp&Types=Dell&FLID='+FLID,220,95,window);">删除</div>
  <hr id="HR1">
  <div class="MouseRightItem" id="Refresh" ExeFunction="window.location.reload();">刷新</div>
   <hr id="HR2">
  <div class="MouseRightItem" id="Pros" ExeFunction="javascript:window.prompt('本页面路径属性' , '<%=Request.ServerVariables("SCRIPT_NAME")%>');">路径属性</div>
</div>

<script>
var DisableOrActiveMenuArrayNo=new Array();
DisableOrActiveMenuArrayNo[0]=Edit;
DisableOrActiveMenuArrayNo[1]=Del;

DisableMenu(DisableOrActiveMenuArrayNo);

function SelectFriendLink()
{
	var i=0,j=0;
	var EventObj=event.srcElement;
	var TRObj;
	switch (EventObj.tagName.toLowerCase())
	{
		case 'div':
			TRObj=EventObj.parentElement.parentElement;
			break;
		case 'td':
			TRObj=EventObj.parentElement;
			break;
		case 'tr':
			TRObj=EventObj;
			break;
		default:
			return;
	}
	for (j=0;j<document.all.length;j++)
	{
		if (document.all(j).style.backgroundColor=='highlight')
		{
			document.all(j).style.backgroundColor='';
			for (i=0;i<document.all(j).children.length;i++) document.all(j).children(i).style.color='black';
		}
	}
	if (TRObj.FLID!=null) FLID=TRObj.FLID;
	else FLID = '';
	if (FLID!='')
	{
		TRObj.style.backgroundColor='highlight';
	    Edit.className='MouseRightItem';
		Del.className='MouseRightItem';
		for (i=0;i<TRObj.children.length;i++) TRObj.children(i).style.color='white';
	}
	else
	{
		FLID='';
	    Edit.className='MenuItemDisable';
		Del.className='MenuItemDisable';
	}
}
function ChangePage(PageNum)
	{
		var page_size;
		page_size=<% = page_size %>;
		window.location.href='?page_no='+PageNum+'&page_size='+page_size;
		
	}
</script>