<!--#include file="../siteconfig/conn.asp"-->
<%
if session("adminlogin")<>sessionvar then
Response.Write("<script language=javascript>alert('你尚未登录，或者超时了！请重新登录');this.location.href='login.asp';</script>")
Response.End
End if
%>
<!--#include file="Admin_UrlFunction.asp"-->
<HTML>
<HEAD>
<TITLE>分类管理</TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"> 
<LINK REL="stylesheet" HREF="css.css" TYPE="text/css">
</HEAD>
<script language="JavaScript" type="text/javascript" src="js.js"></script>
<BODY>
<%dim Menu,Url_Id,Url_Name,Url_Url,Url_Memo,Url_UrlClassId,Url_TopId
Url_Id=Request("Url_Id")
Url_Name=Request("Url_Name")
Url_Url=Request("Url_Url")
Url_Memo=Request("Url_Memo")
Url_UrlClassId=Request("Url_UrlClassId")
Url_TopId=Request("Url_TopId")
Menu=Request("Menu")
redim UrlArray(0,5)
if Menu="UpUrl" then
   rs.open"select * from Url where Url_Id="&Url_Id,conn,1,3
   if not rs.eof then
      rs("Url_Name")=Url_Name
	  rs("Url_Url")=Url_Url
	  rs("Url_Memo")=Url_Memo
	  rs("Url_UrlClassId")=Url_UrlClassId
	  rs("Url_TopId")=Url_TopId
   rs.update
   rs.close
   Response.Write("<script language=javascript>alert('网址修改成功');parent.window.location.reload();DivOpenClose('',2,0,0);</script>")
   Response.End()
   else
       Response.Write("<script language=javascript>alert('没有找在记录');UrlDivClose();</script>")
	   Response.End()
   end if
end if
rs.open"select * from Url where Url_Id="&Url_Id,conn,1,3
   UrlArray(j,0)=rs("Url_Id")
   UrlArray(j,1)=rs("Url_Name")
   UrlArray(j,2)=rs("Url_Url")
   UrlArray(j,3)=rs("Url_Memo")
   UrlArray(j,4)=rs("Url_UrlClassId")
   UrlArray(j,5)=rs("Url_TopId")
rs.close%>
<table width="100%" border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="#EEEEEE">
  <tr>
    <td width="45%">修改网址</td>
    <td width="55%" align="right"><a href="#" onClick="javascript:DivOpenClose('',2,0,0);return false">关闭</a></td>
  </tr>
</table>
<form name="UrlFrom" method="post" action="?Menu=UpUrl&Sx=1" id="UrlFrom" onSubmit="return UrlCheck();">
<table width="100%" border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="#EEEEEE">
  <tr bgcolor="#FFFFFF">
    <td>网址ID</td>
    <td><%=UrlArray(i,0)%><input name="Url_Id" type="hidden" value="<%=UrlArray(i,0)%>"></td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td>网站名称</td>
    <td><input name="Url_Name" type="text" class="inputcss" id="Url_Name" value="<%=UrlArray(i,1)%>" size="20"></td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td>网站URL</td>
    <td><input name="Url_Url" type="text" class="inputcss" id="Url_Url" value="<%=UrlArray(i,2)%>" size="20"></td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td>网站描术</td>
    <td><textarea name="Url_Memo" cols="20" class="inputcss" id="Url_Memo"><%=UrlArray(i,3)%></textarea></td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td>所属子分类</td>
    <td><select name="Url_UrlClassId" class="inputcss" id="Url_UrlClassId">
<%
rs.open "select UrlClass_Id,UrlClass_Name from UrlClass",conn,1,3
while not rs.eof
    if rs("UrlClass_Id")=UrlArray(j,4) then
	    response.write "<option value='"&rs("UrlClass_Id")&"' selected>"&rs("UrlClass_Name")&"</option>"
	else
		response.write "<option value='"&rs("UrlClass_Id")&"'>"&rs("UrlClass_Name")&"</option>"
	end if
	rs.movenext
wend
rs.close
%>
</select></td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td>推荐级别</td>
    <td><input name="Url_TopId" type="text" class="inputcss" id="Url_TopId" value="<%=UrlArray(i,5)%>" size="10"> 
    越高排越前,数字</td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td>&nbsp;</td>
    <td><input name="Submit" type="submit" class="SubmitCss" value="修改网址"></td>
  </tr>
</table>
</form>
</BODY>
</HTML>

