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

<%@ 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 id="Head1" runat="server">
    <title>
        <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("DataList_ExamPlan")%>-<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Edit")%>
    </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/Validator/JValidator.js" type="text/javascript"></script>
    <script src="/Themes/Scripts/DatePicker/WdatePicker.js" type="text/javascript"></script>
    <script src="/Themes/Scripts/artDialog/artDialog.js" type="text/javascript"></script>
    <script src="/Themes/Scripts/artDialog/iframeTools.source.js" type="text/javascript"></script>
    <script src="/Themes/Scripts/TreeView/treeview.pack.js" type="text/javascript"></script>
    <script src="/Themes/Scripts/FunctionJS.js" type="text/javascript"></script>
    <script src="/Training/ExamPlan/Themes/ExamPlan_Form.js" type="text/javascript"></script>
    <link href="/Themes/Scripts/TreeView/treeview.css" rel="stylesheet" type="text/css" />
      <script src="/Themes/Scripts/TreeTable/jquery.treeTable.js" type="text/javascript"></script>
    <link href="/Themes/Scripts/TreeTable/css/jquery.treeTable.css" rel="stylesheet"
        type="text/css" />
    <style type="text/css">
        #promptBg ul, #promptBg li { padding: 0; margin: 0; list-style: none; }
        .promptLink { display: block; padding: 0 3px; font-size: 10pt; }
        .activeLink { background-color: #e0f5bc; }
        .activePrompt { background-color: #E0ECCC; }
        .Cowdiv { width: 760px; left: 100px; height: 400px; position: absolute; border: 1px solid #ccc; background-color: White; display: none; z-index:999;}
    .cowtab { width: 100%; }
    #CWlist{overflow-y:scroll; height:325px;}
    #CWtypelist{overflow-y:scroll; height:325px;}
    #list_tit{ background-color:#2684ff; height:30px; overflow:hidden; padding:3px;}
    #list_tit span{ display:block; padding:5px 10px;  height:30px; line-height:25px; float:left; overflow:hidden;}
    .tab1{ background-color:White;border:1px #ccc solid; border-bottom:0;}
    .list_footer{ background-color:#f4f4f4; height:40px; line-height:40px; overflow:hidden; border:1px #ccc solid;}
        .Page { bottom: 5px; }
        .grid td { text-align: left; }
        .livediv { width: 200; height: 200; margin: 5px 0; display: none; }
        .livediv ul, li { list-style-type: none; margin: 0; padding: 0; }
        .livediv li { width: 222px; text-indent: 1em; }
        .livediv li:hover { background: #E0ECCC; }
        .lightTreeview { height: 350px; }
        .strTree li ul { display: none; }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div class="btnbartitle">
        <div>
            <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("DataList_ExamPlan")%>-<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Edit")%>
        </div>
    </div>
    <div class="btnbarcontetn">
        <div style="text-align: right">
            <uc2:LoadButton ID="LoadButton1" runat="server" />
        </div>
    </div>
    <div id="allhtml" class="div-body" style="overflow: scroll; min-height: 500px;">
        <!--手选试卷div-->
        <div id="Cowtab" class="Cowdiv">
             <div id="list_tit">
            <span id="tab1" class="tab1" onclick="tabTitLoad(0)">选择课程 </span><span id="tab2"  onclick="tabTitLoad(1)">选择课程分类</span>
        </div>
            <div id="CWlist">
                <div style="width: 760px; height: 350px;  ">
                    <div style="width: 200px; height: 350px; float: left;">
                        <iframe class="iframe_left" name="target_left" scrolling="auto" frameborder="0" scrolling="yes"
                            width="100%" height="100%"></iframe>
                    </div>
                    <div style="width: 520px; float: left;">
                        <table class="grid cowtab">
                            <thead>
                                <tr>
                                    <td>
                                        <input type="button" data="0" value='<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Quanxuan")%>'
                                            onclick="AllCheck('cwtbody')" />
                                    </td>
                                    <td>
                                        <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("MyExamPlan-sjm")%>
                                    </td>
                                    <td>
                                        <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("MyExamPlan-sjlx")%>
                                    </td>
                                </tr>
                            </thead>
                            <tbody id="cwtbody">
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
            <!--分类-->
            <div style="display: none;" id="CWtypelist">
                <div style="width: 100%; position: relative;  float: left;
                    overflow: auto;">
                    <!--章节列表-->
                    <div id="TypeDiv" class="div-body">
                        <span style="color: Red;">须知：在<a style="color: Blue" href="/Training/LearnToSet/LearnToSet_List.aspx">学习设置中</a>，设置自动添加功能为开启状态。
                            选择分类后。在往后操新增试卷时，试卷会自动添加到考试计划中。</span>
                        <table class="example" id="dnd-example">
                            <thead>
                                <tr>
                                    <td style="padding-left: 20px;">
                                        <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("CertificateType_Class")%>
                                    </td>
                                    <td style="display: none;">
                                    </td>
                                    <td style="padding-left: 20px;">
                                        <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("MyExamPlan-km")%>
                                    </td>
                                </tr>
                            </thead>
                            <tbody id="chapList">
                                <%=TableTree_CoursewareType.ToString()%>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
            <div class="list_footer" style=" width:auto; bottom: 10px; padding-left: 450px;">
                <input type="button" value='<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Ques_dete")%>'
                    onclick="CowtabHide()" />
                <input type="button" value='<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Close")%>'
                    onclick="CowtabHide()" />
            </div>
        </div>
        <!--手选直播div-->
        <div id="LiveTab" class="Cowdiv" style=" display:none;">
            <div style="width: 555px; height: 350px; position: relative; border: 1px solid #ccc;
                float: left">
                <table class="grid cowtab">
                    <thead>
                        <tr>
                            <td>
                                <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Plan_select")%>
                            </td>
                            <td>
                                <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("ExamPlan_zhiboName")%>
                            </td>
                        </tr>
                    </thead>
                    <tbody id="LiveBody">
                    </tbody>
                </table>
            </div>
            <div style="position: absolute; bottom: 0px; padding-left: 300px; padding-bottom: 10px;">
                <input type="button" value='<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Ques_dete")%>'
                    onclick="CowtabHide()" />
                <input type="button" value='<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Close")%>'
                    onclick="CowtabHide()" />
            </div>
        </div>
        <table id="tablebody" border="0" cellpadding="0" cellspacing="0" class="frm">
            <tr>
                <th style="width: 80px;">
                    <font color="red">*</font>
                    <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("ExamPlan_kaoshijihuaName")%>:
                </th>
                <td>
                    <input id="ExamPlan_Name" runat="server" type="text" class="txt" datacol="yes" err="考试计划名"
                        checkexpession="NotNull" style="width: 200px" />
                </td>
            </tr>
            <tr>
                <th>
                    <font color="red">*</font>
                    <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("user_group")%>:
                </th>
                <td>
                    <script src="/Themes/Scripts/GetuserControl.js" type="text/javascript"></script>
                    <%=prompt %>
                </td>
            </tr>
            <tr>
                <th>
                    <font color="red">*</font>
                    <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("learMaxNum")%>:
                </th>
                <td>
                    <div >
                        <input id="Exam_Plan_ExamName" runat="server" type="text" class="txt" style="width: 222px;
                            z-index: 0;" err="考试试卷" datacol="yes" autocomplete="off" />
                        <input type="botton" value='<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("ExamPlan_shoudongsj")%>'
                            class="button" style="height: 25px;" onclick="CowtabShow(null);" />
                        <input type="hidden" value="" runat="server" id="ExamPlan_ExamId" />
                        <div id="promptBg" style="display: none; cursor: pointer; position: absolute; width: 228px;
                            background-color: White;">
                            <div id="loadIcon" style="text-align: center; line-height: 18px;">
                                <img src="../../Themes/Images/loading1.gif" alt="" />
                                <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Loading")%>
                            </div>
                        </div>
                        <div id="cslist" style="border: 1px solid #ccc; border-top: 0; z-index: 0; width: 387px;
                            display: none;">
                            <table id="table1" class="example" style="background-color: White;">
                                <thead>
                                    <tr>
                                        <td style="width: 20px; height: 16px; line-height: 16px;">
                                            &nbsp;
                                        </td>
                                        <td style="width: 200px; height: 16px; line-height: 16px;">
                                            <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("MyExamPlan-sjm")%>
                                        </td>
                                        <td style="height: 16px; line-height: 16px;">
                                            <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Exam_type")%>
                                        </td>
                                    </tr>
                                </thead>
                                <tbody>
                                </tbody>
                            </table>
                        </div>
                           <div id="chapshowlist" style="display: none; border: 1px solid #ccc; border-top: 0;
                        z-index: 0; width: 660px;">
                        <table id="table8" class="example" style="background-color: White;">
                            <thead>
                                <tr>
                                    <td style="width: 20px; height: 16px; line-height: 16px;">
                                        &nbsp;
                                    </td>
                                    <td style="width: 250px; height: 16px; line-height: 16px;">
                                        <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Ques_fenlei")%>
                                    </td>
                                </tr>
                            </thead>
                            <tbody>
                            </tbody>
                        </table>
                    </div>
                </td>
            </tr>
            <tr>
                <th>
                </th>
                <td>
                    <div>
                        <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("ExamPlan_shurutishi")%><span style="color: Red;
                            padding-left: 5px;"><%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Exam_tishi")%></span>
                    </div>
                </td>
            </tr>
            <tr style="display:none;">
                <th>
                    <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("ExamPlan_zhiboName")%>
                </th>
                <td>
                    <input type="hidden" id="ExamPlan_LiveID" value=" " />
                    <input type="text" class="txt" style="width: 222px" id="ExamPlan_LiveName" onkeyup="GetLive();" /><input
                        type="botton" value='<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("ExamPlan_shouxuanzb")%>'
                        class="button" style="height: 25px;" onclick="ShowPlanLive(1);" />
                    <br />
                    <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("ExamPlan_shuruzbName")%>
                    <span style="color: Red;">
                        <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Exam_tishi")%></span>
                    <div class="livediv" id="livediv">
                    </div>
                    <div id="livelist" style="border: 1px solid #ccc; border-top: 0; z-index: 0; width: 222px;
                        display: none;">
                        <table id="table2" class="example" style="background-color: White;">
                            <thead>
                                <tr>
                                    <td style="width: 20px; height: 16px; line-height: 16px;">
                                        &nbsp;
                                    </td>
                                    <td style="width: 250px; height: 16px; line-height: 16px;">
                                        <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("ExamPlan_zhiboName")%>
                                    </td>
                                </tr>
                            </thead>
                            <tbody>
                            </tbody>
                        </table>
                    </div>
                </td>
            </tr>
            <tr>
                <th>
                    <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("ChapterPlan_Form_qzsj")%>:
                </th>
                <td>
                    <input id="ExamPlan_PlanStart" runat="server" type="text" class="txt" datacol="no"
                        err="开始时间" checkexpession="DateTime" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:00'})" style="width:120px;" />
                    -
                    <input id="ExamPlan_PlanEnd" runat="server" datacol="no" err="结束时间" checkexpession="DateTime"
                        type="text" class="txt" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:00'})" style="width:120px" />
                    <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("ChapterPlan_Form_rqbtxbsbgq")%>
                </td>
            </tr>
            <tr>
                <th>
                    <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Plan_yqxf")%>:
                </th>
                <td>
                    <input id="ExamPlan_XueFen" runat="server" type="text" class="txt" datacol="yes"
                        err="要求学分" checkexpession="Num" style="width: 200px" value="0" />
                    <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("ExamPlan_Form_ReachCredit")%>
                </td>
            </tr>
            <tr>
                <th>
                    <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Button_Form_shunxu")%>:
                </th>
                <td>
                    <input id="SortIndex" runat="server" type="text" class="txt" datacol="yes" err="显示顺序不能为空"
                        checkexpession="Num" style="width: 200px" value="0" />
                </td>
            </tr>
            <tr style="">
                <th>
                    <font color="red">*</font>
                    <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("ExamPlan_ksjhstate")%>:
                </th>
                <td>
                    <select id="ExamPlan_State" class="select" maxlength="35" runat="server" style="width: 228px;">
                    </select>
                </td>
            </tr>
            <tr>
                <th>
                    <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("ChapterPlan_Form_jhms")%>:
                </th>
                <td>
                    <textarea id="ExamPlan_Description" class="txtRemark" runat="server" style="width: 452px;
                        height: 143px;"></textarea>
                </td>
            </tr>
        </table>
    </div>
    </form>
    <script type="text/javascript">
        $(window).resize(function () {
            $("#allhtml").css("height", $(window).height())
        });
        $(function () {
            //把分页定位到屏幕下面
            divresize(63);
            treeAttrCss();
            GetClickValue();
            GetClickTableValue();
            $("#ExamPlan_XueFen").val($("#ExamPlan_XueFen").val().split(".")[0]);
        });
        var Menu_Id = '';
        function GetClickTableValue() {
            $('table tr').not('#td').click(function () {
                $(this).find('td').each(function (i) {
                    if (i == 1) {
                        Menu_Id = $(this).text();
                    }
                });
            });
            $("#dnd-example").treeTable({
                initialState: "collapsed" //collapsed 收缩 expanded展开的
            });
        }


        //点击获取部门ID
        function GetClickValue() {
            $(".strTree li div").click(function () {
                var id = $(this).parent().find("span").html(); //子目录
                if (id == "") {
                    id = id = $(this).find("span").html();
                }
                //                parent.CowTabPage(1, id);
                //                Loading(true);
                CowtabShow(id);
            });
        }

        //quan xuan
        function AllCheck(id) {
            $("#" + id).find("input[type=checkbox]").each(
         function () {
             $(this).attr("checked", true);
             //alert(1);
             $(this).click();
             $(this).attr("checked", true);
         }
          );
        }
         
    </script>
    <script type="text/javascript">
    //标签栏切换
        function tabTitLoad(obj) {
            switch (obj) {
                case 0:
                    $("#CWlist").show();
                    $("#CWtypelist").hide();
                    $("#tab1").attr("class","tab1");
                    $("#tab2").attr("class","");
                    break;
                case 1:
                    $("#CWtypelist").show();
                    $("#CWlist").hide();
                    $("#tab1").attr("class","");
                    $("#tab2").attr("class","tab1");
                    break;
            }
        }


        var Chaprowindex = 1;
        function OnChapSelect(obj) {
            var arrayObj = new Array();
            var i = 0;
            ///循环所有 获取tr
            $("#chapList").find("tr").each(
    function () {
        if ($(this).attr("id").indexOf($(obj).attr("id")) >= 0) {
            ///获取所有id
            arrayObj[i] = $(this);
            i++;
        }
    });
            for (var i = 0; i < arrayObj.length; i++) {
                addChapList(arrayObj[i].children('td').eq(1).html(), arrayObj[i].children('td').eq(0).children(".folder").html());
            }
        }
        function addChapList(chapid, chapnane) {
            $("#chapshowlist").show();
            $("#table8 tbody").append("<tr><td><input type='checkbox' checked='checked' name='checkbox_chap' value='" + Chaprowindex + "|" + chapid + "'></td><td><input  value='" + chapnane + "' name='checkbox_name_chap_" + Chaprowindex + "' style='width: 300px;' /></td></tr>");
            Chaprowindex++;
        }
             <%=getuserlist %>
    </script>
</body>
</html>
