<!--#include file = "../inc/dbconn.asp"-->
<!--#include file = "CheckLogin.asp"-->
<!--#include file = "../inc/cache.asp"-->
<!--#include file = "../inc/function.asp"-->
<% LOADING_BUFFER_INI %>
<% LOADING_ADMIN_HEAD %>
<% call dbconn %>
<%
if gqv("do") = "addSiteSave" then
    if not Check_Popedom("H104") then call alertbox("你没有权限操作",2)
	if gfv("SiteName") = "" then
		call alertbox("[网站名称]不能为空!",2)
	elseif gfv("Url") = "" then
		call alertbox("[域名]不能为空!",2)
	elseif  InStr(gfv("Url"),"http://")=0 then
		call alertbox("[域名]格式不对,请加http://!",2)
	end if
    dim rs,sql
	set rs = server.createobject(G_654_RS)
	    sql = "select top 1 * from DH654_More"
	    rs.open sql,conn,1,3
	    rs.addnew
		rs("SiteName")=trim(gfv("SiteName"))
        rs("Url")=trim(gfv("Url"))
		rs("Miibeian")=trim(gfv("Miibeian"))
        rs("Ip")=trim(gfv("Ip"))
        rs("Pv")=trim(gfv("Pv"))
        rs("OpenTime")=trim(gfv("OpenTime"))
        rs("ManageUrl")=trim(gfv("ManageUrl"))		
        rs("stat")=trim(gfv("stat"))
        rs("Others")=trim(gfv("Others"))
        rs.update
	    rs.close:set rs = nothing
	call alertbox("恭喜!添加成功!",2)
elseif gqv("do") = "editSiteSave" then
    if not Check_Popedom("H104") then call alertbox("你没有权限操作",2)
	if gfv("SiteName") = "" then
		call alertbox("[网站名称]不能为空!",2)
	elseif gfv("Url") = "" then
		call alertbox("[域名]不能为空!",2)
	elseif  InStr(gfv("Url"),"http://")=0 then
		call alertbox("[域名]格式不对,请加http://!",2)
	end if
	set rs = server.createobject (G_654_RS)
	sql = "select * from DH654_More where ID=" & trim(gfv("ID")) & ""
	rs.open sql,conn,1,3
	if not rs.eof then
		rs("SiteName")=trim(gfv("SiteName"))
        rs("Url")=trim(gfv("Url"))
		rs("Miibeian")=trim(gfv("Miibeian"))
        rs("Ip")=trim(gfv("Ip"))
        rs("Pv")=trim(gfv("Pv"))
        rs("OpenTime")=trim(gfv("OpenTime"))
        rs("ManageUrl")=trim(gfv("ManageUrl"))
        rs("stat")=trim(gfv("stat"))
        rs("Others")=trim(gfv("Others"))
		rs.update
		rs.close:set rs = nothing
		call alertbox("恭喜!修改成功!",2)
	else
		call alertbox("抱歉!填写错误!",2)
	end if
elseif gqv("do") = "del" then
    if not Check_Popedom("H104") then call alertbox("你没有权限操作",2)
	conn.execute("delete * from DH654_More where id=" & ChkNum(gqv("id")))
	call alertbox("恭喜!删除成功!",2)
end if
 %>
<table width="99%" border="0" align="center" cellpadding="2" cellspacing="1" class="tbl" id=tbl>
  <tr>
    <td align="center"><B>多站信息管理面板</B></td>
  </tr>
  <tr>
    <td class="tbl_head"><a href="?">网站概括</a> | <a href="?do=addSite">添加网站</a>    （按IP多少排列）</td>
  </tr>
</table>


