<%@ page language="C#" autoeventwireup="true" inherits="WebAdmin_ArticleList, LebiMall" %>
<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<!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 rel="stylesheet" type="text/css" href="css/css.css" media="screen"/>
    <script type="text/javascript" language="javascript" src="js/topHead.js"></script>
    <script src="js/checked.js" type="text/javascript"></script>
    <link href="css/tipswindown.css" type="text/css" rel="stylesheet" />
    <script src="js/jquery.js" type="text/javascript"></script>
    <script src="js/tipswindown.js" type="text/javascript"></script>
    <script type="text/javascript" src="js/My97DatePicker/WdatePicker.js"></script>
    <script type="text/javascript">
        var page='<%=page %>';
        function edit(id){
            window.location.href="ArticleEdit.aspx?id="+id;
        }
        function updates(){

            var list=document.getElementsByName("check_");
            var cch="";
            for(i=0;i<list.length;i++)
            {
                if(list[i].checked==true){
                    cch+="1,";
                }else{
                    cch+="0,";
                }
            }
            document.getElementById("hid_i").value=cch;
            document.getElementById("form1").submit();
        }
        function dels(){
            var form =document.forms[0];
            var strid="";
            if (confirm("确认要删除？")) {
                var list=document.getElementsByName("check_");
                for(i=0;i<list.length;i++)
                {
                    if(form.elements[i].type=="checkbox")
                    {
                        if(list[i].checked==true){
                            strid+=list[i].value+",";
                        }
                    }
                }
                if(strid!="")
                window.location.href="Articlem.aspx?strid="+strid+"&type=dels&page="+page;
            }
        }
        function topt(){
            var form =document.forms[0];
            var strid="";
            if (confirm("确认要删除？")) {
                var list=document.getElementsByName("check_");
                for(i=0;i<list.length;i++)
                {
                    if(form.elements[i].type=="checkbox")
                    {
                        if(list[i].checked==true){
                            strid+=list[i].value+",";
                        }
                    }
                }
                if(strid!="")
                window.location.href="Articlem.aspx?strid="+strid+"&type=topt&page="+page;
            }
        }
        function reco(){
            var strid="";
            if (confirm("确认要删除？")) {
            var list=document.getElementsByName("check_");
                for(i=0;i<list.length;i++)
                {
                    if(form.elements[i].type=="checkbox")
                    {
                        if(list[i].checked==true){
                            strid+=list[i].value+",";
                        }
                    }
                }
                if(strid!="")
                window.location.href="Articlem.aspx?strid="+strid+"&type=reco&page="+page;
            }
        }
        function agree(){
            var form =document.forms[0];
            var strid="";
            if (confirm("确认要批准？")) {
                for(i=0;i<form.elements.length;i++)
                {
                    if(form.elements[i].type=="checkbox")
                    {
                        if(form.elements[i].checked==true){
                            strid+=form.elements[i].value+",";
                        }
                    }
                }
                if(strid!="")
                window.location.href="Articlem.aspx?strid="+strid+"&type=agree&page="+page;
            }
        }
    </script>
