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

<!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("Learn_zdyxshezhi")%></title>
 <script src="/Language/zh-cn.js" type="text/javascript"></script>
    <script src="/Themes/Scripts/jquery-1.8.2.min.js" type="text/javascript"></script>
    <script src="/Training/Learn/m/jquery-ui.min.js" type="text/javascript"></script>
<script type="text/javascript" src="/Training/Learn/m/ckplayer/ckplayer.js" charset="utf-8"></script>
    <style type="text/css">
         *{ margin:0; padding:0;}
body, div, dl, dt, dd, ul, li, h1, h2, h3, h4, h5, h6, pre, code, form, fieldset, legend, input, button, textarea, p, blockquote, th, td { margin:0; padding:0 }
table { border-collapse:collapse; border-spacing:0 }
img { border-style: none;border-color: inherit;border-width: 0;margin-bottom:-3px;}
ul{ list-style:none;}
li { list-style:none }
h1, h2, h3, h4, h5, h6 { font-size:100%; font-weight:normal }
input, textarea, select { font-size:100%; }
hr { margin:0; height:1px; border:0px; border-bottom:1px #cccccc solid; *margin:5px 0 -5px 0;float:none; *float:left;display:block; }
.tab { border:1px #cccccc solid; border-collapse:collapse; }
.tab td { border:1px #cccccc solid; height:18px; line-height:18px; padding:3px; padding-left:10px; }
.tab th { border:1px #cccccc solid; height:18px; line-height:18px; padding:3px; padding-left:10px; }
body { font:normal 12px/1.8em Tahoma, Helvetica, Arial, '宋体', sans-serif; color:#464646 }
a { text-decoration:none; color:#414141; }
a:hover { text-decoration:underline; color:#EC8D02; }
.fl { float:left }
.fr { float:right }
.hidden { display:none }
.pr { position:relative }
.pa { position:absolute }
.tc {text-align:center}
.a2 { color:#485fe7; } 
.a3 { color:#663399; }
.a4{ color:#651985;}
.a5{ font-weight:bold; color:#8a0606;}
.clear { clear:both; }
.block{ display:block;}
        body { margin: 0; padding: 0; background: #ececec; }
        .Lrean_Head { height: 45px; background: #04b700; border-bottom: 1px #0a7d07 solid; }
        .Lreanlogo { float: left; }
        .LreanMenu { float: right; background-color: #07d903; border: 1px #069e03 solid; font-size: 12px; color: White; margin: 5px; padding: 3px 5px; }
        .Lrean_body { height: 100%; margin: 5px; height: 800px; padding: 0; position: relative; }
        .NewForm { background: #f4f4f4; border: 1px #ccc solid; position: absolute; font-size: 12px; }
        .NewForm_title { width: 100%; cursor: move; height: 27px; line-height: 25px; text-indent: 7px; background: url(/Themes/images/datagrid_header_bg2.gif) repeat-x; font-size: 12px; }
        .NewForm_Close { float: right; display: block; width: 16px; height: 16px; background-image: url(/Themes/Images/16/cross.png); margin-top: 5px; margin-right: 5px; }
        .NewForm_Max { float: right; display: block; width: 16px; height: 16px; background-image: url(/Themes/Images/16/2012080404391.png); margin-top: 5px; margin-right: 5px; }
        .NewForm_Ncontent { padding: 5px; }
        #SysFrom { width: 300px; border: 1px #ccc solid; background-color: White; left: 50%; margin-left: -150px; position: absolute; z-index: 999; display: none; }
        .zhangjie { margin: 8px; }
        .zhangjie li { background-image: url(/Training/Learn/m/zhangjie_dian.gif); background-repeat: no-repeat; padding-left: 20px; text-indent: 5px; }
        .zhangjie li ul { border-left: 3px #e5e5e5 solid; margin-left: -12px; }
        .zhangjie li ul li { background-image: url(); padding-left: 25px; }
        #Learning_NameFrom{ position:absolute; left:50%; width:400px; margin-left:-200px; top:100px; background: #f4f4f4; border: 1px #ccc solid; display:none; z-index:9999;}
        .NewInfor{POSITION: absolute;background-color:#e5f0fa; border:1px #9e9e9f solid;color:Black;}
.NewInfor .NewInfor_title{position: absolute; border-top:1px #ffffff solid; width:100%;background:url(Images/NewForm_title.gif) 0 -45px; background-repeat:repeat-x; text-indent:10px; cursor:move;height:26px;}
.NewInfor .NewInfor_title span{float:left;}
.NewInfor .NewInfor_title .NewInfor_Close{float: right; display: block; width: 16px; height: 16px; background-image: url(/Themes/Images/16/cross.png); margin-top: 5px; margin-right: 5px; }
.NewInfor .iInfor{POSITION: absolute; border:1px #a1a1a3 solid; width:97%; height:90%;left:1%; background-color:#fff;margin-top:28px; padding:0;}
.NewInfor p{POSITION: absolute; border:1px #a1a1a3 solid; width:360px; height:100px;left:4px; background-color:#fff; background-image:url(m/stereo.png); background-repeat:no-repeat; margin-top:28px; padding:0; padding-left:120px; padding-top:10px; padding-bottom:10px; background-position:10px 20px;}
.NewInfor .p2{background-image:url(m/stereo2.png);}
.queding{ margin:0; padding:0; border:0; margin-top:20px; width :100px;  height:29px; padding-top:-30px; background:url(m/MyBTN.gif); background-repeat:no-repeat; overflow:hidden; cursor:pointer;}
.quxiao{ margin:0; padding:0; border:0; margin-top:20px; width :100px;  height:29px; padding-top:-30px; background:url(m/MyBTN.gif) 0 -29px; background-repeat:no-repeat; overflow:hidden; cursor:pointer;}
        .ui-resizable-handle { position: absolute; font-size: 0.1px; display: block; -ms-touch-action: none; touch-action: none; }
        .ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; }
        .ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; }
        .ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; }
        .ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; }
        .ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; }
        .ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; }
        .ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; }
        .ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; }
        .ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px; }
    </style>
</head>
<body>
    <div class="Lrean_Head">
        <div class="Lreanlogo">
            <img src="m/learnhead_logo.gif" /></div>
        <div class="LreanMenu">
             <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Learn_showlm")%>：<input id="cb_Chapter" type="checkbox"  /> <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("ChapterIndex_zj")%> 
             <input id="cb_Mvideo" type="checkbox"  /><%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Learn_zhumove")%>  
             <input id="cb_Ovideo" type="checkbox" /><%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Learn_caozuomove")%>  
             <input id="cb_Interaction" type="checkbox"  /><%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Learn_hudong")%>  
             <input id="cb_Progress" type="checkbox"  />学习进度  
             <input id="cb_About" type="checkbox" />课程介绍 
             <%--<input id="cb_Annex" type="checkbox" onclick="Annex()" />附件文档  
             <input id="cb_Exercises" type="checkbox" onclick="Exercises()" />练习题  
             <input id="cb_Elist" type="checkbox" onclick="Elist()" />试卷列表  --%>
             <input type="button" value='<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Learn_saveshezhi")%>' onclick="$('#Learning_NameFrom').show()" />
        </div>
    </div>
    <div class="Lrean_body" id="Desktop">
        <div id="Learning_NameFrom">
        <div class="NewForm_title"><%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Learn_txxxmsmc")%></div>
            <div style=" margin:10px;"><%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Learn_msmc")%>：<input id="Learning_Name" type="text" value="<%=name %>" style=" width:300px;" /><br /><center><input type="button" value='<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Learn_qdsave")%>' onclick="SaveForm()" style=" padding:10px;" /><br /><span id='errtext' style=" color:Red;"></span></center></div>
        </div>
    </div>
    <script src="m/NewstartWindows.js" type="text/javascript"></script>
    <script type="text/javascript">

        $(function () {
            var MyJson = "<%=json %>";
           NewstartLearn = new NewstartWindows.LoadWindow(MyJson);
           // NewstartWindows.alert("保存成功！");
        })
        
        function SaveForm() {
            var forms = NewstartWindows.GetForms();
           // alert(forms);
            var ModelName = $("#Learning_Name").val();
            var ModelID = QueryString("key");
            //判断是否已选
            if (forms.length <= 2) {
                $("#errtext").html('<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Learn_xxmsmc")%>');
                return;
            }
            if (ModelName == "") {
                $("#errtext").html('<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Learn_mcbnwk")%>');
                eturn;
            }
            var isok = false;
            //验证重名
            getAjax("GetLearningModel.ashx", { Name: ModelName, Key: ModelID },
                          function (rs) {
                              if (rs == "0") {
                                  isok = true; 
                              } else {
                                  $("#errtext").html('<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Learn_yczcf")%>');
                              }
                          });
            //添加数据库
            if (isok) {
                getAjax("AddLearningModel.ashx", { Name: ModelName, ID: ModelID, Data: forms },
             function (rs) {
                 if (rs) {
                     NewstartWindows.alert('<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("CG")%>');
                     $('#Learning_NameFrom').hide();
                     window.close();
                     //return alert("true");
                 } else {
                     $("#errtext").html('<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("SB")%>');
                     //return alert("false");
                 }
             });
         }
        }
        function getAjax(url, parm, callBack) {
            $.ajax({
                type: 'post',
                dataType: "text",
                url: url,
                data: parm,
                cache: false,
                async: false,
                success: function (msg) {
                    callBack(msg);
                }
            });
        }
        
    </script>
</body>
</html>
