<%@ Page Language="C#" MasterPageFile="MasterPage.Master" AutoEventWireup="true" CodeBehind="Ad.aspx.cs" Inherits="SocoShop.Web.Admin.Ad" %>
<%@ Register Namespace="SkyCES.EntLib" Assembly="SkyCES.EntLib" TagPrefix="SkyCES"%>
<%@ Import Namespace="SocoShop.Common" %>
<asp:Content ID="MasterContent" ContentPlaceHolderID="ContentPlaceHolder" runat="server">	
<div class="position"><img src="/Admin/Style/Images/PositionIcon.png"  alt=""/>广告列表</div>	
<div class="listBlock">
    <ul>
        <li id="TextAd" <%if(classID==1){%>class="listOn"<%} %>><a href="Ad.aspx?ClassID=1">文字广告</a></li>
        <li id="PictureAd" <%if(classID==2){%>class="listOn"<%} %>><a href="Ad.aspx?ClassID=2">图片广告</a></li>
        <li id="FlashAd" <%if(classID==3){%>class="listOn"<%} %>><a href="Ad.aspx?ClassID=3">Flas广告</a></li>
        <li id="CodeAd" <%if(classID==4){%>class="listOn"<%} %>><a href="Ad.aspx?ClassID=4">代码广告</a></li>
    </ul>	
</div>
<ul class="listHead">	
	<li style="width:5%">ID</li>
    <li style="width:40%; text-align:left;text-indent:8px;">标题</li>    
    <li style="width:10%">宽 X 高</li>		 
    <li style="width:20%">有效时间</li>	
    <li style="width:10%">调用代码</li>
    <li style="width:10%">点击数</li>	 
    <li style="width:5%">管理</li>	  
</ul>
<asp:Repeater ID="RecordList" runat="server">
	<ItemTemplate>
		<ul class="listMain" onmousemove="ChangeColor(this,'#FFFDD7')" onmouseout="ChangeColor(this,'#FFF')">				
			<li style="width:5%"><%# Eval("ID")%></li>
            <li style="width:40%; text-align:left;text-indent:8px;height:30px; overflow:hidden"><%# Eval("Title")%></li>            
            <li style="width:10%"><%# Eval("Width")%> X <%# Eval("Height")%></li>		 
            <li style="width:20%"><%# Convert.ToDateTime(Eval("StartDate")).ToShortDateString()%> 到 <%# Convert.ToDateTime(Eval("EndDate")).ToShortDateString()%></li>	
            <li style="width:10%"><a href="javascript:CopyText('<%# ShopCommon.GetAdFile(Eval("ID").ToString()) %>')"><strong><font color="blue">点击获取</font></strong></a></li>	
            <li style="width:10%"><%#Eval("ClickCount")%></li>
            <li style="width:5%">
                <a href="javascript:pop('AdRecord.aspx?AdID=<%# Eval("ID") %>',800,600,'广告记录','AdRecord<%# Eval("ID") %>')"><img src="Style/Images/list.gif" alt="广告记录" title="广告记录" /></a>
                <a href="javascript:pop('AdAdd.aspx?ClassID=<%=RequestHelper.GetQueryString<int>("ClassID")%>&ID=<%# Eval("ID") %>',800,600,'广告修改','AdAdd<%# Eval("ID") %>')"><img src="Style/Images/edit.gif" alt="修改" title="修改" /></a> 
            </li>    
		</ul>
	</ItemTemplate>
</asp:Repeater>
<div class="listPage"><SkyCES:CommonPager ID="MyPager" runat="server" /></div>
<div class="action">
        <input type="button"  value=" 添 加 " class="button"  onclick="pop('AdAdd.aspx',800,600,'广告添加','AdAdd')"/>
</div>

<script language="javascript" type="text/javascript">    
    function CopyText(fileName)
    {
	    var isMinIE4 = (document.all) ? 1 : 0;
	    var isMinIE5 = (isMinIE4 && navigator.appVersion.indexOf("5.") >= 0) ? 1 : 0;
	    if ( isMinIE5 )
	    {
	        var js="<script language=\"javascript\" src=\"" + fileName + "\" type=\"text/javascript\"><\/script>";
		    window.clipboardData.setData("Text", js);
		    alert("复制成功！请粘贴到您所需要的位置中。\n内容如下：\n" + js);
		    return;
	    }	    
    }
</script>
</asp:Content>
