<script language="javascript">
$(function(){
	$("#backupInfo").append('<p>成功获取数据信息！</p>');
});

var num = 0;
loopTable(num);

function loop(num){
	loopTable(num);
}


function loopTable(num){
	$(function(){
		var total = Number('{$total}');
		var act = '{$act}';
		if(num<=total){
			$.get('__APP__?g=<?php echo GROUP_NAME; ?>&m=<?php echo MODULE_NAME; ?>&a=show&act='+act+'&go='+num, function(data){
				$("#backupInfo").append(data);
				$("#backupInfo").parent().scrollTop(1000*total);
				num++;
				loop(num);
			});
		}else{
			$("#waiting").empty();
			if(act=='bak'){
				var info = '数据库备份成功！';
			}else{
				var info = '数据库还原成功！';
			}
			$.messager.alert('提示',info,'info',function(){
				cancel['addBackup'].dialog('close');
				cancel['addBackup'] = null;
				$("#Backup").datagrid('reload');
			});
		}
	});
}
</script>
<div class="con-tb" id="backupInfo" style="padding:3px;">

</div>
<if condition="$act=='bak'">
 <p id="waiting" style="margin-left:3px">数据正在备份中，请稍等...</p>
<else />
 <p id="waiting" style="margin-left:3px">数据正在还原中，请稍等...</p>
</if>
