<%@ Page Language="C#" EnableViewState="false" AutoEventWireup="true" CodeBehind="NewsList2.aspx.cs" Inherits="Forum.Web.Admin.Body.NewsList2" %>

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

<!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="../styles/dntmanager.css" rel="stylesheet" type="text/css" />
<link href="../styles/page2.css" rel="stylesheet" type="text/css" />
<style>
.ckall
{
 display:block; height:21px; padding-top:9px; cursor:pointer;
}
#apDiv1 {
	width:360px;
	height:278px;
	border: 2px solid #CCCCCC;
	background-color: #FFFFFF;
	display: inline;
}
.tu_title {
	text-align: center;
	background-color: #f1f1f1;
	font-weight: bold;
}
.tu_content {
	height: 255px;
	text-align: center;
	line-height: 255px;
}
.tu_content img {
	padding: 2px;
	border: 1px solid #CCCCCC;
	margin-top: 6%;
}
.index_bk_01 {
	border: 1px solid #CCCCCC;
	height: 22px;
	line-height: 22px;
}
</style>
</head>
<script src="../js/public.js" type="text/javascript"></script>
<script src="../js/HBDivBox.js" type="text/javascript"></script>
<body>
<div id="apDiv1" style=" display:none;">
      <div class="tu_title">本内容所使用的缩略图</div>
      <div class="tu_content"><img  id="body_tu" src="../../WebSite_Sex/images/2008103016540785_S.jpg" width="280" height="200" /></div>
    </div>
    
<form id="form1" runat="server">
<div class="ManagerForm">
		<fieldset>
		    <legend style="background:url(../images/icons/icon10.jpg) no-repeat 6px 50%;">文章列表</legend>

        
<div class="MainDiv">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
                           <td height="40px;">  &nbsp; 所属分类:
                             <select id="f_mululist0" runat="server" onchange="showifr(this.value);" style=" width:150px;">
                               </select>
<label for="sh_0" style="padding:0px; margin:0px;" ><input  type="checkbox" name="checkbox" runat="server"  onclick="showurl();"  id="sh_0">待审核的</label>
<label for="sh_1" style="padding:0px; margin:0px;" ><input  type="checkbox" name="checkbox" runat="server"  onclick="showurl();"  id="sh_1">已推荐的</label>
<label for="sh_3" style="padding:0px; margin:0px;" ><input  type="checkbox" name="checkbox" runat="server"  onclick="showurl();"  id="sh_3">有缩略图</label>
<label for="sh_2" style="padding:0px; margin:0px;" ><input  type="checkbox" name="checkbox" runat="server"  onclick="showurl();"  id="sh_2">访问排序</label>
  <label>从<input name="textfield" type="text" id="text1" runat="server" class="index_bk_01" style="width:65px;" title="输入起始日期,如:2008-12-25">到<input name="textfield" type="text"  id="text2" runat="server"  class="index_bk_01"  style="width:65px;"  title="输入结束日期,如:2008-12-26"></label>
</td>
        <td width="200" style="display:;">

<input name="textfield" type="text"  id="textfield" runat="server"  class="index_bk_01"  style="width:120px;">
                              <input name="button" type="button"class="index_bk_01" id="button" value="搜  索" onclick="showurl();" style="background-color:White;"></td>
        <td>&nbsp;</td>
                           <td>&nbsp;</td>
                         </tr>
