<!--#include file="../../p_inc/Include_func.asp"-->
<!--#include file="../inc/classDbPager.asp"-->
<!--#include file="../inc/public.asp"-->
<!--#include file="../inc/openconn.asp"-->
<!--#include file="config.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta http-equiv="Content-Language" content="zh-cn">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<LINK href="../css/style.css" rel=stylesheet type=text/css>
<title>网站管理</title>
<script src="../js/mouse_on_title.js"></script>
<script src="../js/p_js.js"></script>
<script>
function CheckAll(form)
  {
  for (var i=0;i<form.elements.length;i++)
    {
    var e = form.elements[i];
    if (e.name != 'chkall' )
       e.checked = form.chkall.checked;
    }
  }
function setCookie(name, value) {
    var expdate = new Date();
    var argv = setCookie.arguments;//获得数组
    var argc = setCookie.arguments.length;//获得数组的长度
    var expires = (argc > 2) ? argv[2] : 1;//可伸长变量
    var path = (argc > 3) ? argv[3] : "/";
    var domain = (argc > 4) ? argv[4] : null;
    var secure = (argc > 5) ? argv[5] : false;
    if(expires!=null){
        expdate.setTime(expdate.getTime() + ( expires*24*60*60*1000 )); //把传过来得变量变成天数
	}
    document.cookie = name + "=" + escape (value)
    +((expires == null) ? "" : ("; expires="+ expdate.toGMTString()))
    +((path == null) ? "" : ("; path=" + path))
    +((domain == null) ? "" : ("; domain=" + domain))
    +((secure == true) ? "; secure" : "");
}

</script>
</head>
<body>
<%
	s_page=""
	IF request.Cookies("page_n")="" then
		msg_per_page=10
	else
		msg_per_page=Cint(request.Cookies("page_n"))
	end if
	kSql_where="id>0 And m_type1=5  And m_province=0"
	kSql_order="m_no Desc,m_time desc,id desc"
	sDesc=Trim(Request("desc"))
	IF sDesc<>"" Then  kSql_order=sDesc
	
	zm_type1=Request("m_type1")
	zm_type1=Bint(zm_type1)
	
	zm_type2=Request("m_type2")
	zm_type2=Bint(zm_type2)	
	IF zm_type2<>0 Then 
		kSql_where=kSql_where& " And m_type2="&zm_type2
	End IF

'	zm_province=Request("m_province")
'	zm_province=Bint(zm_province)
'	IF zm_province<>0 Then 
'		IF zm_province=10000 Then
'			kSql_where=kSql_where&""
'		Else
'			kSql_where=kSql_where& " And m_province="&zm_province
'		End IF
'	Else
'		kSql_where=kSql_where& " And m_province=0"
'	End IF
		
	zm_look=Request("m_look")
	zm_look=StayNub(zm_look)
	IF zm_look<>"" Then kSql_where=kSql_where&" And m_look="&zm_look
	
	zm_name=Replace_Text_2008(Request("m_name"))
	IF zm_name<>"" Then kSql_where=kSql_where&" And (m_name like '%"&zm_name&"%' or m_url like '%"&zm_name&"%')"

	sql="Select * from qingtiandy_tool Where "&kSql_where&" Order by "&kSql_order
	
	Set rs=server.CreateObject(G_RS)
	rs.open sql,conn,1,1 
	s_page="?m_type1="&zm_type1&"&desc="&server.URLEncode(sDesc)&"&m_name="&server.URLEncode(zm_name)&"&m_look="&zm_look&"&m_province="&zm_province&"&m_type2="&zm_type2
