<%@ 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/head.htm" -->
    <link rel="stylesheet" href="../Wpedt/WpdccEditor/themes/default/default.css" />
</head>
<body>
    <div class="main-content-inner">
        <!-- #section:basics/content.breadcrumbs -->
        <div class="breadcrumbs" id="breadcrumbs">
            <ul class="breadcrumb">
                <li>
                    <i class="ace-icon fa  fa-desktop"></i>
                    <a href="welcome.aspx">主页</a>
                </li>
                <li>模板管理
                </li>
                <li class="active">网站横幅</li>
            </ul>
            <!-- /.breadcrumb -->

            <!-- /section:basics/content.searchbox -->
        </div>
        <!-- /section:basics/content.breadcrumbs -->
        <div class="page-content">
            <div class="row">
                <div class="col-xs-12">
                    <!-- PAGE CONTENT BEGINS -->
                    <div class="list-func-box func-box">
                        <form id="system" method="post" runat="server">
                            <!--/breadcrumb-->
                            <div class="tabbable">
                                <ul class="nav nav-tabs" id="myTab4">
                                    <li>
                                        <a aria-expanded="false" href="manageTempMenu.aspx" data-toggle="tab">菜单模版</a>
                                    </li>
                                    <li>
                                        <a aria-expanded="true" href="manageVisualArtDesign.aspx" data-toggle="tab">栏目模版</a>
                                    </li>
                                    <li class="active">
                                        <a aria-expanded="true" href="manageBanner.aspx" data-toggle="tab">网站横幅</a>
                                    </li>
                                </ul>
                            </div>
                            <div class="bd tab-content">
                                <div class="page-header clearfix">
                            <div class="action-field">
                                        <asp:Button ID="ok" class="btn btn-sm btn-primary" runat="server" Text="保存列表" CausesValidation="False" OnClientClick="return checkok();" OnClick="ok_Click"></asp:Button>
                                        &nbsp;
                    <asp:Button ID="add" class="btn btn-sm btn-primary" runat="server" Text="添 加" OnClientClick="return checkall()" ></asp:Button>
                                    </div>
                                </div>
                                <div class="function-bd" style="overflow: auto;">
                                    <asp:DataGrid ID="pageGrid" runat="server" AutoGenerateColumns="False" class="table table-striped table-bordered table-hover">
                                        <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-md">
                                                    </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>
                                                    <div class="action-buttons">
                                                    <asp:LinkButton ID="edit" runat="server" CommandName="edit"  CssClass="Fbox" href='<%# Eval("pkId","manageBannerEditor.aspx?pkId={0}")%>' data-toggle="tooltip" data-placement="bottom"  title="编辑" ><i class="ace-icon fa fa-pencil bigger-120 blue"></i></asp:LinkButton>
                                                    <asp:LinkButton ID="copyy" runat="server" CausesValidation="False" CommandName="copy1" data-toggle="tooltip" data-placement="bottom" title="复制"  CssClass=" hidden-xs action-buttons blue"><i class="ace-icon fa fa-copy bigger-120 orange"></i></asp:LinkButton>
                                                    <asp:LinkButton ID="dell" runat="server" CausesValidation="False" CommandName="del1" CommandArgument='<%# DataBinder.Eval(Container, "DataItem.name") %>' data-toggle="tooltip" data-placement="bottom" title="删除"  ><i class="ace-icon fa fa-trash-o bigger-120 red"></i></asp:LinkButton>
                                                </div>
                                                        </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-md" runat="server" msgName="横幅名称" MaxLength="50"></asp:TextBox>&nbsp;&nbsp;
                        说明：<asp:TextBox ID="bannerExplain" runat="server" CssClass="input-md" MaxLength="50"></asp:TextBox>&nbsp;
                        分组显示：<asp:TextBox ID="bannerGrouping" runat="server" CssClass="input-md w2" dataType="integer" maxValue="99999" minValue="0" msgName="分组显示">0</asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>链接地址：<asp:TextBox ID="bannerUrl" runat="server" CssClass="input-md w3"></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>横幅图片：<asp:TextBox ID="bannerMaterial" runat="server" CssClass="input-md" 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 text-center">
                                        <asp:HiddenField ID="HiddenFieldBannerId" runat="server" />
                                    </div>
                                </div>
                            </div>
                        </form>

                    </div>
                    <!-- PAGE CONTENT ENDS -->
                </div>
            </div>
        </div>
        <!-- /.page-content -->
    </div>

    <!--#include file = "../Css/foot.htm" -->

    <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: '../Wpedt/WpdccEditor/aspnet/upload_json.ashx',
                fileManagerJson: '../Wpedt/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">

        function checkall() {
            //验证
            if (checkAllValidate()) {
                return true;
            }
            else {
                return false;
            }
        }

        //防止用户恶意保存
        function checkok() {
            if (confirm("您确定要保存列表中的修改吗？") == true) {
                return true;
            }
            else {
                return false;
            }
        }
        $(document).ready(function () {
            $("#add").click(function () {
            }).fancybox({
                'width': 680,
                'height': 650,
                'AutoSize': false,
                'type': 'iframe',
                'padding': '0',
                'href': 'manageBannerEditor.aspx?pkId=0'
            });

        })
        jQuery(function ($) {
            $(".Fbox").click().fancybox({
                'width': 680,
                'height': 520,
                'AutoSize': false,
                'type': 'iframe',
                'padding': '0'
            });
        })
    </script>
</body>
</html>
