
<!--#INCLUDE FILE="db_inc.asp"-->
<%
'=========================================================
' Version:1.0
' Date: 2005-6-29
' Design by 奇怪~` 
' QQ:373218510  
'=========================================================
' Copyright (C) 2004-2008 www.Sogotour.com. All rights reserved.
' HomePage: http://www.Sogotour.com
' Email: sogotour@163.com
'=========================================================
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open StrConn
%>
<html>
<head>
<title>sogo友情链接系统</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="www.sogotour.com.css" rel="stylesheet" type="text/css">
</head>

<body bgcolor="#525252">
<table width="780" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr> 
    <td colspan="3"><img src="images/top.gif" width="780" height="132" border="0" usemap="#Map"></td>
  </tr>
  <tr> 
    <td width="52"><img src="images/left.gif" width="52" height="446"></td>
    <td width="674" bgcolor="#FFFFFF"><%if session("admin")="" then%>
      <table width="74%" border="0" align="center" cellpadding="8" cellspacing="0">
        <tr> 
          <td> <img src="images/Topics.gif" width="23" height="21" align="absmiddle"><b><font color="#999999">请输入管理员密码</font></b></td>
        </tr>
      </table>
      <table width="74%" height="17" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#F5F5F5">
        <form name="form1" method="post" action="admin.asp?action=login"><tr> 
            <td height="36" bgcolor="#F9F9F9"> 　　　　Password: 
              <input type="password" name="adminpass">
              <input type="submit" name="Submit" value="login...">
            
            
          </td>
  </tr></form>
</table>
      <p>&nbsp;</p>
      <p>&nbsp;</p>
      <p>&nbsp;</p>
      <p>&nbsp;</p>
      <p>&nbsp;</p>
      <p>&nbsp;</p>
      <p>&nbsp;</p>
      <p> 
        <%else%>
        <br>
        <%if request("action")="" then%>
      </p>
      <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr> 
          <td align="center"><iframe id="datamain" src="adminlinks.asp" width=674 height=380 marginwidth=0 marginheight=0 hspace=0 vspace=0 frameborder=0 scrolling=no ></iframe> 
            <layer visibility=hide> 
            <div style="width:674px;" align="right"> <a href="#" onMouseover="scrollspeed=-1" onMouseout="scrollspeed=0" style='TEXT-DECORATION: none;color:#ccc;font-family:Webdings'>5</a> 
              <a href="#" onMouseover="scrollspeed=1" onMouseout="scrollspeed=0" style='TEXT-DECORATION: none;color:#ccc;font-family:Webdings'>6</a> 
            </div>
            </layer>
<script LANGUAGE="JavaScript">
<!-- hide
function goHist(a) {
   history.go(a);
}
//-->
</script></td>
        </tr>
      </table>
<%elseif request("action")="edit" then%>
<%
dim id
id=htmls(encodestr(request("id")))
StrSql = "select * from sogo_link where id="&id
Set rs = server.CreateObject("ADODB.RecordSet")
rs.Open StrSql,Conn,1,1
if rs.eof then
response.write"<script>alert('很抱歉，没有您所需要的数据！~`');</script>"
response.write "<script>history.go(-1);</script>"
response.End()
else
%>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
          <td bgcolor="#FFFFFF"><table width=86% align=center border=0 cellpadding=0 cellspacing=1 bgcolor=#FF9900><tr><td bgcolor=#FFFFFF> 
            <table width="100%" border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="#F3F3F3">
                    <form action="?action=editok&id=<%=id%>" method="post">
                <script language=javascript>
   function confirm_button(){
	if (confirm("真的要删除吗，添加上去很辛苦的呢，考虑一下吧?")){
		return true;
	}
	return false;
	}
