<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CS_List.aspx.cs" Inherits="RM.Web.Training.Courseware.CS_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("CS_List_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>
    <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.js" type="text/javascript"></script>--%>
</head>
<body>
    <form id="form1" runat="server">
    <div class="btnbartitle">
        <div>
            <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("CS_List_Title")%>
        </div>
    </div>
    <div class="btnbarcontetn">
        <div style="text-align: left; float: left;">
             <span>课件名:</span>
            <input runat="server" class="txt" id="search_Bar" />
            <%--<span>排序:</span>
            <select id="sortid" runat="server">
                <option value="Courseware_CsName">课件名</option>
                <option value="Courseware_Pattern">课件模式</option>
                <option value="Courseware_CsTeachingCount">教学次数</option>
                <option value="Courseware_CsInteractCount">互动数</option>
                <option value="Courseware_CsTeacher">课件讲师</option>
                <option value="courseware_SortNo">排序码</option>
                <option value="Courseware_DevelopPeople">课件开发人</option>
                <option value="courseware_CsUploadDate">上传时间</option>
            </select>           --%> 
            <asp:LinkButton ID="lbtSearch" runat="server" class="button green" OnClick="lbtSearch_Click"><span class="icon-botton"
            style="background: url('../../Themes/images/Search.png') no-repeat scroll 0px 4px;">
        </span> <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("GetButton")%></asp:LinkButton>
        
        </div>
        <div style="text-align: right">
            <uc2:LoadButton ID="LoadButton1" runat="server" />          
            <input type="button" class="button green" value="<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Bulk_import")%>" onclick="UpLoadBatch();" style="display:none;" />
        </div>
    </div>
    <div id="FlashTop" style="display: none; border: solid #ccc; background-color: White;
        width: 500px; height: 100px; left: 30%; top: 20%; position: absolute;">
        <div style="float: left; margin-left: 20px; margin-top: 10px;">
            <span style="margin-right: 10px;">  <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("ImportingPleaseTryLater")%>:</span><span id="OverCount">0</span>/<span
                id="PathCount">0</span>
        </div>
        <div style="width: 450px; margin-left: 15px; height: 48px; float: left; border: 1px solid #ccc;
            margin-top: 10px;">
            <div id="FlashOver" style="background-color: #e0eccc; width: 100px; height: 48px;">
            </div>
        </div>
    </div>
    <div class="div-body">
        <%=TableHtml %>
    </div>
    <uc1:PageControl ID="PageControl1" runat="server" />
    </form>
    <script type="text/javascript">
        $(function () {
            //把分页定位到屏幕下面
            divresize(120);
            FixedTableHeader("#table1", $(window).height() - 121);
        });
        //新增
        function addCsScript() {
            var arrt = new Array();
            arrt = CheckboxValue().split('|');
            var key = arrt[0];
            if (IsEditdata(CheckboxValue())) {
                var url = "/Training/Courseware/Courseware_Script.aspx?CoursewareKey=" + key;
                parent.window.location = url;
            }
        }
        function add() {
            var url = "/Training/Courseware/Courseware_Form.aspx";
            top.openDialog(url, 'Courseware_Form', '<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("CS_List_Title")%> - <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Add")%>', "960px", "450px", 50, 50);
        }
        //编辑
        function edit() {
            var arrt = new Array();
            arrt = CheckboxValue().split('|');
            var key = arrt[0];
            if (IsEditdata(CheckboxValue())) {
                var url = "/Training/Courseware/Courseware_Form.aspx?CoursewareKey=" + key;
                top.openDialog(url, 'Courseware_Form', '<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("CS_List_Title")%> - <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Edit")%>', "960px", "450px", 50, 50);
                //                window.location = url;
            }
        }
        //设置
        function set() {
            var url = "/RMBase/SysWindows/Base_WindowsSQLForm.aspx?key=<%=TableTitle %>";
            top.openDialog(url, 'Courseware_List_Form', '<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("CS_List_Title")%> - <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Display settings")%>', 750, 450, 50, 50);
        }
        //互动
        function interactsList() {
            var arrt = new Array();
            arrt = CheckboxValue().split('|');
            var key = arrt[0];
            if (IsEditdata(CheckboxValue())) {
                var url = "/Training/Learn/Interacts_List.aspx?Key=" + key;
                top.openDialog(url, 'Interacts_List', '<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("CS_List_Title")%> - <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("CS_List_hdxx")%>', 700, 400, 50, 50);
            }
        }
        //查看共享
        function sharesList() {
            var arrt = new Array();
            arrt = CheckboxValue().split('|');
            var key = arrt[0];
            if (IsEditdata(CheckboxValue())) {
                var url = "/Training/Courseware/CS_SharesList.aspx?CoursewareKey=" + key;
                parent.window.location = url;
                // var url = "/Training/Learn/Learn_Shares.aspx?Key=" + key;
                //  top.openDialog(url, 'Courseware_Interacts', '课件列表 - 文件共享', 700, 400, 50, 50);
            }
        }
        //查看试题
        function questions() {
            var arrt = new Array();
            arrt = CheckboxValue().split('|');
            var key = arrt[0];
            if (IsEditdata(CheckboxValue())) {
                var url = "/Training/TrainingTest/GetExamList.aspx?key=" + key + "&opType=EM";
                top.openDialog(url, 'GetExamList', '<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("CS_List_Title")%> - <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("CS_List_kjxgks")%>', 550, 350, 50, 50);
            }
        }
        //删除
        function Delete() {
            var arrt = new Array();
            arrt = CheckboxValue().split('|');
            var key = arrt[0];
            if (IsEditdata(CheckboxValue())) {
                //                delConfig('/Training/Courseware/DeleteCourseware.ashx', 'key=' + key, '删除课件将同时删除与该课件关联的数据<br />如:培训计划、课程培训进度、试卷,共享等,且<FONT color='red'>不能恢复被删除的数据,请慎重删除</FONT>.确认删除么？');
                delConfig('/Training/Courseware/DeleteCourseware.ashx', 'key=' + key, "<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("RemovTheCourseware")%><br /><%=RM.Common.DotNetConfig.LanguageHelper.GetKey("AndTheCourseware")%><FONT color='red'><%=RM.Common.DotNetConfig.LanguageHelper.GetKey("RemovTheCourseware")%></FONT>.<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("ToConfirmTheDeletion")%>？");
            }
        }
        //外部数据同步
        function OpenData() {
            Loading(true);
            getAjax("OpenDataSynchronous.ashx", "", function (rs) {
                if (rs != 1) {
                    showTipsMsg("外部数据同步失败", 2000, 5);
                    loadinghide();
                } else {
                    showTipsMsg("外部数据同步成功", 2000, 4);
                    loadinghide();
                    window.parent.document.location.reload();
                }
            });
        }
        var pathcount = 0;
        //获取所有上传视频
        function UpLoadBatch() {
            $("#FlashTop").show();
            getAjax("UpLoadBatch.ashx", "status=1", function (data) {
                if (data != 1) {
                    var obj = eval('(' + data + ')');
                    var type = eval('(' + obj.type + ')'); //知识分类
                    var path = eval('(' + obj.path + ')'); //课程路径
                    if (path.length == 0 || type.length == 0) {
                        HtmlText();
                        return;
                    }
                    pathcount = path.length;
                    $("#PathCount").html(pathcount);
                    // 循环分类
                    var Flashindex = 0;
                    $.each(type, function (i) {
                        $.each(path, function (j) {
                            var reg = new RegExp(type[i].CoursewareType_CtName);
                            var flag = reg.test(path[j]);
                            if (flag) {
                                UpLoadMoive(path[j], type[i].CoursewareType_CtId, type[i].CoursewareType_CtName);
                                Flashindex++;
                                var flashwidth = 450 / pathcount * Flashindex;
                                $("#FlashOver").css("width", flashwidth + "px");
                                $("#OverCount").html(Flashindex);
                                if (Flashindex == pathcount) {
                                    $("#FlashTop").hide();
                                    location.reload();
                                }
                            }
                        });
                    });
                }
            });
        }
        //单个导入
        function UpLoadMoive(path, typeid, typename) {
            getAjax("UpLoadBatch.ashx", "status=2&path=" + path + "&typeid=" + typeid + "&typename=" + typename, function (data) {
            }
            );
        }
        function flashHide() {
            $("#FlashTop").hide();
        }

        function HtmlText() {
            var str = "<div style='padding:5px;'><h1><%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Help_document")%>";
            str += "<div style='float:right;'><input type='button' onclick='flashHide();' value='<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Close")%>'/></div></h1><br/>"
            str += "1.<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("ToTheSystem")%><br/>";
            str += "2.<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Within_ShareMove")%><br/>";
            str += "3.<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("IneachClassification")%><br/>";
            str += "4.<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("InTheCourseOf")%><br/>";
            str += "5.<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("TheServerAfter")%><br/><div float:left><img src='/Template/default/Images/MovieUpload.gif'/></div></div>";
            $("#FlashTop").css("height", "370px");
            $("#FlashTop").html(str);
        }

        globalSetTags('TKS_Courseware', 'Courseware_CsID');
    </script>
</body>
</html>