%>
<!--#include file="../inc/headpage.asp"-->
<table width="98%" border="0" cellspacing="1" cellpadding="1"  align=center class="tableBorder">
	<tr> 
		<th class="tableHeaderText" colspan=2 height=25>搜索关键词管理</th>
	</tr>
	<FORM name=form action="?" method=get>
	<tr>
		<td width="12%" height=25 class="forumRowHighlight">
		<B>管理操作选项</B></td>
		<td width="88%" class=forumRowHighlight>
		<DIV id="showTemplet">
			<table width="100%"  border="0" cellspacing="0" cellpadding="0" id="templet">
				<tr>
					<td>
						<Select name="m_look">
							<Option value="">状态</Option>
							<Option value="1">显示</Option>
							<Option value="0">隐藏</Option>
						</Select>					
						<select name="desc">
							<option value="" selected="selected">默认排序</option>
							<option value="m_time asc" selected="selected">添加时间升序</option>
							<option value="m_time desc" selected="selected">添加时间降序</option>
							<option value="m_name">类别名a~z排序</option>
							<option value="m_name desc">类别名z~a排序</option>
							<option value="id desc">ID降序</option>
							<option value="id asc">ID升序</option>
							<option value="m_no asc ,m_time desc">权重升序</option>
							<option value="m_no desc ,m_time desc">权重降序</option>
						</select>
						<select name="m_type2">
						<%
							Response.Write GetDhType1(a_arrmz_3,zm_type2,1)
						%>
						</select>
						网站名：
						<input type = "Text" name = "m_name" style="width:200px;"> </td>
				</tr>
			</table>
		</DIV>
	  </td>
	</tr>	
	
	<tr> 
		<td width="12%" height=25 class="forumRowHighlight"></td>
	  <td width="88%" height=25 class="forumRowHighlight">
	  <input type="submit" value="立刻查找" id="submit" name="submit" style="cursor:hand;">　　
	  [<a href="javascript:location.reload()">刷新页面</a>]
	  [<a href="edit.asp?m_type1=5&m_type2=<%=zm_type2%>">添加</a>]
	  </td>
	</tr>	
	</form>
</table>
<Form name="search" method="post" action="?">
<input type="hidden" name="Action" value="">
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" class="tableBorder">
	<tr>
		<th width="88%" height=25 class="tableHeaderText"><a href='?'><font color="#FFFFFF">搜索关键词列表</font></a></th>	
        <th width="12%" height=25 class="tableHeaderText" align="right">
	<select name="pp_page" onChange="setCookie('page_n',this.options[this.selectedIndex].value,30);location.href='?'">
	<option value="">请选择页数</option>
	<option value="10">10</option>
	<option value="15">15</option>
	<option value="20">20</option>
	<option value="30">30</option>
	<option value="50">50</option>
	<option value="100">100</option>
	<option value="200">200</option>
	<option value="300">300</option>
	<option value="500">500</option>
	</select>		
	  </th>
	<tr> 
	<tr>
		<td colspan="2"> 
  			<TABLE width="100%" border="0" cellpadding="0" cellspacing="1">
			<TR height=25>			
				<TD width="5%"   class=bodytitle><font color="#CC3300"><b>ID </b></font></TD>
				<TD    class=bodytitle><font color="#CC3300"><b>网站名</b></font></TD>
				<TD width="10%"   class=bodytitle><font color="#CC3300"><b>所属类别</b></font></TD>
				<TD width="5%"   class=bodytitle><font color="#CC3300"><b>权重</b></font></TD>
				<TD width="17%"   class=bodytitle><font color="#CC3300"><b>有效时间</b></font></TD>
				<TD width="18%"   class=bodytitle><font color="#CC3300"><b>截止时间</b></font></TD>
				<TD width="8%"   class=bodytitle><font color="#CC3300"><b>操作选项</b></font></TD>
			  <TD width="7%"   align="center" class=bodytitle><INPUT onclick=CheckAll(this.form) type=checkbox value=on name=chkall><input type="button" name="btnSubmit" value="删"  onClick="{if(confirm('你确定要删除吗？\n删除将不再恢复！')){;this.form.Action.value='Del';this.form.action='edit.asp?Action=Del';this.form.submit();return true;}return false;}"></td>
			</TR>					
<%
IF rs.Eof Then
	Response.Write "<TR height=25><td colspan='8' align='center'><br><br><div align='center'>暂无数据信息,<a href='Printin.asp'><font color=red>点这里开始导入</font></a></div><br><br></td></tr>"
