<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="DataList.aspx.cs" Inherits="RM.Web.Training.DataStatistics.DataList" EnableEventValidation="false" %>

<%@ Register Src="~/UserControl/LoadButton.ascx" TagName="LoadButton" TagPrefix="uc2" %>
<%@ Register Src="~/UserControl/PageControl.ascx" TagName="PageControl" TagPrefix="uc1" %>
<!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 runat="server">
    <title>
        <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("DataList_Title")%></title>
    <link href="/Themes/Styles/Site.css" rel="stylesheet" type="text/css" />
    <script src="/Themes/Scripts/jquery-1.8.2.min.js" type="text/javascript"></script>
    <script src="/Themes/Scripts/FunctionJS.js" type="text/javascript"></script>
    <script src="/Themes/Scripts/jsAddress.js" type="text/javascript"></script>
</head>
<body>
    <form id="form1" runat="server">
    <div class="btnbartitle">
        <div>
            <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("DataList_Title")%>
        </div>
    </div>
    <div class="btnbarcontetn">
        <div style="float: left; height: auto;">
           <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("DataList_ExamPlan")%>:
            
            <asp:DropDownList runat="server" ID="ExamPlanKey" AutoPostBack="True" OnSelectedIndexChanged="ExamPlanKey_SelectedIndexChanged">
            </asp:DropDownList>

            <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Role_Form_ssbm")%>：
            
            <asp:DropDownList runat="server" ID="ClassInfo" AutoPostBack="True"  OnSelectedIndexChanged="ClassInfo_SelectedIndexChanged">
                        </asp:DropDownList>

             <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("User_Name")%>:<input type="text" style="width:120px;" id="Uname" runat="server" />             
             <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("user_area")%>:
            
           <select id="Province" runat="server" ></select>
           <select id="City" runat="server" ></select>
           <select id="Area" runat="server" ></select>

                <input type="text" style="display:none;"  id="txtProvince" runat="server" />
                <input type="text" style="display:none;" id="txtCity" runat="server" />
                <input type="text" style="display:none;" id="txtArea" runat="server" />


            <asp:Button Text="" id="Unnamed1" runat="server" OnClick="Unnamed1_Click" />

            <asp:Button ID="daochu" Text="" runat="server" OnClick="daochu_Click" />
            <input type="button" value="异步" onclick="yibudaochu();" style="display:none;" />
        </div>
        <div style="text-align: right">
            <%--<uc2:LoadButton ID="LoadButton1" runat="server" />--%>
                    <a class="button green" onclick="lookExam_ExamPlan_PersonalData();" title="<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("ExamHistory_ExamPlanListlookdata")%>"><span class="icon-botton"
                style="background: url('/Themes/images/16/mail.png') no-repeat scroll 0px 4px;">
            </span><%=RM.Common.DotNetConfig.LanguageHelper.GetKey("ExamHistory_Listlookdata")%></a>
        </div>
    </div>
    <div class="div-body">
        <table class="grid" id="table1" cellspacing="0" cellpadding="0" border="0" data-graph-type="column" data-graph-container="#container">
            <thead>
            <th></th>
                <th style="display:;">事业部</th>

                <th data-graph-hidden="1" title="<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("User_Code")%>">
                    <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("User_Code")%>
                </th>
                <th data-graph-hidden="1" title="<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("User_Name")%>">
                    <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("User_Name")%>
                </th>
                <%--<th data-graph-hidden="1" title="登陆账号">
                    登陆账号
                </th>--%>
                <th data-graph-hidden="1" title="<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("mail_emailname")%>">
                    <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("mail_emailname")%>
                </th>
                <th data-graph-hidden="1" title="<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Phone")%>">
                    <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Phone")%>
                </th>
                
                <th><%=RM.Common.DotNetConfig.LanguageHelper.GetKey("user_prov")%></th>
                <th><%=RM.Common.DotNetConfig.LanguageHelper.GetKey("user_city")%></th>
                <th><%=RM.Common.DotNetConfig.LanguageHelper.GetKey("user_area")%></th>

                <th data-graph-hidden="1" title=" <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("DataList_YNian")%>">
                    <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("DataList_YNian")%>
                </th>
                <th data-graph-hidden="1" title="  <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("DataList_QiZhi")%>">
                    <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("DataList_ExamPlan")%>
                </th>
                
                <%=Titile %>
                <th><%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Role_Form_ssbm")%></th>
                <th data-graph-hidden="1" title=" <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("DataList_org")%>">
                    <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("DataList_org")%>
                </th>
                <th data-graph-hidden="1" title="<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("DataList_All")%>">
                    <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("DataList_All")%>
                </th>
                
            </thead>
            <tbody>
                <%=TableHtml %>
            </tbody>
        </table>
    </div>
    <uc1:PageControl ID="PageControl1" runat="server" />
    </form>
    <script type="text/javascript">
        $(function () {
            //把分页定位到屏幕下面
            divresize(90);
            FixedTableHeader("#table1", $(window).height() - 121);
            addressInit('Province', 'City', 'Area', '选项省', '选项市', '选项区');
        })
        <%=script %>
        function mouover(obj) {
            //试卷名
            var value = $(obj).attr("data");
            //分数
            var fen = $(obj).html();

            $(obj).attr("data", fen);
            $(obj).html(value);

        }
        function yibudaochu()
        {
            var exam = $("#ExamPlanKey").val(); // 考试计划
            var ClassInfo = $("ClassInfo").val();   //部门
            var name = $("#Uname").val();   //姓名
            var Province = $("#txtProvince").val(); //地区
            var City = $("#txtCity").val();    //县
            var Area = $("#txtArea").val();    //区
            if(exam == null || exam =="" || exam == undefined)
            {
                showTipsMsg('<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("ExportTitle") %>', 3000, 3);
                return;
            }
//            $.post("ExportExcel.ashx",
//                {exam:exam,ClassInfo:ClassInfo,name:name,Province:Province,City:City,Area:Area},
//                    success: function(data){
//                        if(data != null){Daochu(data);}  
//                    }
//            );

            getAjax("ExportExcel.ashx",{exam:exam,ClassInfo:ClassInfo,name:name,Province:Province,City:City,Area:Area},function(data){                
                Daochu(data)
            });

        }
        function mouout(obj) {
            //试卷名
            var value = $(obj).html();
            //分数
            var fen = $(obj).attr("data");
            $(obj).attr("data", value);
            $(obj).html(fen);
        }
        //导出
        function Daochu(data) {
                var html =data;
                post('/RMBase/SysWindows/WindowsExport.ashx', { ExportType: "not", ExportHTML: html, TableName: "result" });
                    
//            GoTableExport("not", "table1");
        }
      
        //提交数据，下载导出文件
        function post(URL, PARAMS) {
            var temp = document.createElement("form");
            temp.action = URL;
            temp.method = "post";
            temp.style.display = "none";
            for (var x in PARAMS) {
                var opt = document.createElement("textarea");
                opt.name = x;
                opt.value = PARAMS[x];
                //alert(opt.name);      
                temp.appendChild(opt);
            }
            document.body.appendChild(temp);
            temp.submit();
            return temp;
        }
        function lookExam_ExamPlan_PersonalData() {

    var data = $("#ExamPlanKey").val();
        var arrt = new Array();
        arrt = CheckboxValue().split('|');
        var key = arrt[0];
        if (IsEditdata(CheckboxValue())) {
            var url = "/Training/DataStatistics/ExamPlan_PersonalData.aspx?EPkey=" + data+"&&userid="+key;
            window.location = url;
        }
        }
    </script>
</body>
</html>
