<!--#include file="../utf-8.asp" -->
<!--#include file="../js/Function.asp" -->
<!--#include file="../html/yidacms_htmlurl.asp" -->
<!--#include file="../js/admin_vipkp.asp" -->
<!--#include file="../CheckAdmin.asp" -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<META NAME="copyright" CONTENT="Copyright 2010-2012 - yidacms.com" />
<META NAME="Author" CONTENT="世纪伟成  yidacms.com" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="../js/admin.css" rel="stylesheet" type="text/css">
<title>广告配置！</title>
<link rel="stylesheet" href="../js/reveal.css">	
<script type="text/javascript" src="../js/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="../js/jquery.reveal.js"></script>
</head>
<body>
<%
'版权：世纪伟成(http://yidacms.com)
'本信息不会影响您网站的正常访问，无论免费用户或是收费用户请保留这里的信息.
'如果您删除了这里的版权信息,将追究法律责任.
		set rs = server.createobject("adodb.recordset")
		sql="select * from shuaiweb_ad WHERE id <> 1 ORDER BY id DESC"
		rs.open sql,dbok,1,1
%>
	<table width="98%" height="43" border="1"cellpadding="6" cellspacing="0" bordercolor="#cccccc" style="border-collapse:collapse" bgcolor="#FFFFFF" align="center">
            <tr>
              <td colspan="7"><a href="#" class="big-link" data-reveal-id="myModal">+ 创建文本广告</a> | <a href="admin_adt.asp">特效广告</a>
               </td>
             </tr>
		  <tr>
			<td bgcolor="#CCCCCC">调用标签</td>
			<td bgcolor="#CCCCCC">广告名称</td>
			<td bgcolor="#CCCCCC">创建时间</td>
			<td bgcolor="#CCCCCC">操作！</td>
		</tr>
<%
				if rs.bof and rs.eof then
					No_record = "暂无记录!"
						Else
		do while not rs.eof
%>
		<tr onMouseOver="this.id='aa'" onMouseOut="this.id='bb'" class="cc">
			<td>&lt;Yidacms_Ad:{leixing=<%=rs("id")%>}&gt;&lt;Yidacms_Ad&gt;</td>
			<td><%=rs("shuaiweb_adname")%></td>
			<td><%=rs("time")%></td>
			<td><a href="admin_adedit.asp?id=<%=rs("id")%>"><img src="../images/023.jpg" alt="修改"/></a> <a href="admin_ad.asp?t=del&id=<%=rs("id")%>"><img src="../images/015.gif" alt="删除" onclick="{if(confirm('确定删除它吗?')){return true;}return false;}"/></a></td>
		</tr>
<%
		rs.MoveNext 
		loop   
		End If
	rs.Close
	set rs=nothing 
%>
<tr>
                <td colspan="4"><%=No_record%></td>
</tr>
		</table>
               <br />
		<%


       		if request("t")="ad" Then
			if len(trim(request.Form("shuaiweb_adname")))<1 then
				response.write ("<script language=javascript> alert('名称必填且不能少于1个字符！');history.back(-1);</script>")
				response.end
			end if
		  
			if len(trim(request.Form("shuaiweb_adneirong")))<1 then
				response.write ("<script language=javascript> alert('内容不能为空，且不少于1个字符！');history.back(-1);</script>")
				response.end
			end if 
		  
		dim rs,sql
		set rs=server.createobject("adodb.recordset")
		sql="select * from shuaiweb_ad" 
		rs.open sql,dbok,3,2
		rs.addnew 
			rs("shuaiweb_adname")=trim(request.form("shuaiweb_adname"))
			rs("shuaiweb_adneirong")=trim(request.form("shuaiweb_adneirong"))
		rs.update
		rs.close
		set rs=nothing
		response.write "<script language=javascript> alert('成功添加！');location.replace('admin_ad.asp');</script>"
		response.end
		End If
%>
		<div id="myModal" class="reveal-modal">
		<table width="98%" height="100%" border="0"cellpadding="10" cellspacing="0" bordercolor="#666666" bgcolor="#FFFFFF" style="border-collapse:collapse" align="center">
		   <form id="form1" name="form1" method="post" action="admin_ad.asp?t=ad">
			<tr>
			  <td onMouseOver="this.id='aa'" onMouseOut="this.id='bb'" class="cc">广告名称<br /><input name="shuaiweb_adname" type="text" class="win"/> <font color=red>(必填)</font></td>
                        </tr>
			<tr>
			  <td width="90%" onMouseOver="this.id='aa'" onMouseOut="this.id='bb'" class="cc">广告内容<br /><textarea name="shuaiweb_adneirong" style="width:100%;height:290px;"></textarea><font color=red>(必填)</font></td>
			</tr>
			<tr>

			  <td><input type="submit" name="Submit" value="提交" class="inanniu"/>
			  <input type="reset" name="Submit2" value="重置" class="inanniu" /></td>
			</tr>
			</form>
		</table>
<a class="close-reveal-modal">&#215;</a>
		</div>

<%
		yidacms_id = cint(Request("id"))
 		if request("t")="del" Then 
		set rs = server.createobject("adodb.recordset")
		sql="DELETE * from shuaiweb_ad WHERE id= "&yidacms_id&""
		rs.open sql,dbok,3,2
		response.write "<script language=javascript> alert('成功删除！');location.replace('admin_ad.asp');</script>"
		End If 
%>
</body>
</html>