<script  type="text/javascript">
function showifr(mid)
{
    showurl();
    
    //hbctl_.$("ifr").src="NewsList2.aspx?mid="+mid+"&k="+hbctl_.GetRound();
}
function showurl()
{
    var mid_=hbctl_.GetValueOrTextBySelectID("f_mululist0","value");
    var tf_sh = hbctl_.$("sh_0").checked; //审核
    var tf_jh = hbctl_.$("sh_1").checked; //推荐
    var tf_time = hbctl_.$("sh_2").checked; //按访问排行
    var tf_tu = hbctl_.$("sh_3").checked; //有缩略图的

    var tf_key = hbctl_.$("textfield").value; //推荐
    var tf_stime = hbctl_.$("text1").value;
    var tf_ntime = hbctl_.$("text2").value;
    
    var url = "NewsList2.aspx?mid=" + mid_ + "&k=" + hbctl_.GetRound() + "&tf_sh=" + tf_sh + "&tf_jh=" + tf_jh + "&tf_time=" + tf_time + "&tf_tu=" + tf_tu;
    if (tf_key.length > 0 && tf_key != " ") {
        url = url + "&tf_key=" + encodeURI(tf_key);
    }
    if (tf_stime.length > 7) {
        url = url + "&tf_stime=" + tf_stime;
    }
    if (tf_ntime.length > 7) {
        url = url + "&tf_ntime=" + tf_ntime;
    }
    
    window.location = url;
}
</script>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#EAE9E1">
<tr bgcolor="#F2F2F2">
    <td height="2" colspan="11" bgcolor="#CCCCCC"></td>
    </tr>




  <tr bgcolor="#F2F2F2">
    <td width="50" height="35"><strong>
      <input type="checkbox" name="checkbox" id="checkbox"   onclick="sall(this);"/>
    <label for="checkbox" style="padding:0px; margin:0px;" >全选</label>
    </strong></td>
    <td><strong>&nbsp;文章标题</strong></td>
    <td width="35" align="center"><strong>类型</strong></td>
    <td width="70" align="center"><strong>管理操作</strong></td>
    <td width="35" align="center"><strong>审核</strong></td>
    <td width="35" align="center"><strong>置顶</strong></td>
    <td width="35" align="center"><strong>推荐</strong></td>
    <td width="35" align="center"><strong>锁定</strong></td>
    <td width="50" align="center"><strong>录入者</strong></td>
    <td width="100" align="center" bgcolor="#F2F2F2"><strong>添加日期</strong></td>
    <td width="70" align="center" bgcolor="#F2F2F2"><strong>访问/评论</strong></td>
  </tr>

    <cc1:Repeater ID="Repeater1" runat="server">
   <ItemTemplate>
  <tr>
    <td height="30" bgcolor="#FFFFFF" align=center ><label for="Checkbox_list_<%#Eval("Body_ID") %>" class="ckall"><input id="Checkbox_list_<%#Eval("Body_ID") %>" value="<%#Eval("Body_ID") %>" name="Checkbox_list" type="checkbox" /></label></td>
    <td bgcolor="#FFFFFF" <%#JSStr(Eval("Body_TFTu"),Eval("Body_Tu")) %> onmouseout="hideimgurl()"> &nbsp;<a href="NewsList2.aspx?mid=<%#Eval("Body_MuLuID") %>">[<%#GetMuLuName(Eval("Body_MuLuID"))%>]</a><a href="ShowNews.aspx?id=<%#Eval("Body_ID") %>" ><%#Eval("Body_Name").ToString().Length > 30 ? Eval("Body_Name").ToString().Substring(0, 28) + "..." : Eval("Body_Name")%></a></td>
    <td bgcolor="#FFFFFF" align="center"><IMG src="../images/jpg_<%#Eval("Body_Lenght")%>.gif" /></td>
    <td align="center" bgcolor="#FFFFFF"><a href="AddNews.aspx?id=<%#Eval("Body_ID") %>"><img alt="编辑此信息" src="../images/icon_edit.gif" /></a> &nbsp;&nbsp;&nbsp; <a href="javascript:del_date(<%#Eval("Body_ID") %>)"><img alt="删除此信息" src="../images/icon_del.gif" /></a></td>
    <td align="center" bgcolor="#FFFFFF"><a href="javascript:update2_(<%#Eval("Body_ID") %>,<%#Eval("Body_IsApproved").ToString() == "1" ? "6" : "5"%>)"><img src='../images/check_<%#Eval("Body_IsApproved")%>.gif' /></a></td>
    <td align="center" bgcolor="#FFFFFF"><a href="javascript:update2_(<%#Eval("Body_ID") %>,<%#Eval("Body_ZhiDing").ToString() == "1" ? "2" : "1"%>)"><img src='../images/check_<%#Eval("Body_ZhiDing")%>.gif' /></a></td>
    <td align="center" bgcolor="#FFFFFF"><a href="javascript:update2_(<%#Eval("Body_ID") %>,<%#Eval("Body_JingHua").ToString() == "1" ? "4" : "3"%>)"><img src='../images/check_<%#Eval("Body_JingHua")%>.gif' /></a></td>
    <td align="center" bgcolor="#FFFFFF"><a href="javascript:update2_(<%#Eval("Body_ID") %>,<%#Eval("Body_SuoDing").ToString() == "1" ? "9" : "8"%>)"><img src='../images/check_<%#Eval("Body_SuoDing")%>.gif' /></a></td>
    <td align="center" bgcolor="#FFFFFF"><%#Eval("Body_AddName")%></td>
    <td width="100" align="center" bgcolor="#FFFFFF"><%#Eval("Body_AddTime","{0:yyyy-M-d HH:mm}")%></td>
    <td align="center" bgcolor="#FFFFFF"><%#Eval("Body_FangWen")%>/<%#Eval("Body_HuiFu")%></td>
    </tr>    
    </ItemTemplate>
    </cc1:Repeater>