</script>
                      <tr bgcolor="#FF9900"> 
                        <td height="30" colspan="2"><font color="#FFFFFF"><font color="#FFFFFF">　　&raquo; 
                          <b>修改友情链接</b></font>[<b><%=rs("sogo_link_font")%></b>]　</font></td>
                </tr>
                <tr> 
                  <td width="92" align="right">　<br>
                    　网站名称： </td>
                  <td width="385"><br> <input name="t1" type="text" id="t13" value="<%=rs("sogo_link_font")%>"></td>
                </tr>
                <tr> 
                  <td align="right">链接类型： </td>
                  <td width="385"><label> 
                    <input name="logoortxt" type="radio" value="0" checked>
                    图片链接</label> <label> 
                    <input type="radio" name="logoortxt" value="1">
                    文字链接</label> </td>
                </tr>
                <tr> 
                  <td align="right">　　连接地址： </td>
                  <td><input name="t2" type="text" id="t23" value="<%=rs("sogo_link_url")%>" size="60"></td>
                </tr>
                <tr> 
                  <td align="right">　　logo图标： </td>
                  <td><input name="t3" type="text" id="t33" value="<%=rs("sogo_link_login")%>" size="60"></td>
                </tr>
                <tr> 
                  <td align="right" valign="top">站点说明：</td>
                  <td><textarea name="t4" cols="60" rows="5" id="t4"><%=rs("sogo_link_alt")%></textarea></td>
                </tr>
                <tr> 
                  <td colspan="2"> <div align="right"><a href="?action=delete&id=<%=id%>" onClick="return confirm_button()"><font color="#FF0000">【删除此链接】</font></a>　<%if rs("sogo_link_yes_no")=0 then%><a href="?action=ok&id=<%=id%>"><font color="#FF0000">【审核通过】</font></a><%else%><a href="?action=no&id=<%=id%>"><font color="#FF0000">【待审核】</font></a><%end if%>
                            <input type="submit" name="Submit" value=" 修 改 ">
                    </div></td>
                </tr>
              </form>
            </table>
        </td>
    </tr>
</table>
        </td>
    </tr>
</table>
<%
end if
'修改
elseif request("action")="editok" then
id=htmls(encodestr(request("id")))
StrSql = "select * from sogo_link where id="&id
Set rs = server.CreateObject("ADODB.RecordSet")
rs.Open StrSql,Conn,1,2
rs("sogo_link_font")=htmls(encodestr(request("t1")))
rs("sogo_link_url")=htmls(encodestr(request("t2")))
rs("sogo_link_login")=htmls(encodestr(request("t3")))
rs("sogo_link_alt")=htmls(encodestr(request("t4")))
rs("sogo_link_logo_or_txt")=htmls(encodestr(request("logoortxt")))
rs.update
rs.close
response.Redirect("admin.asp")
'通过审核
elseif request("action")="ok" then
id=htmls(encodestr(request("id")))
StrSql = "select * from sogo_link where id="&id
Set rs = server.CreateObject("ADODB.RecordSet")
rs.Open StrSql,Conn,1,2
rs("sogo_link_yes_no")=1
rs.update
rs.close
response.Redirect("admin.asp")
'待审核
elseif request("action")="no" then
id=htmls(encodestr(request("id")))
StrSql = "select * from sogo_link where id="&id
Set rs = server.CreateObject("ADODB.RecordSet")
rs.Open StrSql,Conn,1,2
rs("sogo_link_yes_no")=0
rs.update
rs.close
response.Redirect("admin.asp")
'添加
elseif request("action")="add" then  
if request("t1")="" or len(request("t1"))>36 or len(request("t1"))<3 or request("t2")="" or request("t3")="" or left(request("t2"),7)<>"http://" or len(request("t2"))<12 or len(request("t2"))>100 or left(request("t3"),7)<>"http://" or len(request("t3"))>160 or len(request("t3"))<16 or request("t4")="" or len(request("t4"))>255 or len(request("t4"))<2  then
response.write"<script>alert('很抱歉，请正确、完整的填写链接信息！~`');</script>"
response.write "<script>history.go(-1);</script>"
response.End()
end if

StrSql = "select * from sogo_link"
Set rs = server.CreateObject("ADODB.RecordSet")
rs.Open StrSql,Conn,1,2
rs.addnew
rs("sogo_link_font")=htmls(encodestr(request("t1")))
rs("sogo_link_url")=htmls(encodestr(request("t2")))
rs("sogo_link_login")=htmls(encodestr(request("t3")))
rs("sogo_link_alt")=htmls(encodestr(request("t4")))
rs("sogo_link_logo_or_txt")=htmls(encodestr(request("logoortxt")))
rs("sogo_link_yes_no")=1
rs.update
rs.close
response.Redirect("admin.asp")
'删除
elseif request("action")="delete" then
id=htmls(encodestr(request("id")))
conn.execute("delete * from sogo_link where ID=" & id)
response.Redirect("admin.asp")
end if
end if
%></td>
    <td width="54"><img src="images/right.gif" width="54" height="446"></td>
  </tr>
  <tr> 
    <td colspan="3"><img src="images/bottom.gif" width="780" height="52" border="0" usemap="#Map2"> 
      <map name="Map2">
        <area shape="rect" coords="459,7,678,27" href="http://sogotour.com/index.asp" target="_blank">
      </map></td>
  </tr>
</table>
<map name="Map">
  <area shape="rect" coords="511,90,575,108" href="index.asp">
  <area shape="rect" coords="593,90,656,108" href="index.asp?action=addlink">
  <area shape="rect" coords="672,90,721,108" href="admin.asp">
</map>
</body>
</html>