</head>
<body>
    <form id="form1" name="form1" method="post" runat="server">
        <input type=hidden id="hid_i" runat="server" />
        <div id="dhtmltooltip"><img src=""></div>
        <script type="text/javascript" language="javascript" src="js/js_link.js"></script>
        <script>header(5,0,"images/");</script>
        <div class="blank clearfix"></div>
        <!--功能区-->
        <div class="tabmenus mainwidth">
            <ul>    
                <li class="current"><a href="articlelist.aspx"><span>文章管理</span></a></li>
                <li><a href="ArticleSelect.aspx"><span>文章查询</span></a></li>
                <li><a href="ArticleAdd.aspx"><span>文章添加</span></a></li>
            </ul>
        </div>
        <div class="tab-mainbody">
            <div class="tab-mainbody2">
                <div class="functionHandleArea clearfix" style="padding:3px 0 3px 4px">
                    <table cellspacing=0 cellpadding=0>
                        <tr>
                            <td>操作：
                                <input type="checkbox" name="top" id="top" runat="server" />头条
                                <input type="checkbox" name="rec" id="rec" runat="server"/>推荐
                                <input type="checkbox" name="arg" id="arg" runat="server"/>审核
                            </td>
                        </tr>
                        <tr>
                            <td  style="height:30px;">
                                <input type="image" title=" 保存 " onclick="updates();return false;" src="images/bt_app.gif" align="absmiddle">
                                <input type="image" title=" 删除 " onclick="dels();return false;" src="images/bt_delete.gif"  align="absmiddle">
                            </td>
                        </tr>
                    </table>
                    </div>
                <div id="datalist">
                    <table cellspacing="0" border="0" id="list" style="width: 100%; border-collapse: collapse;">
                    <!-- table 导航 -->
                        <tr>
                        <th style="width: 5%; cursor: pointer;" title="全选" onclick="AllChecked()">
                            选择</th>
                        <th style="width: 35%">
                            标题</th>
                        <th style="width: 10%">
                            用户
                        </th>
                        <th style="width: 5%">
                            图文
                        </th>
                        <th style="width: 5%">
                            类别
                        </th>
                        <th style="width: 5%">
                            头条
                        </th>
                        <th style="width: 5%">
                            推荐
                        </th>
                        <th style="width: 5%">
                            审批
                        </th>
                        <th style="width: 5%">
                            浏览
                        </th>
                        <th style="width: 15%">
                            时间
                        </th>
                        <th style="width: 5%">
                            操作
                        </th>
                        </tr>
                        <%for (int i = 0; i < ds.Tables[0].Rows.Count; i++){%>
                        <tr>
                            <td>
                                <input type="checkbox" value="<%=ds.Tables[0].Rows[i]["id"] %>" name="check_" id="cch<%=i %>" />
                                <input type="hidden" id="hidden_id<%=i %>" name="hidden_id<%=i %>" value="<%=ds.Tables[0].Rows[i]["id"] %>" />
                            </td>
                            <td>
                                <input type="text" id="txt_title<%=i %>" name="txt_title<%=i %>" value="<%=ds.Tables[0].Rows[i]["atitle"] %>"
                                    class="input" style="width:300px" />
                            </td>
                            <td>
                                <%if (ds.Tables[0].Rows[i]["uname"].ToString()!=""){ %><%=ds.Tables[0].Rows[i]["uname"] %><%}else{%>管理员<%} %>
                            </td>
                            <td>
                                <%if (ds.Tables[0].Rows[i]["aimg"].ToString() != "")
                                  { %>
                                <img src="../images/kind-pic001.jpg" align='absmiddle' onmouseover="javascript:ddrivetip('<div class=hideimg><img src=../Upload/article/<%=ds.Tables[0].Rows[i]["aimg"] %>></div>', '#ffffff', '150')"
                                    onmouseout="hideddrivetip()" /><%} %>&nbsp;
                            </td>
                            <td>
                                <%=ds.Tables[0].Rows[i]["atname"] %>
                            </td>
                            <td>
                               <%if (ds.Tables[0].Rows[i]["atop"].ToString()=="1") {%><img src="images/succes.gif" /><%}else{ %><img src="images/error.gif" /><%} %>
                            </td>
                            <td>
                               <%if (ds.Tables[0].Rows[i]["arec"].ToString()=="1") {%><img src="images/succes.gif" /><%}else{ %><img src="images/error.gif" /><%} %>
                            </td>
                            <td>
                               <%if (ds.Tables[0].Rows[i]["agr"].ToString()=="1") {%><img src="images/succes.gif" /><%}else{ %><img src="images/error.gif" /><%} %>
                            </td>
                            <td>
                                <input type="text" id="txt_count<%=i %>" name="txt_count<%=i %>" value="<%=ds.Tables[0].Rows[i]["acount"] %>"
                                    class="input" style="width: 40px;" onkeyup="value=value.replace(/[^\d]/g,'')"
                                    onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))" />
                            </td>
                            <td class="class">
                                <input type="text" id="txt_time<%=i %>" name="txt_time<%=i %>" value="<%=ds.Tables[0].Rows[i]["Submittime"] %>"
                                    class="texttime" style="width:120px" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',skin:'whyGreen',autoPickDate:'null'})" />
                            </td>
                            <td>
                                <a href="javascript:edit(<%=ds.Tables[0].Rows[i]["id"] %>)">编辑</a>
                            </td>
                        </tr>
                        <%} %>
                        <tr>
                            <td class="list-foot" colspan="11">
                                <div style="float: left; padding-top: 3px;">
                                </div>
                                <div id="divAsp" runat="server" style="float: right; padding-top: 3px;">
                                    <webdiyer:AspNetPager CssClass="pages" CurrentPageButtonClass="cpb" ID="AspNetPager1"
                                        runat="server" RecordCount="228" FirstPageText="首页" LastPageText="尾页" NextPageText="下一页"
                                        PrevPageText="上一页" PageSize="20" UrlPaging="True" CustomInfoClass="pages1" CurrentPageButtonPosition="Center" ShowBoxThreshold="50"
                                        ShowFirstLast="true" NumericButtonCount="4" BackColor="Transparent" ShowDisabledButtons="False" EnableViewState="False">
                                    </webdiyer:AspNetPager>
                                </div>
                            </td>
                        </tr>
                    </table>
                    <script type="text/javascript">tdshowm("list");</script>
                </div>
            </div>
        </div>
    </form>
</body>
</html>