</table>
<br />
<script type="text/javascript">
var mid_=<%#mid %>;

function showimgtu(imgurl)
{
    hbctl_.$("body_tu").src=imgurl;
    HBDivBox.time=600000;
    HBDivBox.Show2("apDiv1");
}
function hideimgurl()
{
    HBDivBox.Remove2("apDiv1");
    hbctl_.$("body_tu").src="/";
}
function edit(id_)
{
    window.location="AddNews.aspx?id="+id_;
}
function sall(this_)
{
    if(this_.checked)
    {
        hbctl_.CheckBoxAllByName("Checkbox_list",true);
    }
    else
    {
        hbctl_.CheckBoxAllByName("Checkbox_list",false);
    }
}
function EditByFL()
{
    var item=hbctl_.$$("Checkbox_list");
    var mid_=hbctl_.GetValueOrTextBySelectID("f_mululist","value");

    if(mid_!=-1 && hbctl_.GetValueOrTextBySelectID("f_mululist","text").toString().indexOf("　")!=-1)
    {
        if(item.length>0)
        {
            var msg_=confirm("您确定要调整选中信息的所属分类");
            if(msg_){
                for(var i=0;i<item.length;i++)
                {
                    var id_=item[i].value;
                    if(item[i].checked==true)
                    {
                        var rvalue=Forum.Web.Admin.Body.NewsList2.EditByFL(id_, mid_).value;
                    }
                }
                document.location.reload();
            }
            else
            {
                hbctl_.$("f_mululist").value="-1";//恢复选择的分类
            }
        }
    }
    else
    {
        alert('请选择要调整的分类');
        hbctl_.$("f_mululist").value=-1;
    }
}
function del_date(id_)
{
    var tf_tf=window.confirm('您确定要删除选择的信息?');
    if(tf_tf)
    {
        Forum.Web.Admin.Body.NewsList2.update_(id_, 0);
        document.location.reload();
    }
}
function update2_(id_,type_)
{
        var rvalue=Forum.Web.Admin.Body.NewsList2.update_(id_, type_).value;
        document.location.reload();
}
function update_()
{
    var item=hbctl_.$$("Checkbox_list");
    var type_=hbctl_.GetValueOrTextBySelectID("id_cz","value");

    if(type_!=-1)
    {
        var tf_tf=false;
        if(type_==0)
        {
            tf_tf=window.confirm('您确定要删除选择的信息?');
        }
        else{
            tf_tf=true;
        }
        
        if(item.length>0 && tf_tf)
        {
            for(var i=0;i<item.length;i++)
            {
                var id_=item[i].value;
                if(item[i].checked==true)
                {
                    var rvalue=Forum.Web.Admin.Body.NewsList2.update_(id_, type_).value;
                }
            }
            document.location.reload();
        }
    }
    else
    {
        alert('请选择操作');
    }
}
</script>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td  height="30">
	  管理选项：
	  <select name="act" id="id_cz" onchange="update_()">
		<option value="-1">请选择操作</option>
		<option value="0">批量删除</option>
		<option value="1">批量置顶</option>
		<option value="2">取消置顶</option>
		<option value="3">批量推荐</option>
		<option value="4">取消推荐</option>
		<option value="5">批量审核</option>
		<option value="6">取消审核</option>
		<option value="8">批量锁定</option>
		<option value="9">取消锁定</option>
		<option value="7">更新时间</option>
	  </select>

调整分类:
      <asp:DropDownList ID="f_mululist" runat="server" onchange="EditByFL();"> </asp:DropDownList></td>
  </tr>
  <tr>
    <td  height="30" align="right">
        <asp:Label ID="Label1" runat="server" ></asp:Label></td>
  </tr>
</table>
		</fieldset>
        <div class="Navbutton" style="display:none;">
11111111111111111
        </div>
        </div>
</form>
</body>
</html>