End IF
do while not rs.eof and rowcount > 0
	nId=rs("id")
	nl_type1=rs("m_type1")	
	nm_type2=rs("m_type2")
	nl_name=rs("m_name")
	nl_look=rs("m_look")
	nl_addtime=rs("m_time")
	n_url=GetUrl_httpAll(rs("m_url"))
	n_no=rs("m_no")
	nl_color=Getrp(rs("m_color"))
	nm_start=rs("m_start")
	nm_end=rs("m_end")
	nm_province=rs("m_province")
	nm_city=rs("m_city")
	nm_pic=Add_Root_Dir(GetRp(rs("m_pic")))
%>	
			<tr height="20">
			<td nowrap="nowrap" class="forumRow"><%=nId%></td>
			<td nowrap="nowrap" class="forumRow"><a href='../../p_inc/turnto.asp?u=<%=n_url%>' target="_blank">
			<%
			IF nl_color="" Then
				Response.Write Replace(left(nl_name,20),zm_name,"<font color=red>"&zm_name&"</font>")
			Else
				Response.Write "<font color="&nl_color&">"&Replace(left(nl_name,20),zm_name,"<font color=red>"&zm_name&"</font>")&"</font>"
			End IF
			%>
			</a></td>
			<td nowrap="nowrap" class="forumRow"><a href='?m_type2=<%=nm_type2%>'><%=GetDhType1(a_arrmz_3,nm_type2,"2")%></a></td>
			<td nowrap="nowrap" class="forumRow"><%=n_no%></td>
			<td nowrap="nowrap" class="forumRow"><%IF ForMatDate(nm_start,5)=ForMatDate(now(),5) Then response.Write "<font color=red>"&ForMatDate(nm_start,55)&"</font>" Else response.Write ForMatDate(nm_start,55) %></td>
			<td nowrap="nowrap" class="forumRow"><%IF ForMatDate(nm_end,5)>ForMatDate(now(),5) Then response.Write ""&ForMatDate(nm_end,55)&"" Else response.Write "<font color=#999999>已过期</font>" %></td>
			<td class="forumRow">
			<%IF nl_look="1" Then%>
			<a href='edit.asp?id=<%=nId%>&Action=l_look&m_look=0'><img src="../images/down_0.gif" border="0" title="隐藏此网站"></a>
			<%Else%>
			<a href='edit.asp?id=<%=nId%>&Action=l_look&m_look=1'><img src="../images/down_1.gif" border="0" title="显示此网站"></a>
			<%End IF%>
			<a href='edit.asp?id=<%=nId%>&m_type1=<%=nl_type1%>&m_province=<%=nm_province%>&m_city=<%=nm_city%>&m_type2=<%=nm_type2%>'><img src="../images/admin_top_icon_5.gif" border="0" title="编辑"></a>
			<a href='edit.asp?Id=<%=nId%>&Action=Del' onclick='{if (confirm("你确定要删除吗？\n删除将不再恢复！")){return true;}return false;}'><img src="../images/cha.gif" border="0" title="删除此网站"></a>			</td>
			<TD  align="center" class=forumRow><input type=checkbox name=id value="<%=nId%>"></td>
			</tr>		
<%
	icolor=icolor+1
	if icolor>1 then icolor=0
	rowcount=rowcount-1
	rs.moveNext()
	Loop
	
%>						
			</TABLE>	
		</td>
	</tr>
	<tr align="center">
		<td class="forumrowHighLight" colspan="2"><%=listPages(s_page)%></td>
	</tr>	
</table>
</Form>


<SCRIPT language="VBSCRIPT" RUNAT="SERVER">
	Function ShowInfo(sId)
		WriteLn("<S"&"CRIPT LANGUAGE=JAVASCRIPT>")
		WriteLn("	var oForm = form;")
		WriteLn("	with(oForm){")
		WriteLn("		m_look.value='" & Str4Js(zm_look) & "';")
		WriteLn("		m_name.value='" & Str4Js(zm_name) & "';")
		WriteLn("		desc.value='" & Str4Js(sDesc) & "';")
		WriteLn("	}")
		WriteLn("</S"&"CRIPT>")
	End Function
</SCRIPT>	
<%
	ShowInfo sId

	rs.Close:Set rs = Nothing
	CloseConn()
%>
</body>
</html>