<%
    //-----------------------------------------------------------
    // 文件名称: Advertisement_Ads_Operate.aspx
    // 页面名称: 广告连接点击统计
    //
    // 描    述:
    //
    // 创建标识: Add By 吕鑫 2008-05-14
    // 修改标识: Mod By 吴建春 2008-09-22
    //-----------------------------------------------------------
%>

<%@ page language="C#" autoeventwireup="true" inherits="V5Shop.Admin.Advertisement_Ads_Operate, V5Shop.Shop.Advertisement" enableviewstatemac="false" enableEventValidation="false" viewStateEncryptionMode="Never" %>

<%@ Register Assembly="V5Shop.Control" Namespace="V5Shop.Control" TagPrefix="cc1" %>

<%@ Register Src="control/PageBottom.ascx" TagName="PageBottom" TagPrefix="uc1" %>
<!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 id="Head1" runat="server">
    <title>广告编辑</title>
    <link href="css/css.css" rel="stylesheet" type="text/css">
    <link href="css/css_list.css" rel="stylesheet" type="text/css">
    <link href="css/control.css" rel="stylesheet" type="text/css">
    <link href="js/calendar-system.css" rel="stylesheet" type="text/css" />
    <script language="javascript" src="js/Common.js" type="text/javascript"></script>
    <script language="javascript" src="js/Control_Calendar.js" type="text/javascript"></script>
