<!--#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_ClassFunction.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,IndexAd_Id,IndexAd_Title,IndexAd_StartTime,IndexAd_EndTime,IndexAd_Html,IndexAd_Label
IndexAd_Id=Request("IndexAd_Id")
IndexAd_Title=Request("IndexAd_Title")
IndexAd_StartTime=Request("IndexAd_StartTime")
IndexAd_EndTime=Request("IndexAd_EndTime")
IndexAd_Html=Request("IndexAd_Html")
IndexAd_Label=Request("IndexAd_Label")
Menu=Request("Menu")
redim ClassArray(0,5)
if Menu="UpIndexAd" then
   rs.open"select * from IndexAd where IndexAd_Label='"&IndexAd_Label&"'",conn,1,3
   if not rs.eof and not rs.bof then
      if rs("IndexAd_Id")<>int(IndexAd_Id) then
          Response.Write("<script language=javascript>alert('该标签名已存在');javascript:history.go(-1)</script>")
	      Response.End()
	  end if
   end if
   rs.close
   rs.open"select * from IndexAd where IndexAd_Id="&IndexAd_Id,conn,1,3
   if not rs.eof then
	  rs("IndexAd_Title")=IndexAd_Title
	  rs("IndexAd_StartTime")=IndexAd_StartTime
	  rs("IndexAd_EndTime")=IndexAd_EndTime
	  rs("IndexAd_Html")=IndexAd_Html
	  rs("IndexAd_Label")=IndexAd_Label
   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('没有找在记录');DivOpenClose('',2,0,0);</script>")
   end if
end if
rs.open"select * from IndexAd where IndexAd_Id="&IndexAd_Id,conn,1,3
   ClassArray(j,0)=rs("IndexAd_Id")
   ClassArray(j,1)=rs("IndexAd_Title")
   ClassArray(j,2)=rs("IndexAd_StartTime")
   ClassArray(j,3)=rs("IndexAd_EndTime")
   ClassArray(j,4)=rs("IndexAd_Html")
   ClassArray(j,5)=rs("IndexAd_Label")
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="IndexAdFrom" method="post" action="?Menu=UpIndexAd" id="IndexAdFrom" onSubmit="return IndexAdCheck();">
<table width="100%" border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="#EEEEEE">
  <tr bgcolor="#FFFFFF">
    <td>广告ID</td>
    <td><%=ClassArray(i,0)%><input name="IndexAd_Id" type="hidden" value="<%=ClassArray(i,0)%>"></td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td>广告名称</td>
    <td><input name="IndexAd_Title" type="text" class="inputcss" id="IndexAd_Title" value="<%=ClassArray(i,1)%>" size="15"></td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td>开始时间</td>
    <td><input name="IndexAd_StartTime" type="text" class="inputcss" id="IndexAd_StartTime" value="<%=ClassArray(i,2)%>" size="15">
      时间格式 如:2008-11-11 </td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td>结束时间</td>
    <td><input name="IndexAd_EndTime" type="text" class="inputcss" id="IndexAd_EndTime" value="<%=ClassArray(i,3)%>" size="15"> 
    时间格式 如:2008-11-11 不设就是长久广告 </td>
  </tr>
  
  <tr bgcolor="#FFFFFF">
    <td>广告HTML</td>
    <td><textarea name="IndexAd_Html" cols="30" rows="5" class="inputcss" id="IndexAd_Html"><%=ClassArray(i,4)%></textarea> 支持HTML和JS</td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td>广告标签</td>
    <td><input name="IndexAd_Label" type="text" class="inputcss" id="IndexAd_Label" value="<%=ClassArray(i,5)%>" size="30"> 
    如：$Site_Div$</td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td>&nbsp;</td>
    <td><input name="Submit" type="submit" class="SubmitCss" value="修改广告"></td>
  </tr>
</table>
</form>
</BODY>
</HTML>

