<%@ Page Language="c#" Inherits="Web.Wpdcc.managerBanner" CodeBehind="manageBanner.aspx.cs" %>

<!DOCTYPE html>
<!--[if lt IE 9]><html class="lte-ie8"><![endif]-->
<!--[if gt IE 8]><!-->
<html>
<!--<![endif]-->
<head>
    <title>横幅模板管理</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <!--#include file = "../Css/adminCssEdit.htm" -->

    <link rel="stylesheet" href="../Editor/WpdccEditor/themes/default/default.css" />
    <script type="text/javascript" src="../Editor/WpdccEditor/kindeditor.js"></script>
    <script type="text/javascript" src="../Editor/WpdccEditor/lang/zh_CN.js" charset="utf-8"></script>

    <script type="text/javascript" language="javascript">
    //自定义上传图片控件加载，支持自定义上传图片功能需先引用三个文件，[themes/default/default.css] [kindeditor.js] [lang/zh_CN.js]
			KindEditor.ready(function(K) {
				var editor = K.editor({
				    uploadJson : '../Editor/WpdccEditor/aspnet/upload_json.ashx',
				    fileManagerJson : '../Editor/WpdccEditor/aspnet/file_manager_json.ashx',
					allowFileManager : true
				});
				K('#uploadimg').click(function() {
					editor.loadPlugin('zdybanner', function() {
						editor.plugin.zdybannerDialog({
							zdybannerUrl : K('#bannerMaterial').val(),
							clickFn : function(url) {
								K('#bannerMaterial').val(url);
								editor.hideDialog();
								
							}
						});
					});
				});
				K('#uploadswf').click(function() {
					editor.loadPlugin('zdybannerswf', function() {
						editor.plugin.zdybannerswfDialog({
							zdybannerswfUrl : K('#bannerMaterial').val(),
							clickFn : function(url) {
								K('#bannerMaterial').val(url);
								editor.hideDialog();
								
							}
						});
					});
				});
				
			});
			
    </script>
    <script type="text/javascript">
        jQuery(function ($) {
            /*列表高度*/
            $('.function-bd').height($(window).innerHeight() - 100);

            $(window).resize(function () {
                $('.function-bd').height($(window).innerHeight() -100);
            });
        });
    function checkall()
    {
        //验证
        if (checkAllValidate()){
            return true ;
        }
        else
        {
            return false ;
        }
    }

    //防止用户恶意保存
    function checkok() {
        if (confirm("您确定要保存列表中的修改吗？") == true) {
            return true;
        }
        else {
            return false;
        }
    }
    </script>
