<!--#include file="conn.asp"-->
<!--#include file="webconfig.asp"-->
<%dim id
id=request.QueryString("id")
if not isnumeric(id) then 
response.write"<script>alert(""非法访问!"");location.href=""../index.asp"";</script>"
response.end
else
if not isinteger(id) then
response.write"<script>alert(""非法访问!"");location.href=""../index.asp"";</script>"
else
set rs_shjia=server.CreateObject("adodb.recordset")
strshjia="select * from shjia where shjiaid="&id
rs_shjia.open strshjia,conn,1,1
if rs_shjia.bof and rs_shjia.eof then
response.write"<script>alert(""非法访问!"");location.href=""../index.asp"";</script>"
else
shjname=rs_shjia("name")
shjianame=rs_shjia("username")
shjiaid=rs_shjia("shjiaid")
lx=rs_shjia("lx")
end if
end if
end if
%>

<html><head><title>管理</title>
<script>
function IsDigit()
{
  return ((event.keyCode >= 48) && (event.keyCode <= 57));
}
</script>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../images/css.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style1 {
	color: #FF0000;
	font-weight: bold;
}
-->
</style>
</head>
  <%
  if lx=0 then
  response.write "<font color=red>&nbsp对不起，您是目前是免费用户，不能使用此项功能！请马上升级成为<a href=../gbook.asp>B型或C型用户</a></font>"
  response.write "<br>B型用户（即网店型用户），365元/年；C型用户（即企业公司型用户），500元/年,<a href=../help.asp?action=fukuan><font color=red><b>请立即升级您的网店！</b></font></a>"
  end if
    if lx=1 or lx=2 then
  %>
<body>
<%
if request.cookies("bjx")("shjianame")="" then
response.Redirect "admin_link.asp?id='"&id&"'"
response.End
end if
dim selectid
'//删除
selectid=request("selectid")
if selectid<>"" then
conn.execute "delete from shop_shjialink where linkid in ("&selectid&")"
'response.Redirect "admin_link.asp?id='"&id&"'"
response.Write "<script language=javascript>alert('你选择的已删除');window.location.href='admin_link.asp?id="&id&"';</script>"
'response.End
end if
%>
<script>
function test()
{
  if(!confirm('确认删除吗？')) return false;
}
</script>
<table width="90%"  border="0" align="center" cellspacing="1" bgcolor="#FFFFFF" class="tableBorder" height="25">
  <tr>
    <td height="21" background="../images/admin_bg_1.gif"><div align="center" class="style1"><font color="#FFFFFF">友情链接</font><font color="#FFFFFF">管理</font></div></td>
  </tr>
  <tr>
    <td height="1" bgcolor="#FFFFFF" valign="top">
<form name="form1" method="post" action="">
      <table border="0" width="100%" height="46">
        <tr>
          <td width="24%" bgcolor="#D6DBF7" align="center" height="23">网站名称</td>
          <td width="25%" bgcolor="#D6DBF7" align="center" height="23">
           LOGO图标地址</td>
          <td width="24%" bgcolor="#D6DBF7" align="center" height="23">
           链接地址</td>
          <td width="6%" bgcolor="#D6DBF7" align="center" height="23">
            删除</td>
        </tr>
            <%
    If Len(Trim(Request("page")))=0 Then  '返回目标页码的判断
    page=1 
    Else 
    page=CInt(Trim(Request("page"))) 
    End If
    set rs=server.createobject("adodb.recordset")
    sql="select * from shop_shjialink where shjiaid="&id
    rs.open sql,conn,1,1
	if err.number<>0 then
	response.write "数据库中无数据"
	end if 
	rs.PageSize=20
    if not rs.eof then
    for k=1 to rs.PageSize 
    %> 
        <tr>
          <td width="24%" bgcolor="#D6DBF7" align="center" height="6"><%=rs("linkname")%>
          </td>
          <td width="25%" bgcolor="#D6DBF7" align="center" height="12">
          <%if rs("logourl")="" then 
          response.write("该站没有添加LOGO")
          %>
          <%else%>
          <img src="<%=rs("logourl")%>" border="0">
          <%end if%>
          </td>
          <td width="24%" bgcolor="#D6DBF7" align="center" height="12"><%=rs("url")%>　
          </td>
          <td width="6%" bgcolor="#D6DBF7" align="center" height="12">
