<%
Action=request("action")
if Action="" then 
%>
<form action="main.asp?adminjob=addad&action=save" method="post">
<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#A3BFE8">
  <tr>
    <td height="20" colspan="2" align="center" bgcolor="#E9F1F8">广告发布</td>
  </tr>
  <tr>
    <td height="20" colspan="2" align="center" bgcolor="#FFFFFF">&nbsp;</td>
  </tr>
  
  <tr>
    <td height="20" align="center" bgcolor="#E9F1F8">广告标题</td>
    <td align="left" bgcolor="#E9F1F8"><input name="txt_title" type="text" id="txt_title"  style="width:400px" size="45"/></td>
  </tr>
  <tr>
    <td height="20" align="center" bgcolor="#E9F1F8">发布时间</td>
    <td align="left" bgcolor="#E9F1F8"><input name="txt_time" type="text" id="txt_time"  style="width:400px" size="45" value="<%=date()%>"/></td>
  </tr>
  <tr>
    <td height="20" align="center" bgcolor="#E9F1F8">广告位置</td>
    <td align="left" bgcolor="#E9F1F8"><label>
    <select name="txt_top" id="txt_top" style="width:400px">
      <option value="head" selected="selected">顶部</option>
      <option value="middle">中间</option>
      <option value="bottom">尾部</option>
    </select>
    </label></td>
  </tr>
  <tr>
    <td width="21%" height="20" align="center" bgcolor="#E9F1F8">
	<textarea name="txt_content" cols="40" rows="5" style="display:none"></textarea>
广告内容</td>
    <td width="79%" align="left" bgcolor="#E9F1F8"><iframe id="eWebEditor" src="../webdesign/ewebeditor.asp?id=txt_content&style=webluoye" frameborder="0" scrolling="no" width="90%" height="350"> </iframe></td>
  </tr>
  <tr>
    <td height="20" colspan="2" align="center" bgcolor="#E9F1F8">&nbsp;</td>
  </tr>
  <tr>
    <td height="20" colspan="2" align="center" bgcolor="#E9F1F8"><label>
      <input type="submit" name="Submit" value="发布广告">
    </label></td>
  </tr>
</table>
</form>
<%else%>
<%
Title=server.HTMLEncode(trim(request("txt_title")))
Ttime=server.HTMLEncode(trim(request("txt_time")))
Ttop=request("txt_top")
wContent=request("txt_content")
if wContent="" then 
response.write "<script>alert('信息提示：\n\n内容不能为空！');history.go(-1);</Script>"
else
Set rs = Server.CreateObject("ADODB.Recordset")
sql="select * from WebAd"
rs.open sql,conn,1,3 
rs.addnew
rs("a_title")=Title
rs("a_time")=Ttime
rs("a_content")=wContent
rs("a_top")=Ttop
rs.update
rs.close
set rs=nothing
response.write "<script language='javascript'>alert('信息提示：\n\n操作成功!');location='main.asp?adminjob=addad';</script>"
end if
%>
<%end if%>