<?php if (!defined('APP_PATH')) exit;?><!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<link href="http://127.0.0.5/magic/Data/Public/css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="http://127.0.0.5/magic/Data/Public/js/jquery.js"></script>
<script src="http://127.0.0.5/Data/Public/layer/layer.js"></script>
<script src="http://127.0.0.5/magic/Data/Public/js/main.js"></script>
<script src="http://127.0.0.5/magic/Data/Public/js/jquery.nicescroll.min.js"></script>
</head>
<body>
<script>
  $(document).ready(function() {    
	$("html").niceScroll();
  });
</script>
<iframe id="blank" name="blank"  style="display:none" ></iframe>
<div class="rightinfo">
    <div class="tools">
		<ul class="toolbar">
			<li><a <?php if(Q('get.table')){ ?> href="?r=database-fields&table=<?php echo Q('get.table');?>" <?php }else{ ?> style="color:#ccc" <?php }?>><span><img src="http://127.0.0.5/magic/Data/Public/images/t10.png" /></span>对象浏览器</a></li>
			<li><a <?php if(Q('get.table')){ ?> href="?r=database-fields-data&table=<?php echo Q('get.table');?>" <?php }else{ ?> style="color:#ccc" <?php }?>><span><img src="http://127.0.0.5/magic/Data/Public/images/t11.png" /></span>数据浏览器</a></li>
			<li><a href="?r=database-sql&table=<?php echo Q('get.table');?>"><span><img src="http://127.0.0.5/magic/Data/Public/images/t02.png" /></span>SQL编辑器</a></li>
			<li><a href="?r=database-export&table=<?php echo Q('get.table');?>"><span><img src="http://127.0.0.5/magic/Data/Public/images/t13.png" /></span>导出</a></li>
			<li><a href="?r=database-import&table=<?php echo Q('get.table');?>"><span><img src="http://127.0.0.5/magic/Data/Public/images/t12.png" /></span>导入</a></li>
		</ul>
    </div>
	<?php if($step=='index'){ ?>	
    <table class="tablelist">
    	<thead>
    	<tr>
        <th>名称</th>
        <th width="180">导出时间</th>
        <th width="150">大小</th>
        <th width="150">操作</th>
        </tr>
        </thead>
        <tbody>
		<?php if (empty($list)){ ?>
			<tr><td colspan="8" align="center" height="35" style="color:#f00">没有备份</td></tr>
		<?php }else{ ?>
		<?php foreach ($list as $key=>$vo){?>
			<tr>
			<td align="center"><?php echo $vo['name'];?></td>
			<td align="center"><?php echo $vo['lastsave'];?></td>
			<td align="center"><?php echo $vo['size'];?></td>
			
			<td align="center">
				<a href="?r=database-import-download&file=<?php echo $vo['name'];?>">下载</a> | 
				<a href="?r=database-import-start&file=<?php echo $vo['name'];?>">导入</a> | 
				<a href="javascript:"  onclick="confirms('备份删除后将无法恢复，<br>请谨慎操作，确认删除？','?r=database-import-del&file=<?php echo $vo['name'];?>')">删除</a>
			</td>
			</tr> 
		<?php }?>
		<?php }?>
        </tbody>
    </table>
    <?php }?>

	<?php if($step=='start'){ ?>
		<style type="text/css">
			.hintsbox{width:500px;margin:70px auto;text-align:center}
			.hints p{font-size:22px;margin:10px}
			.hints b{font-size:22px;}
			#indicatorContainer{width:120px;margin:35px auto;}
		</style>
		<script src="http://127.0.0.5/magic/Data/Public/js/radialindicator.js"></script>
		<div class="hintsbox">
			<div class="hints"><?php echo $msg;?></div>
			<div id="indicatorContainer"></div> 
		</div>
		<script type="text/javascript">
			$('#indicatorContainer').radialIndicator({
				initValue : <?php echo $schedule;?>,
				barWidth:10,
				barColor: {
				0: '#c82e25',
				33: '#FFFF00',
				66: '#ffaa00',
				100: '#83a700'
			},
			percentage: true
		});
		</script>
	<?php }?>
</div>
</body>
</html>