<input name="selectid" type="checkbox" id="selectid" value="<%=rs("linkid")%>">
          </td>
        </tr>
     <% rs.movenext
    if rs.EOF Then Exit For
    next
  end if%>
        <tr>
          <td width="73%" bgcolor="#D6DBF7" align="center" height="6" colspan="3"><font color="#FF0000">注：如果添加以后，没有显示，请刷新页面！</font>
          </td>
          <td width="6%" bgcolor="#D6DBF7" align="center" height="11">
　<input type="submit" name="Submit" value="删 除" onClick="return test();">
          </td>
        </tr>
      </table>
</table>
</form>
<div align="center">
  <center>
  <table border="0" width="90%">
    <tr>
      <td width="100%" align="center"><%
  if page <>1 then
     Response.Write "<a href=admin_link.asp?id="&id&"&page=1>首页</a> "
  end if
  tmppage = page - 1 
  if tmppage <= 0 then 
     tmppage = 1 
  else
     Response.Write"<a href=admin_link.asp?id="&id&"&page="&tmppage&">上一页</a>"
  end if
  tmppage = page + 1 
  if tmppage >rs.PageCount then 
     tmppage = page
  else
     Response.Write " <a href=admin_link.asp?id="&id&"&page="&tmppage&">下一页</a> "
  end if 
  if Cstr(page) <> Cstr(rs.PageCount) and Cstr(rs.PageCount) <> 0 then
    Response.Write "<a href=admin_link.asp?id="&id&"&page="&rs.PageCount&">尾页</a>"
  end if
  if Cstr(rs.PageCount) <> 0 then
  Response.Write "每页显示<font color=red>20</font>条信息  第<font color='blue'>" & page & "/"&rs.PageCount&"</font>页"
  end if
  Response.Write "  共有<font color='blue'>"&rs.RecordCount&"</font>条信息"
 rs.close
%> </td>
    </tr>
  </table>
  </center>
</div>
<p>　</p>
<div align="center">
  <center>
<table border="1" width="98%" bordercolor="#183789" cellspacing="0" cellpadding="0" bordercolordark="#FFFFFF">
  <tr>
    <td width="100%">
      <table border="0" width="100%" height="1">
        <tr>
          <td width="100%" background="../images/admin_bg_1.gif" align="center" height="19"><font color="#FFFFFF"><b>添加友情站点</b></font></td>
        </tr>
        <tr>
          <td width="100%" height="1"><form name="myform" method="POST" action="save_link.asp?shjiaid=<%=rs_shjia("shjiaid")%>">
            <table border="0" width="100%" cellspacing="1" cellpadding="0">
              <tr>
                <td width="25%" bgcolor="#D6DBF7" align="center">网站名称</td>
                <td width="30%" bgcolor="#D6DBF7" align="center">
           LOGO图标地址</td>
                <td width="31%" bgcolor="#D6DBF7" align="center">
           链接地址</td>
                <td width="14%" bgcolor="#D6DBF7" align="center">添加</td>
              </tr>
              <tr>
                <td width="25%" bgcolor="#D6DBF7" align="center">
                  <input type="text" name="linkname" size="20">
                  </td>
                <td width="30%" bgcolor="#D6DBF7" align="center">
                  <input type="text" name="logourl" size="30">
                </td>
                <td width="31%" bgcolor="#D6DBF7" align="center">
                  <input type="text" name="url" size="30">
                </td>
                <td width="14%" bgcolor="#D6DBF7" align="center"><input type="submit" value="添加" name="B1"></td>
              </tr>
              </form>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
  </center>
</div>

</body>
<%end if%>



