<% Option Explicit %>
<!--#include file="../../Inc/Const.asp" -->
<!--#include file="../../Inc/Cls_DB.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 OperateType,Sql,RsRoutineObj
OperateType = Request("Type")
Sql = "Select * from Routine where Type=" & OperateType
Set RsRoutineObj = Server.CreateObject("ADODB.recordset")
RsRoutineObj.open Sql,conn,1,1
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>常规列表</title>
</head>
<link href="../../CSS/css.css" rel="stylesheet">
<script src="../JS/PublicJS.js" language="JavaScript"></script>
<body topmargin="0" leftmargin="0" ondragstart="return false;" onselectstart="//return false;" oncontextmenu="SelectItem();showMenu(MouseRightMenu);return false;">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
  <td valign="top"><table width="100%" onClick="SelectItem();" border="0" cellpadding="0" cellspacing="0">
    <tr> 
	 <td width="50%" class="ButtonList"> <div align="center">名称</div></td>
    <td width="50%" class="ButtonList"> <div align="center">联接地址</div></td>
  </tr>
  <%if RsRoutineObj.eof then
  page_size=20
  %>
  	<tr>
		<td align="center" colspan="2"><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

	RsRoutineObj.PageSize=page_size
	page_total=RsRoutineObj.PageCount
	if (cint(page_no) > page_total) then page_no=page_total

	RsRoutineObj.AbsolutePage=page_no
	record_all=RsRoutineObj.RecordCount
	dim i
	for i=1 to RsRoutineObj.PageSize
	if RsRoutineObj.eof then exit for
%>
  <tr class="TempletItem" OrdinaryID="<% = RsRoutineObj("ID") %>"> 
    <td><div align="left">&nbsp;&nbsp;&nbsp;<% = RsRoutineObj("Name") %></div></td>
    <td><div align="center"><% = RsRoutineObj("Url") %></div></td>
  </tr>
  <%
	RsRoutineObj.MoveNext
Next
end if
%>
</table>
</td>
</tr>
<%

if page_total>1 then%>
<tr>
<td height="18">
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
 <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&Type="& OperateType &"&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)&"&Type="& OperateType &"&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)&"&Type="& OperateType &"&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 &"&Type="& OperateType &"&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)&"&Type="& OperateType &"&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 &"&Type="& OperateType &"&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&Type="& OperateType &"&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)&"&Type="& OperateType &"&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>
</table>
</body>
</html>
<!-- 鼠标右键菜单 -->
<div id=MouseRightMenu onclick="ClickMenu(this);" onmouseover="MouseOverRightMenu();" onmouseout="MouseOverRightMenu();" class="menu"> 
  <div class="MouseRightItem" id="New" ExeFunction="OpenWindow('Frame.asp?FileName=OrdinaryEdit.asp&Titles=常规管理&OperateType='+OperateType,300,110,window);">新建</div>
  <div class="MouseRightItem" id="Edit" ExeFunction="OpenWindow('Frame.asp?FileName=OrdinaryEdit.asp&Titles=常规管理&OperateType='+OperateType+'&OrdinaryID='+SelectItemID,300,110,window);">修改</div>
  <div class="MouseRightItem" id="Del" ExeFunction="OpenWindow('Frame.asp?FileName=OrdinaryDelete.asp&Titles=常规管理&OperateType='+OperateType+'&OrdinaryID='+SelectItemID,220,95,window);">删除</div>
  <hr id="nouse">
  <div class="MouseRightItem" id="reFresh" ExeFunction="location.reload();">刷新</div>
</div>
<%
Set Conn = Nothing
Set RsRoutineObj = Nothing
%>
<script language="JavaScript">
var SelectItemID='';
var OperateType='<% = OperateType %>';
Edit.className='MenuItemDisable';
Del.className='MenuItemDisable';
function SelectItem()
{
	var 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 (var i=0;i<document.all.length;i++)
	{
		if (document.all(i).className=='TempletSelectItem')
		{
			document.all(i).className='TempletItem';
			for (j=0;j<document.all(i).children.length;j++) document.all(i).children(j).style.color='#000000';
		}
	}
	if (TRObj.OrdinaryID!=null)
	{
		TRObj.className='TempletSelectItem';
		for (j=0;j<TRObj.children.length;j++) TRObj.children(j).style.color='#FFFFFF';
		if (TRObj.OrdinaryID!=null) SelectItemID=TRObj.OrdinaryID;
		else SelectItemID = '';
		if (SelectItemID!='')
		{
			Edit.className='MouseRightItem';
			Del.className='MouseRightItem';
		}
		else
		{
			SelectItemID = '';
			Edit.className='MenuItemDisable';
			Del.className='MenuItemDisable';
		}
	}
}
function ChangePage(PageNum)
{
	var page_size=<% = page_size %>;
	window.location.href='?page_no='+PageNum+'&Type='+ OperateType+'&page_size='+ page_size;
}

</script>