<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Upgrade_Info.aspx.cs" Inherits="RM.Web.RMBase.Upgrade.Upgrade_Info" %>

<!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("Upgrade_Info")%></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/FunctionJS.js" type="text/javascript"></script>    
</head>
<body>
    <form id="form1" runat="server">
    <div class="btnbartitle">
        <div>
            <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Upgrade_Info")%>
        </div>
    </div>
    <div class="div-body">
        <center style="padding: 5px; color: Red;" id="mess"><%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Upgrade_Info1")%></center>
        <div id="downMsg" >
        
        </div>

        <table id="table1" class="grid">
            <thead>
                <tr>
                    <td>
                        <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Upgrade_Info6") %>
                    </td>
                    <td>
                        <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Upgrade_Info7") %>
                    </td>
                    <td>
                        <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Upgrade_Info8") %>
                    </td>
                    <td>
                        <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Upgrade_Info9") %>
                    </td>
                </tr>
            </thead>
            <tbody>
                <%=table.ToString() %>
            </tbody>
        </table>
    </div>
    </form>
    <script type="text/javascript">
        $(function () {
            _takeOne();//启动任务队列
        });

        var _slideFun = [<%=jsget.ToString() %>];
        var _int;

        $(document).queue('ajax_article', _slideFun);
            var _takeOne = function () {$(document).dequeue('ajax_article');}; 
            var fileurl="",filesize="0",downsize="0";
            function down(id, url, savepath) {
                fileurl=url;
                $("#" + id).find("td").eq(3).html('<font><img src="/Themes/Images/loading1.gif"> <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Upgrade_xiazaizhong")%></font>');
                $("#" + id).css("background-color","#e6e6e6");
                $.get("/RMBase/Upgrade/GetFiles.ashx",
                { downFileUrl: url, savePath: savepath },
                function (data) {
                    if (data == "ok") {
                        $("#" + id).css("background-color","#ccffce");
                        $("#" + id).find("td").eq(3).html('<font color="green"><img src="/Themes/Images/16/ok.gif"> <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Upgrade_Info11")%></font>');
                    } else {
                        $("#" + id).addClass("no");
                        $("#" + id).css("background-color","#ffe0e4");
                        $("#" + id).find("td").eq(3).html('<font color="red"><img src="/Themes/Images/16/exclamation.png"> <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Upgrade_Info12")%></font>');
                    }
                    $(document).dequeue('ajax_article');
                });


        $.get("/RMBase/Upgrade/GetFiles.ashx",{action:"geturlsize",url:fileurl,r:Math.random()},function(data){   
            filesize=data;        
            _int= window.setInterval(downjindu, 1000);
        });
    }

    function downjindu(){
        $.get("/RMBase/Upgrade/GetFiles.ashx",{action:"getdirsize",r:Math.random()},function(data2){        
            if(data2==filesize){
            $("#downMsg").html('　100%　<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("upgrade_xzsd")%>：0 KB / <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Learn_miao")%>');
                _int=window.clearInterval(_int);
            }else{
                $("#downMsg").html('　'+parseFloat((data2/filesize)*100).toFixed(2)+'%　<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("upgrade_xzsd")%>：'+parseFloat(( parseInt(data2)-parseInt(downsize))/1000).toFixed(2)+' KB / <%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Learn_miao")%>');
                downsize=data2;
            }
        });    
    }    
        function fugai(nv){
           var number = $(".no").length;
          // alert(number);
           if(number >0){
                $("#mess").html('==============<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Upgrade_Info2")%>["+number+"]===================');
           }else{
                $("#table1").css("display","none");
                $("#mess").html('==============<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Upgrade_Info2")%>===================');
                $.get("/RMBase/Upgrade/GetFiles.ashx",
                {go:"true",nv:nv},
                function(data)
                {
                       if(data == "ok")
                       {
                            $("#mess").html('==============<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Upgrade_Info3")%>==================='); 
                       }
                       else
                       {
                            $("#mess").html('==============<%=RM.Common.DotNetConfig.LanguageHelper.GetKey("Upgrade_Info4")%>==================='+data);
                       }
                });
           }
        }
    </script>
</body>
</html>