<%  	

    LINE "<table align=""center"" width=""100%"" cellpadding=""2"" cellspacing=""1"" border=""0"">"
	LINE "<tr>"
	LINE "<td align=""center"" valign=""middle"">"
	dim ors
	set ors = new cls_vbspage
	set ors.conn = conn
	with ors
		.pagesize = 10
		.pagename = "page"
		.dbtype = "ac"
		.rectype = 0
		.jsurl = "../inc"
		.pkey = "id"
		.field = "id,SiteName,Miibeian,Url,ManageUrl,Ip,Pv,Stat,OpenTime,Others"
		.table = "DH654_More"
		.condition = "id > 0" 
		.orderby = "Ip desc"
	end with
	dim ireccount,irs,arrdomain,domain
		ireccount = ors.reccount()
		irs = ors.resultset()
	if ireccount < 1 then
	   LINE "<font color=""red"">暂时没有网址信息!</font>"
	else
	dim i
	for i = 0 to ubound(irs,2)
	      arrdomain=split(irs(3,i),"//") '//用 "//" 把url分开
         domain=arrdomain(1)
    LINE "<table align=""center"" width=""100%"" cellpadding=""2"" cellspacing=""1"" class=""tbl"" id=tbl>"
    LINE "<tr>"
    LINE "<td bgcolor=""#ffffff""><b><a href="""&irs(3,i)&""" target=""_blank"">"&irs(1,i)&"</a></b>("&irs(2,i)&")("&irs(3,i)&")(<a href=?do=editSite&id="&irs(0,i)&" title=""编辑该信息""><img src=""Images/edit.gif"" border=""0""></a>|<a href=?do=del&id="&irs(0,i)&" title=""删除该信息"" onclick=""{if(confirm('确定删除吗?')){return true;}return false;}""><img src=""Images/del.gif"" border=""0""></a>) 说明："&irs(9,i)&"</td>"
    LINE "</tr>"
    LINE "<tr>"
    LINE "<td bgcolor=""#ffffff"">日均IP：<font color=""#FF0000"">"&irs(5,i)&"</font> | 日均PV：<font color=""#FF0000"">"&irs(6,i)&"</font> | 开站时间:"&irs(8,i)&" | <a href="""&irs(4,i)&""" target=""_blank"">后台登录</a> | <a href=""http://www.baidu.com/s?wd=site:"&domain&"&cl=3"" target=""_blank"">百度收录</a> | <a href=""http://www.google.com/search?hl=zh-CN&q=site:"&domain&"&lr="" target=""_blank"">google收录</a></td>"
    LINE "</tr>"
    LINE "<tr>"
    LINE "<td bgcolor=""#ffffff"">网站统计："&irs(7,i)&"</td>"
    LINE "</tr><BR>"
    next
	LINE "<tr>"
	%><td bgcolor="#ffffff" align="right" height="30"><% = ors.showpage() %></td><%
	LINE "</tr>"
	end if
	LINE "</table>"
	LINE "</td>"
	LINE "</tr>"
	LINE "</table>"
' *** ***  www.654.cn  *** ***
select case gqv("do")
	case "addSite"
        if not Check_Popedom("H104") then call alertbox("你没有权限操作",2)
	    Call addSite
	    Call cursor("#addSite",0)
	case "editSite"
        if not Check_Popedom("H104") then call alertbox("你没有权限操作",2)
	    Call editSite
	    Call cursor("#editSite",0)
end select
' *** ***  www.654.cn  *** ***
sub addSite
	LINE "<a name=""addSite""></a>"
	LINE "<form name=""form"" action=""?do=addSiteSave"" method=""post"">"
	LINE "<table align=""center"" width=""100%"" cellpadding=""2"" cellspacing=""1"" border=""0"">"
	LINE "<tr>"
	LINE "<td align=""center"" valign=""middle"">"
	LINE "<table align=""center"" width=""100%"" cellpadding=""2"" cellspacing=""1"" class=""tbl"" id=tbl>"
	LINE "<tr>"
	LINE "<td width=""10%"" align=""center"" height=""30"" colspan=""2"" class=""tbl_top0"">添加网站基本信息</td>"
	LINE "</tr>"
	LINE "<tr>"
	LINE "<td class=""tbl_head"" align=""right"">网站名称:</td>"
	LINE "<td bgcolor=""#ffffff"" width=""75%""><input name=""SiteName"" type=""text"" id=""SiteName"" size=""30""></td>"
	LINE "</tr>"
	LINE "<tr>"
	LINE "<td class=""tbl_head"" align=""right"">域  名:</td>"
	LINE "<td bgcolor=""#ffffff"" width=""75%""><input name=""Url"" type=""text"" id=""Url"" size=""30"" >(包含http://)</td>"
	LINE "</tr>"
	LINE "<tr>"
	LINE "<td class=""tbl_head"" align=""right"">TCP/IP备案号:</td>"
	LINE "<td bgcolor=""#ffffff"" width=""75%""><input name=""Miibeian"" type=""text"" id=""Miibeian"" size=""30""></td>"
	LINE "</tr>"
	LINE "<tr>"
	LINE "<td class=""tbl_head"" align=""right"">日均IP:</td>"
	LINE "<td bgcolor=""#ffffff"" width=""75%""><input name=""Ip"" type=""text"" id=""Ip"" size=""30"">(不能超过8位数)</td>"
	LINE "</tr>"
	LINE "<tr>"
	LINE "<td class=""tbl_head"" align=""right"">日均PV:</td>"
	LINE "<td bgcolor=""#ffffff"" width=""75%""><input name=""Pv"" type=""text"" id=""Pv"" size=""30""></td>"
	LINE "</tr>"
	LINE "<tr>"
	LINE "<td class=""tbl_head"" align=""right"">开站时间:</td>"
	LINE "<td bgcolor=""#ffffff"" width=""75%""><input name=""OpenTime"" type=""text"" id=""OpenTime"" size=""30""></td>"
	LINE "</tr>"
	LINE "<tr>"
	LINE "<td class=""tbl_head"" align=""right"">后台登陆:</td>"
	LINE "<td bgcolor=""#ffffff"" width=""75%""><input name=""ManageUrl"" type=""text"" id=""ManageUrl"" size=""30""></td>"
	LINE "</tr>"
	LINE "<tr>"
	LINE "<td class=""tbl_head"" align=""right"">统  计:</td>"
	LINE "<td bgcolor=""#ffffff"" width=""75%""><textarea name=""stat"" cols=""50"" rows=""3"" id=""stat""></textarea></td>"
	LINE "</tr>"
	LINE "<tr>"
	LINE "<td class=""tbl_head"" align=""right"">备  注:</td>"
	LINE "<td bgcolor=""#ffffff"" width=""75%""><textarea name=""Others"" cols=""50"" rows=""3"" id=""Others""></textarea></td>"
	LINE "</tr>"
	LINE "<tr>"
	LINE "<td align=""right"" bgcolor=""#ffffff""></td>"
	LINE "<td bgcolor=""#ffffff"">"
	LINE "<input name=""submit1"" type=""submit"" value=""添  加"" onclick=""this.disabled=true;document.form.submit();"">&nbsp;"
	LINE "<input name=""submit2"" type=""reset"" value=""重新填写"">&nbsp;"
	LINE "<input name=""submit3"" type=""button"" value=""返  回"" onclick=""window.history.back();"">"
	LINE "</td>"
	LINE "</tr>"
	LINE "</table>"
	LINE "</td>"
	LINE "</tr>"
	LINE "</table>"
	LINE "</form>"
end sub
' *** ***  www.654.cn  *** ***
sub editSite
	dim rs,databox
	set rs = conn.execute("select top 1 * from DH654_More where id=" & ChkNum(gqv("id")))
	if rs.eof then
		rs.close:set rs = nothing
		call alertbox("抱歉!系统没有找到相关记录!",2)
	else
		databox = rs.getrows()
		rs.close:set rs = nothing
	end if
	LINE "<a name=""editSite""></a>"
	LINE "<form name=""form"" action=""?do=editSiteSave"" method=""post"">"
	LINE "<input name=""ID"" type=""hidden"" value=""" & ChkNum(gqv("id"))&""">"
	LINE "<table align=""center"" width=""100%"" cellpadding=""2"" cellspacing=""1"" border=""0"">"
	LINE "<tr>"
	LINE "<td align=""center"" valign=""middle"">"
	LINE "<table align=""center"" width=""100%"" cellpadding=""2"" cellspacing=""1"" class=""tbl"" id=tbl>"
	LINE "<tr>"
	LINE "<td width=""10%"" align=""center"" height=""30"" colspan=""2"" class=""tbl_top0"">修改网站基本信息</td>"
	LINE "</tr>"
	LINE "<tr>"
	LINE "<td class=""tbl_head"" align=""right"">网站名称:</td>"
	LINE "<td bgcolor=""#ffffff"" width=""75%""><input name=""SiteName"" type=""text"" id=""SiteName"" size=""30"" value=""" & databox(1,0) & """></td>"
	LINE "</tr>"
	LINE "<tr>"
	LINE "<td class=""tbl_head"" align=""right"">域  名:</td>"
	LINE "<td bgcolor=""#ffffff"" width=""75%""><input name=""Url"" type=""text"" id=""Url"" size=""30"" value=""" & databox(2,0) & """>(包含http://)</td>"
	LINE "</tr>"
	LINE "<tr>"
	LINE "<td class=""tbl_head"" align=""right"">TCP/IP备案号:</td>"
	LINE "<td bgcolor=""#ffffff"" width=""75%""><input name=""Miibeian"" type=""text"" id=""Miibeian"" size=""30"" value=""" & databox(3,0) & """>(不能超过8位数)</td>"
	LINE "</tr>"
	LINE "<tr>"
	LINE "<td class=""tbl_head"" align=""right"">日均IP:</td>"
	LINE "<td bgcolor=""#ffffff"" width=""75%""><input name=""Ip"" type=""text"" id=""Ip"" size=""30"" value=""" & databox(5,0) & """>(不能超过8位数)</td>"
	LINE "</tr>"
	LINE "<tr>"
	LINE "<td class=""tbl_head"" align=""right"">日均PV:</td>"
	LINE "<td bgcolor=""#ffffff"" width=""75%""><input name=""Pv"" type=""text"" id=""Pv"" size=""30"" value=""" & databox(6,0) & """></td>"
	LINE "</tr>"
	LINE "<tr>"
	LINE "<td class=""tbl_head"" align=""right"">开站时间:</td>"
	LINE "<td bgcolor=""#ffffff"" width=""75%""><input name=""OpenTime"" type=""text"" id=""OpenTime"" size=""30"" value=""" & databox(8,0) & """></td>"
	LINE "</tr>"
	LINE "<tr>"
	LINE "<td class=""tbl_head"" align=""right"">后台登陆:</td>"
	LINE "<td bgcolor=""#ffffff"" width=""75%""><input name=""ManageUrl"" type=""text"" id=""ManageUrl"" size=""30"" value=""" & databox(4,0) & """></td>"
	LINE "</tr>"
	LINE "<tr>"
	LINE "<td class=""tbl_head"" align=""right"">统  计:</td>"
	LINE "<td bgcolor=""#ffffff"" width=""75%""><textarea name=""stat"" cols=""50"" rows=""3"" id=""stat"">" & databox(7,0) & "</textarea></td>"
	LINE "</tr>"
	LINE "<tr>"
	LINE "<td class=""tbl_head"" align=""right"">备  注:</td>"
	LINE "<td bgcolor=""#ffffff"" width=""75%""><textarea name=""Others"" cols=""50"" rows=""3"" id=""Others"">" & databox(9,0) & "</textarea></td>"
	LINE "</tr>"
	LINE "<tr>"
	LINE "<td align=""right"" bgcolor=""#ffffff""></td>"
	LINE "<td bgcolor=""#ffffff"">"
	LINE "<input name=""submit1"" type=""submit"" value=""保存修改"" onclick=""this.disabled=true;document.form.submit();"">&nbsp;"
	LINE "<input name=""submit2"" type=""reset"" value=""重新填写"">&nbsp;"
	LINE "<input name=""submit3"" type=""button"" value=""返回"" onclick=""window.history.back();"">"
	LINE "</td>"
	LINE "</tr>"
	LINE "</table>"
	LINE "</td>"
	LINE "</tr>"
	LINE "</table>"
	LINE "</form>"
	databox = ""
end sub%>
<% LOADING_ADMIN_FOOT %>
