<!--#include file="../Include/Const.Asp" -->
<!--#include file="../Include/ConnDatabase.asp" -->
<!--#include file="../Include/System_Language.asp" -->
<!--#include file="../Include/Version.Asp" -->
<!--#include file="CheckAdmin.Asp"-->
<!--#Include file="BokeCMS_Css.Asp"-->
<%
'*********************************************
'软件名称：博科企业网站内容管理系统（BOKECMS）
'软件开发：博科网络科技工作室
'网   址：http://www.bokew.net
'服务QQ：530051328
'服务邮箱：bbfhq@163.com
'微信公众号：bokewlkj
'*********************************************
%>
<div class="row" style=" background:#eee;">	
    <div class="col-md-12">
        <div class="panel panel-default">
            <div class="panel-heading">
                <h2><i class="fa fa-tasks"></i>页面生成进度</h2>
            </div>
            <div class="panel-body">
                <div class="progress">
                    <div style="width: 0;" aria-valuemax="100" aria-valuemin="0" aria-valuenow="60" role="progressbar" class="progress-bar" id="progress-bar">
                        0%
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<%
Call SiteInfo()
bkkey = request.QueryString("bkkey")
Set rshtml = Server.CreateObject("ADODB.Recordset")
sql = "select * from BokeCMS_videoSort order by ID desc"
rshtml.Open sql, conn, 1, 1
Do While Not rshtml.EOF
	ID = rshtml("ID")&","&ID
	rshtml.movenext
Loop
Call CloseRs(rshtml)
%>
<script>
$(window.parent.document).find("#html_Bar").css("height", $(".row").css("height"))
ID = "<%=ID%>"
IDarr = ID.split(",")
var oProgress = document.getElementById("progress-bar");
if(ID == "")
{
	Percent = "100%";
	$(oProgress).css("width", Percent).html(Percent);
}
else{
	progress(1)
}

function progress(i)
{
	if(i > IDarr.length) return;
	$.ajax({
		type: "Get",
		url: "../Generate/SC_ajax.Asp",  
		data: "Table=VideoSort&ID="+IDarr[i-1]+"&bkkey=<%=bkkey%>",
		cache: false,
		success: function(ErrMsg){
			Percent = parseInt(i / (IDarr.length) * 100) + "%";
			var oProgress = document.getElementById("progress-bar");
			$(oProgress).css("width", Percent).html(Percent)
			progress(i + 1)
		}
	})
}
</script>