<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="A.aspx.cs" Inherits="Maticsoft.Web.Admin.A.A"
    MasterPageFile="~/MasterPage.master" EnableEventValidation="false" Title="新闻管理" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

    <script src="../../js/Common.js" type="text/javascript"></script>

    <script language="javascript" type="text/javascript">
   function showBtype()
	{
	var strUrl="../B/ajax/showB1.aspx?paperName="+escape(document.getElementById("<%=DropDownList1.ClientID %>").value);
		Ajaxs.GET(strUrl,showtypeexist);
		
	}
	function showtypeexist(req)
	{
	
		var text = req.responseText;
	
		var d = text.split(',');
		
		document.getElementById("<%=DropDownList2.ClientID %>").options.length=0;
        document.getElementById("<%=DropDownList2.ClientID %>").options.add(new Option("全部","全部"));
	
		for (i=0;i<d.length;i++)
		{
		if(d[i]!=""){
		document.getElementById("<%=DropDownList2.ClientID %>").options.add(new Option( d[i],d[i]));
		}
		
		}
		document.getElementById("<%=HiddenField1.ClientID %>").value=document.getElementById("<%=DropDownList2.ClientID %>").value;
	
	}
	function changeqnum()
	{
	document.getElementById("<%=HiddenField1.ClientID %>").value=document.getElementById("<%=DropDownList2.ClientID %>").value;
	}
    </script>

    <table width="98%" border="0" align="center" cellpadding="5" cellspacing="1">
        <tr>
            <td>
                <fieldset>
                    <legend class="tt1">新闻管理</legend>
                    <table width="100%" border="0" cellpadding="2" cellspacing="0">
                        <tr>
                            <td>所属报纸:</td>
                            <td>
                                <asp:DropDownList ID="DropDownList1" runat="server" onchange="showBtype()">
                                </asp:DropDownList>
                            </td>
                            <td>所属期号:</td>
                            <td>
                                <asp:DropDownList ID="DropDownList2" runat="server" onchange="changeqnum()">
                                </asp:DropDownList>
                            </td>
                            <td align="left">关键字:</td>
                            <td>
                                <asp:TextBox ID="txtKeyWords" runat="server" Width="80px"></asp:TextBox>
                            </td>
                            <td>
                                <asp:Button ID="Button1" runat="server" CssClass="button2" Text="查询" OnClick="Button1_Click" />
                            </td>
                            <td>
                                <asp:Button ID="Button3" runat="server" CssClass="button22" Text="批量生成静态页" 
                                   OnClientClick="return window.confirm('确定要重新生成满足条件的新闻的静态页吗?')" 
                                    onclick="Button3_Click" />
                            </td>
                            <td><asp:Button ID="Button2" runat="server" CssClass="button22" Text="删除该报该期所有新闻" ForeColor="Red"
                                    OnClick="Button2_Click" OnClientClick="return window.confirm('确定要删除满足条件的新闻吗?')" />
                            </td>
                        </tr>
                    </table>
                    <div id="List" runat="server">
          </div>
                    <table width="98%" border="0" align="center" cellpadding="5" cellspacing="1">
                        <tr>
                            <td height="50" valign="middle" align="center">
                                <div id="CopyrightInfo" runat="server">
                                </div>
                            </td>
                        </tr>
                    </table>
                </fieldset>
            </td>
        </tr>
    </table>

    <script language="javascript" type="text/javascript">
function Del(id,url)
{
    if(confirm('你确认删除此新闻吗?'))
    {
        self.location="?Action=Del&ID="+id+"&htmlurl="+url;
    }
}

function Edit(id)
{
    self.location="Modify.aspx?id="+id;
}
 function delAll() {
   if(confirm('你确认删除所选新闻吗?'))
    {
    var ids="";
    
    for (var i = 0; i < document.getElementsByName("selectFlag").length; i++) {
     if(document.getElementsByName("selectFlag")[i].checked){
    if(document.getElementsByName("selectFlag")[i].value.split(",").length>0){
    ids+=document.getElementsByName("selectFlag")[i].value.split(",")[0]+","+document.getElementsByName("selectFlag")[i].value.split(",")[1]+"|";
   
}    }
   
  }
  self.location="?Action=Dels&ID="+ids;
        
    }
  
 }
    </script>

    <asp:HiddenField ID="HiddenField1" runat="server" />
    <asp:HiddenField ID="HiddenField_select" runat="server" />
    <asp:HiddenField ID="HiddenField_specialRole" runat="server" />
</asp:Content>