</head>
<body>
    <div class="list-func-box func-box">
        <form id="system" method="post" runat="server">
        <div class="hd">
            <div class="breadcrumb">
                您的位置：网站模版设置 &gt;网站横幅模板管理
            </div>
            <!--/breadcrumb-->
            <div class="user-service">
                <%--<a class="help" href="#">帮助</a>--%>
            </div>
            <!--/user-service-->
        </div>
        <div class="bd">
            <div class="function-hd">
                <div class="action-field">
                    <asp:Button ID="ok" class="btn" runat="server" Text="保存列表" CausesValidation="False" OnClientClick="return checkok();" OnClick="ok_Click"></asp:Button>
                    &nbsp;
                    <asp:Button ID="add" class="btn" runat="server" Text="添 加" OnClientClick="return checkall()" OnClick="add_Click"></asp:Button>
                </div>
            </div>
            <div class="function-bd" style=" overflow: auto;">
            <asp:DataGrid ID="pageGrid" runat="server" AutoGenerateColumns="False" class="list-table">
                <Columns>
                    <asp:BoundColumn DataField="pkId" HeaderText="ID" HeaderStyle-CssClass="title"></asp:BoundColumn>
                    <asp:BoundColumn DataField="name" HeaderText="横幅名称" HeaderStyle-CssClass="title">
                    </asp:BoundColumn>
                    <asp:BoundColumn DataField="explain" HeaderText="说明" HeaderStyle-CssClass="title">
                    </asp:BoundColumn>
                    <asp:TemplateColumn HeaderText="效果预览" HeaderStyle-CssClass="title">
                        <ItemTemplate>
                            <asp:HyperLink ID="material" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.material") %>' Target="_blank" NavigateUrl='<%# DataBinder.Eval(Container, "DataItem.url") %>'></asp:HyperLink>
                        </ItemTemplate>
                    </asp:TemplateColumn>
                    <asp:TemplateColumn HeaderText="分组显示" HeaderStyle-CssClass="title">
                        <ItemTemplate>
                            <asp:TextBox ID="grouping" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.grouping") %>' CssClass="input-txt input-txt2">
                            </asp:TextBox>
                        </ItemTemplate>
                    </asp:TemplateColumn>
                    <asp:TemplateColumn Visible="False" HeaderText="是否随机" HeaderStyle-CssClass="title">
                        <ItemTemplate>
                            <asp:DropDownList ID="notInRandom" runat="server" SelectedIndex='<%# DataBinder.Eval(Container, "DataItem.notInRandom") %>'>
                                <asp:ListItem Value="0" Selected="True">否</asp:ListItem>
                                <asp:ListItem Value="1">是</asp:ListItem>
                            </asp:DropDownList>
                        </ItemTemplate>
                    </asp:TemplateColumn>
                    <asp:TemplateColumn HeaderText="执 行" HeaderStyle-CssClass="title">
                        <ItemTemplate>
                            <asp:LinkButton ID="edit" runat="server" CommandName="edit" CausesValidation="False" CssClass="FBox" title="编辑" href='<%# Eval("pkId","manageBannerEditor.aspx?pkId={0}")%>' ><i class="icon icon-pencil"></i></asp:LinkButton>
                            <asp:LinkButton ID="dell" runat="server" CausesValidation="False" CommandName="del1"
                                CommandArgument='<%# DataBinder.Eval(Container, "DataItem.name") %>' title="删除"><i class="icon icon-remove"></i></asp:LinkButton>
                            <asp:LinkButton ID="copyy" runat="server" CausesValidation="False" CommandName="copy1" title="复制"><i class="icon icon-06"></i></asp:LinkButton>
                        </ItemTemplate>
                    </asp:TemplateColumn>
                    <asp:BoundColumn Visible="False" DataField="isSystem" HeaderText="是否默认" HeaderStyle-CssClass="title">
                    </asp:BoundColumn>
                    <asp:BoundColumn Visible="False" DataField="adminId" HeaderText="adminId" HeaderStyle-CssClass="title">
                    </asp:BoundColumn>
                    <asp:BoundColumn Visible="False" DataField="url" HeaderText="url" HeaderStyle-CssClass="title">
                    </asp:BoundColumn>
                </Columns>
            </asp:DataGrid>
                </div>
            <table class="edit-table" style="display:none">
                <tr>
                    <td>
                        横幅名称：<asp:TextBox ID="bannerName" CssClass="input-txt1 input-txt" runat="server" msgName="横幅名称" MaxLength="50"></asp:TextBox>&nbsp;&nbsp;
                        说明：<asp:TextBox ID="bannerExplain" runat="server" CssClass="input-txt1 input-txt" MaxLength="50"></asp:TextBox>&nbsp;
                        分组显示：<asp:TextBox ID="bannerGrouping" runat="server" CssClass="input-txt2 input-txt" dataType="integer" maxValue="99999" minValue="0" msgName="分组显示">0</asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        链接地址：<asp:TextBox ID="bannerUrl" runat="server" CssClass="input-txt3 input-txt"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        横幅图片：<asp:TextBox ID="bannerMaterial" runat="server" CssClass="input-txt1 input-txt" msgName="横幅图片或者flash"></asp:TextBox>
                        <a id="uploadimg" href="#">上传图片</a>&nbsp;
                        <a id="uploadswf" href="#">上传flash</a>&nbsp;
                    </td>
                </tr>
            </table>
            <div >
                <div class="action-field txt-c">
                    <asp:HiddenField ID="HiddenFieldBannerId" runat="server" />
                </div>
            </div>
        </div>
        </form>
    </div>
</body>
</html>
