<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ExaminationPaper_List.aspx.cs"
    Inherits="RM.Web.Training.TrainingTest.ExaminationPaper_List" %>

<%@ Register Src="~/UserControl/PageControl.ascx" TagName="PageControl" TagPrefix="uc1" %>
<%@ Register Src="~/UserControl/LoadButton.ascx" TagName="LoadButton" TagPrefix="uc2" %>
<!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("ChapterIndex_sjlb")%></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>
    <link href="../../Themes/Scripts/artDialog/skins/opera.css" rel="stylesheet" type="text/css" />
    <script src="../../Themes/Scripts/artDialog/artDialog.js" type="text/javascript"></script>
    <script src="../../Themes/Scripts/artDialog/iframeTools.js" type="text/javascript"></script>
    <script src="/Themes/Scripts/FunctionJS.js" type="text/javascript"></script>
    <script src="../../Themes/Scripts/jQuery.lightMenu-1.0.0.min.js" type="text/javascript"></script>
    <style type="text/css">
        #handleIcon { display: none; background: url("../Images/loading.gif") no-repeat scroll 7px 2px #FFFFFF; left: 45%; padding: 6px 5px 6px 40px; position: absolute; top: 45%; z-index: 3000; }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div class="btnbartitle">
        <div>
            <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("ChapterIndex_sjlb")%>
        </div>
    </div>
    <div class="btnbarcontetn">
        <div style="text-align: left; float: left;">
            <asp:DropDownList ID="ddlSelect" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlSelect_SelectedIndexChanged">
            </asp:DropDownList>
        </div>
        <div style="text-align: right; float: right;">
            <uc2:LoadButton ID="LoadButton1" runat="server" />
            <%--<a class="button green" title="编辑顺序" onclick="editsort();"><span style='background: url("/Themes/images/16/edit.png") no-repeat 0px 4px;' class="icon-botton"></span>编辑顺序</a>--%>
        </div>
    </div>
    <div class="div-body">
        <%=TableHtml%>
    </div>
    <uc1:PageControl ID="PageControl1" runat="server" />
    </form>
    <div id="handleIcon">
        <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("UserRight_chuli")%></div>
    <script type="text/javascript">
        $(function () {
            //把分页定位到屏幕下面
            divresize(120);
            FixedTableHeader("#table1", $(window).height() - 121);
        })

        //批量编辑题目
        function editQuestionByExam() {
            var arrt = new Array();
            arrt = CheckboxValue().split('|');
            var key = arrt[0];
            if (IsEditdata(CheckboxValue())) {
                var isRandomExam = false;
                $('[type = checkbox]').each(function () {
                    if ($(this).attr("checked")) {
                        
                        var index = $("#table1>thead>tr>td[title='<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("exam_readm")%>']").index();
                        if ($(this).parent().parent().children('td').eq(index).text() == "<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("S")%>") {
                            isRandomExam = true;
                        }
                    }
                });

                if (isRandomExam)
                    showTipsMsg('<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Exam_notpledit")%>', 2000, 3);
                else {
                    window.parent.location = "/Training/TrainingTest/TrainingTest_AddQuestions.aspx?key=" + key;
                }
            }
        }

        //新增
        function add() {
            var url = "/Training/TrainingTest/TrainingTest_AddQuestions.aspx";
            window.parent.location = url;
        }
        //策略
        function Strategy() {
            var arrt = new Array();
            arrt = CheckboxValue().split('|');
            var key = arrt[0];
            if (IsEditdata(CheckboxValue())) {
                var url = "/Training/TrainingTest/ExaminationPaper_StrategyForm.aspx?ExamKey=" + key;
                top.openDialog(url, 'ExamPlan_StrategyForm', '<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("ChapterIndex_sjlb")%> - <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Exam_Strategy")%>', 900, 400, 50, 50);
            }
        }
        //编辑
        function edit() {
            var arrt = new Array();
            arrt = CheckboxValue().split('|');
            var key = arrt[0];
            if (IsEditdata(CheckboxValue())) {
                var url = "/Training/TrainingTest/ExaminationPaper_Form.aspx?ExamKey=" + key;
                top.openDialog(url, 'Examination_Form', '<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("ChapterIndex_sjlb")%> - <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Exam_edit")%>', <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("exam_heigt")%>, 450, 50, 50);                
            }
        }
        
        function NavMenu(url) {
       
  window.parent.parent.frames["main"].location=url;
    return false;
}

        function Delete() {//删除
            var $proptObj = $("#handleIcon");
            var key = CheckboxValue();
            if (IsDelData(key)) {
                $proptObj.text("<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Exam_delgl")%>");
                $proptObj.show(0);
                var delparm = "action=ck&ct=A&pV=" + key;
                var result = IsExist_Data('/Training/Exam/DeleteExamInfo.ashx', delparm, "type");
                delparm = "action=del&ct=A&pV=" + key;
                $proptObj.hide(0);
                if (result && result.length > 0) {
                    delConfig2('/Training/Exam/DeleteExamInfo.ashx', delparm, "<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Exam_delselgl")%>")
                } else {
                    delConfig2('/Training/Exam/DeleteExamInfo.ashx', delparm, "<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Exam_deldata")%>")
                }
            }
        }

        //设置
        function set() {
            var url = "/RMBase/SysWindows/Base_WindowsSQLForm.aspx?key=<%=TableTitle %>";
            top.openDialog(url, 'Examination_List_Form', '<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("ChapterIndex_sjlb")%> - <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Display settings")%>', 750, 400, 50, 50);
        }

        //右键菜单
        globalSetTags('TKS_ExaminationPaper', 'Examination_EpId');

        //导入题库EXCEL
        function daoru(ExamKey, passmark) {
            var url = "/Training/Exam/CorrectExam_Import.aspx?ExamKey="+ExamKey+"&passmark="+passmark;
            top.openDialog(url, 'CorrectExam_Import', '试卷列表 - 导入学员成绩', 240, 120, 50, 50);
        }

        //编辑顺序
       function editsort(){var arrt = new Array();
            arrt = CheckboxValue().split('|');
            var key = arrt[0];
            if (IsEditdata(CheckboxValue())) {
                var isRandomExam = false;
                $('[type = checkbox]').each(function () {
                    if ($(this).attr("checked")) {
                        
                        var index = $("#table1>thead>tr>td[title='<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("exam_readm")%>']").index();
                        if ($(this).parent().parent().children('td').eq(index).text() == "<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("S")%>") {
                            isRandomExam = true;
                        }
                    }
                });

                if (isRandomExam)
                    showTipsMsg('<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Exam_notpledit")%>', 2000, 3);
                else {
                    window.parent.location = "/Training/TrainingTest/Exam_QueListSort.aspx?key=" + key;
                }
            }
        }



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