<?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>
<style type="text/css">
.bd3{text-indent:28px;background:url(http://127.0.0.5/magic/Data/Public/images/bd3.png) 8px center no-repeat;}
</style>
<script>
  $(document).ready(function() {    
	$("html").niceScroll();
  });
</script>
<iframe name="blank" id="blank" style="display:none"></iframe>
<div class="rightinfo">
    <div class="tools">
		<ul class="toolbar">
			<li style="color:#ccc"><span><img src="http://127.0.0.5/magic/Data/Public/images/t10.png" /></span>对象浏览器</li>
			<li style="color:#ccc"><span><img src="http://127.0.0.5/magic/Data/Public/images/t11.png" /></span>数据浏览器</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"><span><img src="http://127.0.0.5/magic/Data/Public/images/t13.png"/></span>导出</a></li>
			<li><a href="?r=database-import"><span><img src="http://127.0.0.5/magic/Data/Public/images/t12.png" /></span>导入</a></li>
			<li><a href="javascript:" onclick="submit('form1','deltable')"><span><img src="http://127.0.0.5/magic/Data/Public/images/t03.png" /></span>删除</a></li>
			<li><a href="javascript:" onclick="submit('form1','truncate')"><span><img src="http://127.0.0.5/magic/Data/Public/images/t03.png" /></span>清空</a></li>
			<li><a href="javascript:" onclick="submit('form1','optimize')"><span><img src="http://127.0.0.5/magic/Data/Public/images/t14.png" /></span>优化</a></li>
			<li><a href="javascript:" onclick="submit('form1','repair')"><span><img src="http://127.0.0.5/magic/Data/Public/images/t05.png" /></span>修复</a></li>
		</ul>
    </div>  
   <form method="post" id="form1" target="blank" action="?r=database-action&action=">  
   <input type="hidden" name="reurl" value="<?php echo urlencode('?r=database&tpl=Database/table');?>">
    <table class="tablelist">
    	<thead>
    	<tr>
        <th width="30"><input type="checkbox" onclick="checkall(this,'id')"/></th>
        <th>表名</th>
        <th width="80">记录</th>
        <th width="80">类型</th>
        <th width="100">整理</th>
        <th width="80">大小</th>
		<th width="80">碎片</th>
		<th width="140">上次更新</th>
		<th width="110">备注</th>
        <th width="110">操作</th>
        </tr>
        </thead>
        <tbody>
		<?php if (empty($table)){ ?>
			<tr><td colspan="15" align="center" height="35" style="color:#f00">没有表</td></tr>
		<?php }else{ ?>
		<?php foreach ($table as $key=>$vo){?>
			<tr>
			<td align="center"><input type="checkbox" value="<?php echo $vo['tablename'];?>" name="id[]"></td>
			<td class="bd3"><a href="?r=database-fields&table=<?php echo $vo['tablename'];?>" target="tablist"><?php echo $vo['tablename'];?></a></td>
			<td align="center"><?php echo $vo['rows'];?></td>
			<td align="center"><?php echo $vo['engine'];?></td>
			<td align="center"><?php echo $vo['collation'];?></td>
			<td align="center"><?php echo Files::getRealSize($vo['dataSize']);?></td>
			<td align="center"><?php echo Files::getRealSize($vo['dataFree']);?></td>
			<td align="center"><?php echo $vo['updateTime'];?></td>
			<td align="left" style="text-indent:5px"><?php echo $vo['comment'];?></td>
			<td align="center">
				<a href="?r=database-fields&table=<?php echo $vo['tablename'];?>" target="tablist">浏览</a> |
				<a href="javascript:" onclick="load('编辑表','?r=database-action-editable&table=<?php echo $vo['tablename'];?>','450px','320px')";>编辑</a> | 
				<a href="javascript:" onclick="confirms('表删除后将无法恢复，<br>请谨慎操作，确认删除？','?r=database-action&action=deltable&id=<?php echo $vo['tablename'];?>&reurl=<?php echo urlencode('?r=database&tpl=Database/table');?>')">删除</a>
			</td>
			</tr> 
		<?php }?>
		<?php }?>
        </tbody>
    </table>
    </form>
    </div>
<script type="text/javascript">$('.tablelist tbody tr:odd').addClass('odd');</script>
</body>
</html>
