<%@ Page Language="C#" AutoEventWireup="true" CodeFile="NewList.aspx.cs" Inherits="NewList" %>

<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
 <!DOCTYPE html>
<html>

<head>

   <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>50CMS后台框架</title>
    <link rel="shortcut icon" href="favicon.ico">
     <link href="../css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="../css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="../css/animate.css" rel="stylesheet">
    <link href="../css/style.css?v=4.1.0" rel="stylesheet">
    <link href="../css/plugins/iCheck/custom.css" rel="stylesheet">
</head>

<body class="gray-bg">
<form id="form1" runat="server" class="form-horizontal m-t">
    <div class="wrapper animated fadeInRight">
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>
                            内容管理</h5>
                        
                   
                        <div class="ibox-tools">
                            <a href="NewList.aspx" class="btn btn-primary btn-xs"><i class="fa fa-refresh"> &nbsp;&nbsp; 刷 新</i></a>
                            <a href="#" id="Add" class="btn btn-primary btn-xs"><i class="fa fa-plus"></i>&nbsp;&nbsp; 新增内容</a>

                      </div>
                    </div>
                    <div class="ibox-content">

                       <div class="form-group" >  
                         <div class="col-md-4" >
                               <div class="col-md-9" >
         <asp:TextBox ID="txtkey" runat="server" CssClass="form-control input-s-sm"  placeholder="内容标题关键字"></asp:TextBox> 
     </div>
                                   <div class="col-md-3" >
                                  
     <asp:LinkButton ID="LinkButton2" runat="server" onclick="LinkButton2_Click" CssClass='btn btn-primary btn-sm' ><i class="fa fa-search"></i>搜  索</asp:LinkButton>
     &nbsp;&nbsp;&nbsp;&nbsp;     
                          </div>        
                     </div>
                 
                  <div class="col-md-4" >
                      <lable class="col-md-3 control-label" >
          <i class="fa fa-server"></i>&nbsp;栏目：
                             </lable>
                          <div class="col-md-9" >
                          <asp:DropDownList ID="Classddl" runat="server" AutoPostBack="True"  CssClass="form-control input-s-sm"
      onselectedindexchanged="DropDownList1_SelectedIndexChanged"></asp:DropDownList>
                             </div>
                        </div>

               <div class="col-md-4" >
                   <lable class="col-md-3 control-label" >
           <i class="fa fa-filter"></i>&nbsp;属性：
                    </lable>
                   <div class="col-md-8" >
                   <asp:DropDownList ID="ddlProperty" runat="server"  CssClass="form-control"
                onselectedindexchanged="ddlProperty_SelectedIndexChanged" 
                AutoPostBack="True">
                <asp:ListItem Value="">所有属性</asp:ListItem>
                <asp:ListItem Value="IsTop">置顶</asp:ListItem>
                <asp:ListItem Value="IsRed">推荐</asp:ListItem>
                <asp:ListItem Value="IsHot">热门</asp:ListItem>
                <asp:ListItem Value="IsSlide">幻灯片</asp:ListItem>
                <asp:ListItem Value="IsVIP">会员文章</asp:ListItem>
            </asp:DropDownList>          
                          </div>
                    </div>
 </div>
                         <asp:Repeater ID="rptList" runat="server" OnItemCommand="rptList_ItemCommand">
                            <HeaderTemplate>
                                <table class="footable table table-stripped toggle-arrow-tiny" >
                                    <thead>
                                        <tr>
                                            <th align="center">选择</th>
                                            <th align="center">内容标题</th>
                                            <th align="left">栏目名称</th>
                                            <th align="center">发布时间 </th>       
                                            <th align="center">属性 </th>   
                                            <th align="center">操作 </th>                                                                       
                                        </tr>
                                    </thead>
                                    <tbody>
                            </HeaderTemplate>
                            <ItemTemplate>
                                <tr class="gradeX">

          <td ><asp:CheckBox ID="cb_id" CssClass="checkbox i-checks" runat="server" Text='<%#Eval("NId")%>' /></td>
        
        <td><a href="/pages_<%#Eval("Classid") %>_<%#Eval("NId")%>.aspx" target=_blank><%#Eval("Title")%></a></td>
       
         <td ><a title="<%# Eval("Classid")%>"><%# ToClassName(Convert.ToInt32(Eval("Classid")))%></a></td>
        <td  ><%#string.Format("{0:g}", Eval("Time"))%></td>
        <td>
                         
                                                                                                
           
          <asp:LinkButton ID="ibtnTop" CommandName="ibtnTop" CommandArgument='<%#Eval("NId")%>' runat="server" ToolTip='<%# Convert.ToBoolean(Eval("IsSlide"))? "设置置顶" : "取消置顶"%>'><%# Convert.ToBoolean(Eval("IsTop"))? "<span class='btn btn-warning btn-xs'><i class='fa fa-arrow-circle-up'></i> 顶</span>" : "<span class='btn btn-default btn-xs'><i class='fa fa-arrow-circle-up'></i> 顶</span>"%></asp:LinkButton>
          <asp:LinkButton ID="ibtnRed" CommandName="ibtnRed" CommandArgument='<%#Eval("NId")%>'  runat="server" ToolTip='<%# Convert.ToBoolean(Eval("IsRed"))? "取消推荐" : "设置推荐"%>'><%# Convert.ToBoolean(Eval("IsRed"))? "<span class='btn btn-warning btn-xs'><i class='fa fa-star'></i> 荐</span>" : "<span class='btn btn-default btn-xs'><i class='fa fa-star'></i> 荐</span>"%></asp:LinkButton>
          <asp:LinkButton ID="ibtnHot" CommandName="ibtnHot" CommandArgument='<%#Eval("NId")%>'  runat="server"  ToolTip='<%# Convert.ToBoolean(Eval("IsHot"))? "取消热门" : "设置热门"%>' ><%# Convert.ToBoolean(Eval("IsHot"))? "<span class='btn btn-warning btn-xs'><i class='fa fa-fire'></i> 热</span>" : "<span class='btn btn-default btn-xs'><i class='fa fa-fire'></i> 热</span>"%></asp:LinkButton>
          <asp:LinkButton ID="ibtnSlide" CommandName="ibtnSlide" CommandArgument='<%#Eval("NId")%>'  runat="server"   ToolTip='<%# Convert.ToBoolean(Eval("IsSlide"))? "设置图片" : "取消图片"%>'><%# Convert.ToInt32(Eval("IsSlide")) == 1 ? "<span class='btn btn-warning btn-xs'><i class='fa fa-image'></i> 图</span>" : "<span class='btn btn-default btn-xs'><i class='fa fa-image'></i> 图</span>"%></asp:LinkButton>
         <asp:LinkButton ID="ibtnlock" CommandName="ibtnLock" runat="server"  CommandArgument='<%#Eval("NId")%>'><%# Convert.ToBoolean(Eval("IsLock"))? "<span class='btn btn-danger btn-xs'><i class=fa fa-lock></i>锁定</span>" : "<span class='btn btn-info btn-xs'><i class='fa fa-check'></i>正常</span>"%></asp:LinkButton> &nbsp;
        
        </td>
        <td ><span><a onclick=EditNew(<%#Eval("NID") %>) class ="btn btn-info btn-xs"><i class="fa fa-pencil"></i>&nbsp;&nbsp;  修改</a></a> &nbsp;</span>



         <asp:LinkButton ID="LinkButton2" runat="server" CommandName="del" CommandArgument='<%#Eval("NId")%>' CssClass="btn btn-danger btn-xs" ><i class="fa fa-remove"></i>&nbsp;&nbsp;  删除</asp:LinkButton>
        </td>

                              

                                </tr>
                            </ItemTemplate>
                            <FooterTemplate>
                                </tbody>
       
                                </table>
                            </FooterTemplate>
                        </asp:Repeater>


                        
 <webdiyer:AspNetPager ID="AspNetPager1"  runat="server"  PageSize="10"  FirstPageText="首页"  LastPageText="末页" NextPageText="下一页" PrevPageText="上一页" AlwaysShow="true"  onpagechanging="AspNetPager1_PageChanging" CssClass="paginator"   CurrentPageButtonClass="cpb">

         </webdiyer:AspNetPager>
     <div class="spClear"></div>
      <div style="line-height:30px;height:30px;">
            <div id="Pagination" class="right flickr"></div>
            <div class="left">
                <span class="btn_all" id="btn1">全选</span>
                <span class="btn_all" id="btn2">取消</span>
                <span class="btn_all" id="btn3">复制</span>
                <span class="btn_all" id="btn4">移动</span>
                <%--<span class="btn_all" id="btn5">删除</span>--%>
            </div>
	</div>


                    </div>
                </div>
            </div>
        </div>
    </div>
    </form>



      <!-- 全局js -->
    <script src="../js/jquery.min.js?v=2.1.4"></script>
    <script src="../js/bootstrap.min.js?v=3.3.6"></script>

      <!-- 自定js -->

    <script src="../js/plugins/footable/footable.all.min.js" type="text/javascript"></script>
    <script src="../js/content.js" type="text/javascript"></script>
    <script type="text/javascript" src="../js/layer/layer.js"></script>

        <!-- iCheck -->
    <script src="../js/plugins/iCheck/icheck.min.js"></script>
    <script>
        $(document).ready(function () {
            $('.i-checks').iCheck({
                checkboxClass: 'icheckbox_square-green'

            });
        });
    </script>

    <script type="text/javascript">
        $(document).ready(function () { $(".footable").footable(); });
    </script>
    <script type="text/javascript">
 

        $(function () {
            $("#Add").click(function () {

            parent.layer.open({
                    type: 2,
                    title: '添加新内容',
                    shadeClose: true,
                    shade: 0.8,
                    area: ['100%', '100%'],
                    content: 'Add.aspx?CID=<%=classId%>',  //iframe的url
                    end: function () {

                        location.reload();

                    }
                });

            });

        });



        function EditNew(ID)
       {
            parent.layer.open({
               type: 2,
               title: '修改内容',
               shadeClose: true,
               shade: 0.8,
               area: ['100%', '100%'],
               content: 'Add.aspx?id=' + ID,  //iframe的url
               end: function () {

                   location.reload();

               }
           });
       }


        function popupWindow(mypage, myname, w, h, scroll) {
            var winl = (screen.width - w) / 2;
            var wint = (screen.height - h) / 2;
            winprops = 'height=' + h + ',width=' + w + ',top=' + wint + ',left=' + winl + ',scrollbars=' + scroll + ',resizable'
            win = window.open(mypage, myname, winprops)
            if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
        }


        $(function () {
            $(".footable tr:nth-child(odd)").addClass("tr_bg"); //隔行变色
            $(".footable tr").hover(
                  function () {
                      $(this).addClass("tr_hover_col");
                  },
                  function () {
                      $(this).removeClass("tr_hover_col");
                  }
              );


            //全选
            $("#btn1").click(function () {
                $(".i-checks input:checkbox").attr("checked", true);

                $(".icheckbox_square-green").addClass("checked");



            });
            //取消
            $("#btn2").click(function () {
                $(".i-checks input:checkbox").attr("checked", false);

                $(".icheckbox_square-green").removeClass("checked");
            });
            //复制
            $("#btn3").click(function () {
                -$(".i-checks input:checked").each(function () {
                    allid += $(this).next("label").html() + "-";
                });
                popupWindow('copy.aspx?ids=' + allid, '复制', 400, 300, 1);
            });
            //移动
            $("#btn4").click(function () {
                var allid = "";
                $(".i-checks input:checked").each(function () {
                    allid += $(this).next("label").html() + "-";
                });
                popupWindow('move.aspx?ids=' + allid, '移动', 400, 300, 1);
            });
        });


    </script>
 
</body>
</html>