</head>
<body>
    <form id="form1" runat="server">
    <div class="OperateTitle">
        <div>
            <asp:Label ID="lblTitleAdd" runat="server" Text="【 广告信息添加 】"></asp:Label> 
            <asp:Label ID="lblTitleEdit" runat="server" Text="【 广告信息编辑 】" Visible="false"></asp:Label> 
            <a href="Advertisement_Ads_Manage.aspx" title="返回广告列表">返回列表</a>
        </div>
    </div>
    
    <div>
        <table id="OperateTable" runat="server" width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
                <td width="20%" height="30" align="right" bgcolor="#FFFFFF">
                    <asp:Label ID="lblName" runat="server" Text="广告分类："></asp:Label> 
                </td>
                <td bgcolor="#FFFFFF" align=left>
                    <asp:TextBox ID="txtCategoryID" runat="server" Width="300px"></asp:TextBox>
                    <input type="button" value="请选择广告类别" class="button" onclick="OpenDialogAdsCategory('txtCategoryID')" />
                    <span class="NeedMsg">*</span>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" ControlToValidate="txtCategoryID" runat="server" ErrorMessage="不能为空"></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td width="20%" height="30" align="right" bgcolor="#FFFFFF">
                    <asp:Label ID="Label1" runat="server" Text="广告名称："></asp:Label> 
                </td>
                <td bgcolor="#FFFFFF" align=left>
                    <asp:TextBox ID="txtName" runat="server" Width="300px" MaxLength="50"></asp:TextBox>  
                    <span class="NeedMsg">*</span>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" ControlToValidate="txtName" runat="server" ErrorMessage="不能为空"></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td width="20%" height="30" align="right" bgcolor="#FFFFFF">
                </td>
                <td bgcolor="#FFFFFF" align=left>
                    <asp:Label ID="lblWidth" runat="server" Text="广告宽度："></asp:Label> 
                    <asp:TextBox ID="txtWidth" runat="server" Text="0" Width="60px"></asp:TextBox>  <span class="NeedMsg">*</span>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator6" ControlToValidate="txtWidth" runat="server" ErrorMessage="不能为空" Display="Dynamic"></asp:RequiredFieldValidator>
                    <asp:Label ID="lblHeight" runat="server" Text="广告高度："></asp:Label> 
                    <asp:TextBox ID="txtHeight" runat="server" Text="0" Width="60px"></asp:TextBox>  <span class="NeedMsg">*</span>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator4" ControlToValidate="txtHeight" runat="server" ErrorMessage="不能为空" Display="Dynamic"></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td width="20%" height="30" align="right" bgcolor="#FFFFFF">
                    <asp:Label ID="lblMark" runat="server" Text="广告备注："></asp:Label> 
                </td>
                <td bgcolor="#FFFFFF" align=left>
                    <asp:TextBox ID="txtRemark" runat="server" TextMode="MultiLine" Width="300px" Height="60px"></asp:TextBox> 
                    <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="txtRemark"
                            Display="Dynamic" ErrorMessage="长度必须在250字以内" ValidationExpression="^[\s\S]{0,250}$"></asp:RegularExpressionValidator></td>
            </tr>
            <tr>
                <td width="20%" height="30" align="right" bgcolor="#FFFFFF">
                    <cc1:helpctrl id="HelpCtrl1" runat="server" fontcolor="red" header="开始时间" imageurl="images/help.gif"
                        text="广告开始的时间，如果此时间晚于当前时间，则广告不会显示。"></cc1:helpctrl>
                    <asp:Label ID="Label7" runat="server" Text="开始时间："></asp:Label> 
                </td>
                <td bgcolor="#FFFFFF" align=left>
                    <asp:TextBox ID="txtStartDate" runat="server" Width="200px"></asp:TextBox>  
                    <img id="sltStart" src="images/calendar1.gif" title="打开日历" alt="打开日历" align="absmiddle" /><span class="NeedMsg">*</span>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator9" ControlToValidate="txtStartDate" runat="server" ErrorMessage="不能为空"></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td width="20%" height="30" align="right" bgcolor="#FFFFFF">
                    <cc1:helpctrl id="HelpCtrl2" runat="server" fontcolor="red" header="结束时间" imageurl="images/help.gif"
                        text="广告结束的时间，如果已到结束时间，则广告自动不会显示。"></cc1:helpctrl>
                    <asp:Label ID="Label8" runat="server" Text="结束时间："></asp:Label> 
                </td>
                <td bgcolor="#FFFFFF" align=left>
                    <asp:TextBox ID="txtEndDate" runat="server" Width="200px"></asp:TextBox>  
                    <img id="sltEnd" src="images/calendar1.gif" title="打开日历" alt="打开日历" align="absmiddle" /><span class="NeedMsg">*</span>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator10" ControlToValidate="txtEndDate" runat="server" ErrorMessage="不能为空"></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td width="20%" height="30" align="right" bgcolor="#FFFFFF">
                    <cc1:helpctrl id="HelpCtrl3" runat="server" fontcolor="red" header="是否开启" imageurl="images/help.gif"
                        text="如果不开启此项，即便在前台调用，广告也不会显示"></cc1:helpctrl>
                    <asp:Label ID="Label9" runat="server" Text="是否开启："></asp:Label> 
                </td>
                <td bgcolor="#FFFFFF" align=left>
                    <asp:CheckBox ID="cbIsAct" runat="server" CssClass="checkboxaspx" Text="是" />
                </td>
            </tr>
            <tr>
                <td width="20%" height="30" align="right" bgcolor="#FFFFFF">
                    <asp:Label ID="Label10" runat="server" Text="广告编号："></asp:Label> 
                </td>
                <td bgcolor="#FFFFFF" align=left>
                    <asp:TextBox ID="txtMark" runat="server" Width="300px" Enabled="false"></asp:TextBox> 
                    <asp:Label ID="Label4" runat="server" Text="该编号由系统自动生成"></asp:Label> 
                </td>
            </tr>
            <tr>
                <td width="20%" height="30" align="right" bgcolor="#FFFFFF">
                    <cc1:helpctrl id="HelpCtrl4" runat="server" fontcolor="red" header="广告类型" imageurl="images/help.gif"
                        text="可选择类型有普通广告、幻片广告、文字广告、背景广告。"></cc1:helpctrl>
                    <asp:Label ID="Label2" runat="server" Text="广告类型："></asp:Label> 
                </td>
                <td bgcolor="#FFFFFF" align=left>
                    <asp:DropDownList ID="ddlAdsType" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlAdsType_SelectedIndexChanged"></asp:DropDownList>
                    <span class="NeedMsg">*</span>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator3" ControlToValidate="txtName" runat="server" ErrorMessage="不能为空"></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td width="20%" height="30" align="right" bgcolor="#FFFFFF"></td>
                <td bgcolor="#FFFFFF" align=left>
                    <asp:Button ID="btnAdd" runat="server" Text="确定" CssClass="button" OnClick="btnAdd_Click" />
                    <asp:Button ID="btnEdit" runat="server" Text="更新" CssClass="button" OnClick="btnEdit_Click" Visible="False" />
                    <input id="iptReset" runat="server" type="reset" class="button" value="重置" />    
                    <input id="Button1" runat="server" type="button" value="返回列表" onclick="window.location.href='Advertisement_Ads_Manage.aspx'" class="button"/>
                </td>
            </tr>
        </table>
        <script type="text/javascript">
            //加TABLE样式
            InitTrClass();
            //加载日期控件
            Calendar.setup({
	            inputField     :    "txtStartDate",
	            ifFormat       :    "%Y-%m-%d", 
	            button         :    "sltStart",
	            align          :    "Br",
	            singleClick    :    true
            });
            Calendar.setup({
	            inputField     :    "txtEndDate",
	            ifFormat       :    "%Y-%m-%d", 
	            button         :    "sltEnd",
	            align          :    "Br",
	            singleClick    :    true
            });
            
            //打开模式对话框（图片选择）
            function OpenDialogPage(obj){
                if (navigator.appVersion.indexOf("MSIE") == -1){
                    this.returnAction=function(strResult){
                        if(strResult!=null){
                            document.getElementById(obj).value = strResult;
                        }
                    }
                    window.open('Template_Picture_Manage_Dialog.aspx?d=' + Date(),'newWin','modal=yes,width=550,height=550,top=200,left=300,resizable=no,scrollbars=no');
                    return;
                }else{
                    var GetValue = showModalDialog('Template_Picture_Manage_Dialog.aspx?d=' + Date(),'','dialogWidth:550px;dialogHeight:550px;')
                    if (GetValue != null) {
                        var reg = new RegExp("(Template/<%=path %>/)","gi");
                        document.getElementById(obj).value = GetValue.replace(reg, "");
                    } 
                }
            }
        </script> 
    </div>
    
    <uc1:PageBottom ID="PageBottom1" runat="server" />
    </form>
</body>
</html>
