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

<!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("ChapterPlan_Form_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/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/FunctionJS.js" type="text/javascript"></script>
    <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; }
        .promptLink span { float: right; font-size: 10pt; }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <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("ChapterPlan_Form_zjjhmc")%>:
            </th>
            <td>
                <input id="CP_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>
                </td>
        </tr>
        <tr>
            <th>
                <font color="red">*</font> <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("ChapterPlan_Form_xzzj")%>:
            </th>
            <td>
                <div style="position: relative;">
                        <input id="GetCSControlValue" autocomplete="off" type="text" class="txt" style="width: 314px;
                            z-index: 0;" onkeyup="getcstishi()" />
                            <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("ChapterPlan_Form_srzjmc")%>
                        
                        <div id="tishics" style="display: none; cursor: pointer; position: absolute; width: 316px;
                            background-color: White;">
                            <img src="../../Themes/Images/loading1.gif" />
                            <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("ChapterPlan_Form_zzcx")%>...
                           
                        </div>
                    </div>
            </td>
        </tr>
        <tr>
            <th>
            </th>
            <td style=" height:150px;">
                <div id="cslist" style=" background-color:White; height:150px; overflow-y:scroll; border: 1px solid #ccc; border-top: 0; z-index: 0;
                        width: 560px;">
                        <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: 350px; height: 16px; line-height: 16px;">
                                         <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("ChapterPlan_Form_zjm")%>
                                    </td>
                                </tr>
                            </thead>
                            <tbody>
                            </tbody>
                        </table>
                    </div>
            </td>
        </tr>
        <tr>
            <th>
                <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("ChapterPlan_Form_qzsj")%>:
            </th>
            <td>
                <input id="PlanStarData" runat="server" type="text" class="txt" datacol="yes"
                    err="开始时间" checkexpession="DateOrNull" onclick="WdatePicker()" style="width: 80px;" />
                -
                <input id="PlanEndData" runat="server" datacol="yes" err="结束时间" checkexpession="DateOrNull"
                    type="text" class="txt" onclick="WdatePicker()" style="width: 80px" />
                <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("ChapterPlan_Form_rqbtxbsbgq")%>
            </td>
        </tr>
        <tr>
                <th>
                    <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("ChapterPlan_Form_jhms")%>:
                </th>
                <td>
                    <textarea id="CP_Describe" class="txtRemark" runat="server" style="width: 452px;
                        height: 43px;"></textarea>
                </td>
            </tr>
    </table>
    <div class="frmbottom">
        <asp:LinkButton ID="Save" runat="server" class="l-btn" OnClientClick="return SaveForm();"
            OnClick="Save_Click"><span class="l-btn-left">
            <img src="/Themes/Images/disk.png" alt="" /><%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Save")%></span></asp:LinkButton>
        <a class="l-btn" href="javascript:void(0)" onclick="OpenClose();"><span class="l-btn-left">
            <img src="/Themes/Images/cancel.png" alt="" /><%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Close")%></span></a>
    </div>
    </form>
<script type="text/javascript">
        $(function () {
            //把分页定位到屏幕下面
            divresize(63);

        });
        //返回
        function back() {
            Urlhref('/Training/Chapter/ChapterPlan_List.aspx');
        }
        //保存
        function SaveForm() {
                    
            var number = 0;
            var r = document.getElementsByName("users");
            for (var i = 0; i < r.length; i++) {
                if (r[i].checked) { number++; }
            }
            //alert(number);
            if (number == 0) {
                showWarningMsg("<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("least_groups")%>");
                return false ;
            }

            number = 0;
            var r = document.getElementsByName("checkbox_cs");
            for (var i = 0; i < r.length; i++) {
                if (r[i].checked) { number++; }
            }
            if (number == 0) {
                showWarningMsg("<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("ChapterPlan_Form_nxyzsxz")%>！");
                return false;
            }

              if (!CheckDataValid('#form1')) return false;
            return true;

//            if (CheckDataValid('#form1')) {
//                showConfirmMsg('注：确认要保存此操作吗？', function (r) {
//                    if (r) {
//                        form1.submit();
//                    }
//                });
//            }
        }
        //得到章节提示提示
        function getcstishi() {
            $("#tishics").show();
            var inputvalue = $("#GetCSControlValue").val();
            $.get("/Training/Chapter/GetChapter.ashx", { key: inputvalue },
                 function (data) {
                              $("#tishics").html(data);
            });
        }
       
        //增加新数据
        var rowindex = 1;
        function addNew(csid, csname) {
            $("#cslist").show();
            $("#table1 tbody").append("<tr><td><input type='checkbox' checked='checked' name='checkbox_cs' value='" + rowindex + "|" +csid + "'></td><td><input  value='" + csname + "' name='checkbox_name_" + rowindex + "' style='width: 250px;' /></td></tr>");
            rowindex++;
            $("#tishics").hide();
        }
        <%=getuserlist %>
    </script>
</body>
</html>
