<!--#include file="inc.asp"-->
<!--#include file="check.asp"-->
<%
page=request("page")
if page="" then page="1"
act=request("act")
id=request("id")
if act="linkedit" then
call linkedit()
response.end
end if
'删除
if act="del" then
conn.execute("delete from [link] where id="&id&"")
conn.close
set conn=nothing
'Response.write "<SCRIPT language=JavaScript>alert('删除成功！');window.location.href='?page="&page&"';</SCRIPT>"
Response.redirect "?page="&page&""
Response.end
end if
'审核
if act="chk" then
set rs=server.createobject("adodb.recordset")
sql="select cflag from link where id="&id
rs.open sql,conn,1,3
if not rs.EOF then
if rs("cflag")=1 then
rs("cflag")=0
else
rs("cflag")=1
end if
rs.update
end if
rs.close
set rs=nothing
conn.close
set conn=nothing
Response.redirect "?page="&page&""
Response.end
end if
'首页连接
if act="index" then
set rs=server.createobject("adodb.recordset")
sql="select flag from link where id="&id
rs.open sql,conn,1,3
if not rs.EOF then
if rs("flag")=1 then
rs("flag")=0
else
rs("flag")=1
end if
rs.update
end if
rs.close
set rs=nothing
conn.close
set conn=nothing
Response.redirect "?page="&page&""
Response.end
end if
'LOGO 连接
if act="logo" then
set rs=server.createobject("adodb.recordset")
sql="select logo from link where id="&id
rs.open sql,conn,1,3
if not rs.EOF then
if rs("logo")=true then
rs("logo")=false
else
rs("logo")=true
end if
rs.update
end if
rs.close
set rs=nothing
conn.close
set conn=nothing
Response.redirect "?page="&page&""
Response.end
end if
'修 改
if act="edit" then
set rs=server.createobject("adodb.recordset")
if request("act2")="add" then
sql="select * from link"
rs.open sql,conn,1,3
rs.AddNew
else
sql="select * from link where id="&id
rs.open sql,conn,1,3
end if
rs("title")=request("title")
rs("url")=request("url")
rs("flag")=request("flag")
rs("cflag")=request("cflag")
rs("pic")=request("pic")
rs("logo")=request("logo")
if request("dateandtime")<>"" then rs("dateandtime")=request("dateandtime")
if request("ip")<>"" then
rs("ip")=request("ip")
else
rs("ip")=Request.ServerVariables("REMOTE_ADDR")
end if
rs.update
rs.close
set rs=nothing
conn.close
set conn=nothing
Response.redirect "?page="&page&""
Response.end
end if
%>
<html>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="images/Admin_Style.css">
<head>
<title>福建音乐视听网 管理中心</title>
<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;}}
</script>
<SCRIPT LANGUAGE="JavaScript">
<!--//
function check()
{
   if (isNaN(go2to.page.value))
		alert("请正确填写转到页数！");
   else if (go2to.page.value=="") 
	     {
		alert("请输入转到页数！");
		 }
   else
		go2to.submit();
}
//-->
</SCRIPT>
<style type="text/css">
<!--
.style1 {color: #FF0000}
-->
</style>
</head>
<body leftmargin="2" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" border="1" cellpadding="0" cellspacing="0" bordercolordark="#FFFFFF" style="border-collapse:collapse;">
<tr>
<td width="100%" height="22" align=center class="topbg"><a href="?"><b><font color=#ffffff>友 情 连 接 管 理</font></b></a>&nbsp;&nbsp;| &nbsp;&nbsp;<a href="?act=linkedit&act2=add"><b><font color=#ffffff>添 加 友 情 连 接</font></b></a></td>
</tr></table>
<div align="center">
  <% set rs=server.createobject("adodb.recordset") 
              if not isempty(request("page")) then   
	          pagecount=cint(request("page"))   
              else   
	          pagecount=1   
              end if
			  sql="select * from link order by id desc"
              rs.open sql,conn,1,1         
              rs.pagesize=20
              if pagecount>rs.pagecount or pagecount<=0 then              
              pagecount=1              
              end if              
              %>
			    <%if rs.eof and rs.bof then%>   
                对不起，还没有任何连接
                <%else%>
  
</div>
<table width='100%' border="0" align="center" cellpadding="0" cellspacing="0">
 <form method="post" action="?act=del&page=<%=page%>"> <tr>
       <td><table width="100%" border="0" cellpadding="0" cellspacing="1" >
       <tr bgcolor="bde9ff" class="tdbg" height="22">
         <td width="5%" height="22" align="center"><B>选中</B></td>
         <td width="5%"  height="22" align="center"><B>ID</B></td>
         <td width="20%" align="center" ><B>网站名称</B></td>
         <td width="10%" align="center" ><B>首页连接</B></td>
         <td width="10%" align="center" ><B>审 核</B></td>
         <td width="10%" align="center" ><B>LOGO 连接</B></td>
         <td width="10%" align="center" ><B>修 改</B></td>
         <td width="10%" align="center" ><B>删 除</B></td>
         <td width="20%" align="center" ><B>申请时间</B></td>
         </tr>
          <%rs.AbsolutePage=pagecount 
					 do while not rs.eof %>
	   <tr bgColor="#f3f3f3">
         <td width="5%" align="center"><input name='id' type='checkbox' id="id" value='<%=cstr(rs("id"))%>'></td>
         <td width="5%" align="center"><%=rs("id")%></td>
         <td width="20%" align="center"><a href=<%=rs("url")%> target=_blank><%=rs("title")%></a></td>
	<td width="10%" align="center"><a href="?act=index&Id=<%=rs("id")%>&page=<%=page%>"><%if rs("flag")=1 then%><FONT COLOR=RED>首页连接<%else%><FONT COLOR=BLUE>次页连接<%end if%></FONT></a></td>
	<td width="10%" align="center" ><a href="?act=chk&Id=<%=rs("id")%>&page=<%=page%>"><%if rs("cflag")=1 then%><FONT COLOR=RED>已 审<%else%><FONT COLOR=BLUE>待 审<%end if%></FONT></a></td>
	<td width="10%" align="center" ><a href="?act=logo&Id=<%=rs("id")%>&page=<%=page%>"><%if rs("logo")=true then%><FONT COLOR=RED>LOGO 连接<%else%><FONT COLOR=BLUE>TXT 连接<%end if%></FONT></a></td>
         <td width="10%" align="center"><a href="?act=linkedit&Id=<%=rs("id")%>&page=<%=page%>">修 改</a></td>
	<td width="10%" align="center" ><a href="?act=del&Id=<%=rs("id")%>&page=<%=page%>">删 除</a></td>
	<td width="20%" title="IP: <%=rs("ip")%>">&nbsp;&nbsp;<%=rs("dateandtime")%></td>
         </tr>
	       <% i=i+1                                                                                                  
          rs.movenext                                                                                                  
          if i>=rs.PageSize then exit do 
		  loop                                                                    
         %>
     </table>
     <table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td height="30">&nbsp; <input type=checkbox name=chkall onclick=CheckAll(this.form) value="ON">
      选择本页所有
      <input name="submit2"  type="submit" onClick="{if(confirm('您确定要删除您所选的推荐信息?')){return true;}return false;}" value="  删 除  "></td>
  </tr>
</table>
</td>
</tr></form></table>

<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr align="right">
    <% if rs.pagecount=1 then %>
    <td height="30" colspan="2"><font color="#000000">共有[<font color="#ff0000"><%=rs.recordcount%></font>]条 以下是[<font color="red">1～<%=rs.recordcount%></font>]条</font></td>
  </tr>
  <tr>
    <%else%>
    <td width="38%" align="center" valign="middle"><font color="#000000">
      <% page_start=(pagecount-1)*rs.pagesize
            if pagecount=1 then page_start=1
		    page_end=rs.pagesize*pagecount
		    if pagecount*rs.pagesize=>rs.recordcount then page_end=rs.recordcount end if%>
      共有[<font color="#ff0000"><%=rs.recordcount%></font>]条记录 以下是[<font color="red"><%=page_start%>～<%=page_end%></font>]条</font></td>
    <td width="62%" height="30" align="right"><font color="#000000">
      <% response.write"<form name=go2to form method=Post action='?'>"                                             
		     if pagecount=1 then                                                        
			 response.write "<font color='#000064'>首页 上一页</font>&nbsp;"
			 else                                                        
             response.write "<a href=?page=1><font color='0000BE'>首页</font></a>&nbsp;" 
	         response.write "<a href=?page="+cstr(pagecount-1)+"><font color='0000BE'>上一页</font></a>&nbsp;"
			 end if                                             
             if rs.PageCount-pagecount<1 then                                                        
             response.write "<font color='#000064'>下一页 尾页</font>"                                                    
			 else                                                        
             response.write "<a href=?page="+cstr(pagecount+1)+"><font color='0000BE'>下一页</font></a>&nbsp;"
			 response.write "<a href=?page="+cstr(rs.PageCount)+"><font color='0000BE'>尾页</font></a>"           
             end if 
			 response.write "<font color='000064'>&nbsp;页次:<font color=blue>"&pagecount&"</font>/"&rs.pagecount&"页</font>" 
			response.write "<font color='000064'> 转到第<input type='text' name='page' size=2 maxLength=3 style='font-size: 9pt; color:#0E96DF; position: relative; height: 18' value="&PageCount&">页</font>&nbsp;"                               
			response.write "<input class=button type='button' value='确 定' onclick=check() style='font-family: 宋体; font-size: 9pt; color: #000073; position: relative; height: 19'>" %>
    </font></td>
  <tr>
    <td height="6" colspan="4" valign="bottom"><font color="#000000">&nbsp; </font></td>
  </tr>
  <% end if %>
</table>
<% end if%>
</body>
</html>
<%SUB linkedit
if id<>"" then
set rs=server.createobject("adodb.recordset")
sql="select * from link where id="&id
rs.open sql,conn,1,1
if not rs.EOF then
title=rs("title")
url=rs("url")
flag=rs("flag")
cflag=rs("cflag")
pic=rs("pic")
logo=rs("logo")
dateandtime=rs("dateandtime")
ip=rs("ip")
end if
rs.close
set rs=nothing
conn.close
set conn=nothing
end if
%>
<html>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="images/Admin_Style.css">
<head>
<title>福建音乐视听网 管理中心</title>
<body leftmargin="2" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" border="1" cellpadding="0" cellspacing="0" bordercolordark="#FFFFFF" style="border-collapse:collapse;">
<tr>
<td width="100%" height="22" align=center class="topbg"><a href="?"><b><font color=#ffffff>友 情 连 接 管 理</font></b></a>&nbsp;&nbsp;| &nbsp;&nbsp;<a href="?act=linkedit&act2=add"><b><font color=#ffffff>添 加 友 情 连 接</font></b></a></td>
</tr></table>
<table width="100%" border="0" cellpadding="0" cellspacing="1" >
<form method="post" action="?act=edit&act2=<%=request("act2")%>&id=<%=id%>&page=<%=page%>">
<tr>
<td align="right">网站名称：</td>
<td><input type="text" name="title" value="<%=title%>" size="20" style="color:#000000; background-color:#E1F4EE; border-width:1px; border-color:#39867B; border-style:solid;">  (<font color=red>*</font>)</td>
</tr>
<tr>
<td width="35%" align="right">网站地址：</td>
<td width="85%"><input type="text" name="Url" value="<%=url%>" size="30" style="color:#000000; background-color:#E1F4EE; border-width:1px; border-color:#39867B; border-style:solid;">  (<font color=red>*</font>)</td>
</tr>
<tr>
<td width="35%" align="right">LOGO地址：</td>
<td width="85%"><input type="text" name="pic" value="<%=pic%>" size="30" style="color:#000000; background-color:#E1F4EE; border-width:1px; border-color:#39867B; border-style:solid;"></td>
</tr>
<tr>
<td align=right>首页连接：</td>
<td><%if flag=1 then%><input type="radio" name="flag" value="1" checked>是<input name=flag type="radio" value="0">否<%else%><input name=flag value="1" type="radio">是<input name=flag type="radio" value="0" checked>否<%end if%></td>
</tr>
<tr>
<td align=right>LOGO连接：</td>
<td><%if logo=true then%><input type="radio" name="logo" value="1" checked>是<input name=logo type="radio" value="0">否<%else%><input name=logo value="1" type="radio">是<input name=logo type="radio" value="0" checked>否<%end if%></td>
</tr>
<tr>
<td align=right>是否审核：</td>
<td><%if cflag=1 then%><input type="radio" name="cflag" value="1" checked>是<input name=cflag type="radio" value="0">否<%else%><input name=cflag value="1" type="radio">是<input name=cflag type="radio" value="0" checked>否<%end if%></td>
</tr>
<tr>
<td width="35%" align="right">I P 地址：</td>
<td width="85%"><input type="text" name="ip" value="<%=ip%>" size="30" style="color:#000000; background-color:#E1F4EE; border-width:1px; border-color:#39867B; border-style:solid;"></td>
</tr>
<tr>
<td width="35%" align="right">申请时间：</td>
<td width="85%"><input type="text" name="dateandtime" value="<%=dateandtime%>" size="30" style="color:#000000; background-color:#E1F4EE; border-width:1px; border-color:#39867B; border-style:solid;"></td>
</tr>
<tr><td width="5%"></td>
<td width="95%" height=35><input style="color:#000000; background-color:#E1F4EE; border-width:1px; border-color:#39867B; border-style:solid;" type="submit" value=" &#30830; &#23450; " name="cmdok">&nbsp;
<input style="color:#000000; background-color:#E1F4EE; border-width:1px; border-color:#39867B; border-style:solid;" type="reset" value=" &#28165; &#38500; "  name="cmdcancel"></td></tr></form>
</table></body></html><%end sub%>