<% Option Explicit %>
<!--#include file="../../Inc/Const.asp" -->
<!--#include file="../../Inc/Cls_DB.asp" -->
<%
'==============================================================================
'软件名称：风讯网站信息管理系统
'当前版本：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友情连接
'==============================================================================
Dim DBC,Conn
Set DBC = New DataBaseClass
Set Conn = DBC.OpenConnection()
Set DBC = Nothing
%>
<!--#include file="../../Inc/Session.asp" -->
<!--#include file="../../Inc/CheckPopedom.asp" -->
<%
if Not JudgePopedomTF(Session("Name"),"P109") then Call ReturnError1()
		Dim TempType,RsJSObj,JsSql,JSType,FileNum,TempNumStr,TempObj,MannerStr,JsEName,JSFlag
			 JsSql = "select * from FreeJS order by Type asc,ID asc"
			 JSFlag = "自由JS列表"
		Set RsJSObj = Server.CreateObject("ADODB.Recordset")
		RsJSObj.Open JsSql,conn,1,1
		%>
		<html>
		<head>
		<link href="../../CSS/css.css" rel="stylesheet" type="text/css">
		<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
		<title>自由JS列表</title>
		</head>
		<script src="../JS/PublicJS.js" language="JavaScript"></script>
		<body topmargin="0" leftmargin="0" oncontextmenu="SelectJS();showMenu(MouseRightMenu);return false;"  ondragstart="return false;" onselectstart="//return false;">

		<table width="100%" onclick="SelectJS();" border="0" cellspacing="0" cellpadding="0">
			  <tr>
			  <td valign="top">
			  <table width="100%" border="0" cellpadding="0" cellspacing="0"> 
				  <tr>
					<td width="21%" class="ButtonList"><div align="center">名称</div></td>
					<td width="18%" class="ButtonList"><div align="center">类型</div></td>
					<td width="20%" class="ButtonList"><div align="center">样式</div></td>
					<td width="21%" class="ButtonList"><div align="center">新闻条数</div></td>
					<td width="20%" class="ButtonList"><div align="center">添加时间</div></td> 
				  </tr>
			<% if RsJSObj.eof then%>
			<tr>
			<td colspan="5" align="center"><font color="#FF0000">暂时没有记录</font></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
			RsJSObj.PageSize=page_size
			page_total=RsJSObj.PageCount
			if (cint(page_no)>page_total) then page_no=page_total
			RsJSObj.AbsolutePage=page_no
			record_all=RsJSObj.RecordCount
			if RsJSObj.eof and RsJSObj.bof then
				 %>
					  <tr> 
						<td colspan="5" > <div align="center"><font color="#FF0000">暂时没有记录</font></div></td>
					  </tr>
					  <% else
					  Dim i
					  for i=1 to RsJSObj.PageSize
						if RsJSObj.eof then exit for
						select  case RsJSObj("Type")
							case "0"  JSType = "文字"
							case "1"  JSType = "图片"
						 end select
						Set TempObj = Conn.Execute("select count(ID) from FreeJsFile where JSName='"&RsJSObj("EName")&"'")
						if TempObj.eof then
							FileNum = "0"
						else
							FileNum = TempObj(0)
						end if
						TempNumStr = FileNum&"/"&RsJSObj("NewsNum")
						Select case RsJSObj("Manner")
						   case "1" MannerStr = "样式A"
						   case "2" MannerStr = "样式B"
						   case "3" MannerStr = "样式C"
						   case "4" MannerStr = "样式D"
						   case "5" MannerStr = "样式E"
						   case "6" MannerStr = "样式A"
						   case "7" MannerStr = "样式B"
						   case "8" MannerStr = "样式C"
						   case "9" MannerStr = "样式D"
						   case "10" MannerStr = "样式E"
						   case "11" MannerStr = "样式F"
						   case "12" MannerStr = "样式G"
						   case "13" MannerStr = "样式H"
						   case "14" MannerStr = "样式I"
						   case "15" MannerStr = "样式J"
						   case "16" MannerStr = "样式K"
						   case "17" MannerStr = "样式L"
						End Select
					%>
					  <tr height="20" JsID="<%=RsJSObj("ID")%>" style="background:white;cursor:default;"> 
						<td><div align="left">&nbsp;&nbsp;&nbsp;<%=RsJSObj("CName")%></div></td>
						<td height="25"><div align="center"><%=JSType%></div></td>
						<td><div align="center"><%=MannerStr%></div></td>
						<td><div align="center"><%=TempNumStr%></div></td>
						<td><div align="center"><%=RsJSObj("AddTime")%></div></td>
					  </tr>
					  <%
		  
				RsJSObj.MoveNext
			next
			end if
			RsJSObj.close
			set RsJSObj=nothing
			end if
		%>
		</table>
		</td>
		<%if page_total>1 then%>
		</tr>
		 <tr> 
    	<td valign="middle"  height="10">
		<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%>
			</table>
</body>
</html>
<!-- 鼠标右键菜单 -->
<div id=MouseRightMenu onclick="ClickMenu(this);" onmouseover="MouseOverRightMenu();" onmouseout="MouseOverRightMenu();" class="menu"> 
  <div class="MouseRightItem" id="Code" ExeFunction="OpenWindow('FrameCode.asp?FileName=UseCode.asp&JSName=Ename&JSTable=FreeJS&JsID='+JsID,360,140,window);">调用代码</div>
  <div class="MouseRightItem" id="Info" ExeFunction="OpenWindow('CodeInfo.asp?JsID='+JsID,360,190,window);">属    性</div>
  <hr id="HR5">
  <div class="MouseRightItem" id="Refresh" ExeFunction="window.location.reload();">刷新</div>
</div>
<%
Set Conn = Nothing
%>
<script>
var JsID
var DisableOrActiveMenuArrayNo=new Array();
DisableOrActiveMenuArrayNo[0]=Code;
DisableOrActiveMenuArrayNo[1]=Info

DisableMenu(DisableOrActiveMenuArrayNo);

function SelectJS()
{
	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.JsID!=null) JsID=TRObj.JsID;
	else JsID='';
	if (JsID!='')
	{
		TRObj.style.backgroundColor='highlight';
		Code.className='MouseRightItem';
		Info.className='MouseRightItem';
		for (i=0;i<TRObj.children.length;i++) TRObj.children(i).style.color='white';
	}
	else
	{
		JsID='';
		Code.className='MenuItemDisable';
		Info.className='MenuItemDisable';
	}
}
function ChangePage(PageNum)
{
	var page_size=<% = page_size %>
	window.location.href='?page_no='+PageNum+'&page_size='+page_size;
}
	</script>
