<?php defined('APP_NAME') || exit('Access Denied'); 
?><!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta name="Author" content="QQ:401421567" />
<link rel="stylesheet" href="<?php echo(isset($C['admin_static']) ? $C['admin_static'] : ''); ?>admin/css/bootstrap.min.css" />
<link rel="stylesheet" href="<?php echo(isset($C['admin_static']) ? $C['admin_static'] : ''); ?>admin/css/me.css" />
<script>var admin_static = "<?php echo(isset($C['admin_static']) ? $C['admin_static'] : ''); ?>" , cookie_pre = "<?php echo(isset($C['cookie_pre']) ? $C['cookie_pre'] : ''); ?>",_vip_key = "<?php echo(isset($vip['_key']) ? $vip['_key'] : ''); ?>",api_url = "<?php echo(isset($vip['api_url']) ? $vip['api_url'] : ''); ?>",_control = "<?php echo(isset($_GET['control']) ? $_GET['control'] : ''); ?>",_action = "<?php echo(isset($_GET['action']) ? $_GET['action'] : ''); ?>",version = '<?php echo(isset($vip['version']) ? $vip['version'] : ''); ?>',release = '<?php echo(isset($vip['release']) ? $vip['release'] : ''); ?>',vip_key = _vip_key;</script>
<script src="<?php echo(isset($C['admin_static']) ? $C['admin_static'] : ''); ?>admin/js/jquery.js"></script>
<script src="<?php echo(isset($C['admin_static']) ? $C['admin_static'] : ''); ?>admin/js/bootstrap.min.js"></script>
<script src="<?php echo(isset($C['admin_static']) ? $C['admin_static'] : ''); ?>js/layer/layer.js"></script>
<script src="<?php echo(isset($C['admin_static']) ? $C['admin_static'] : ''); ?>admin/js/global.js"></script>
<!--[if lt IE 9]>
  <script src="<?php echo(isset($C['admin_static']) ? $C['admin_static'] : ''); ?>admin/js/html5.js"></script>
  <script src="<?php echo(isset($C['admin_static']) ? $C['admin_static'] : ''); ?>admin/js/respond.min.js"></script>
<![endif]-->
<script type="text/javascript">
	var webdir = '<?php echo(isset($pp['webdir']) ? $pp['webdir'] : ''); ?>';
	layer.config({
		extend: 'extend/layer.ext.js',
		shift: -1
	});
	var pKey = "<?php echo(isset($_pkey) ? $_pkey : ''); ?>", urlKey = "<?php echo(isset($_ukey) ? $_ukey : ''); ?>", place = "<?php echo(isset($_place) ? $_place : ''); ?>";
	//全选与全不选
	function selectall(name,obj) {
		if ($(obj).is(':checked')) {
			$("input[name='"+name+"']").each(function() {
				$(this).prop('checked', true);
			});
		} else {
			$("input[name='"+name+"']").each(function() {
				$(this).prop('checked', false);
			});
		}
	}
</script>
<title><?php echo(isset($_title) ? $_title : ''); ?></title>
</head>
<body>
<form method="post" id="myform" action="index.php?u=database-index">
<div class="container-fluid">
	<div class="panel panel-default">
		<?php if (!empty($list)) { ?>
		<table class="table table-bordered table-hover">
			<tr>
				<th style="width:30px"></th>
				<th>表名</th>
				<th class="text-center" style="width:150px">类型</th>
				<th class="text-center" style="width:150px">字符集</th>
				<th class="text-center" style="width:150px">记录数</th>
				<th class="text-center" style="width:150px">碎片</th>
				<th class="text-center" style="width:100px">大小</th>
			</tr>
			<?php if(isset($list) && is_array($list)) { foreach($list as &$v) { ?>
				<tr class="li">
					<td><input type="checkbox" value="<?php echo(isset($v['Name']) ? $v['Name'] : ''); ?>" name="tables[]" class="inputcheckbox "></td>
					<td align="left"><?php echo(isset($v['Name']) ? $v['Name'] : ''); ?></td>
					<td class="text-center"><?php echo(isset($v['Engine']) ? $v['Engine'] : ''); ?></td>
					<td class="text-center"><?php echo(isset($v['Collation']) ? $v['Collation'] : ''); ?></td>
					<td class="text-center"><?php echo(isset($v['Rows']) ? $v['Rows'] : ''); ?></td>       
					<td class="text-center"><?php echo(isset($v['Data_free']) ? $v['Data_free'] : ''); ?></td>
					<td class="text-center"><?php echo(isset($v['Data_length']) ? $v['Data_length'] : ''); ?></td>
				</tr>
			<?php }} ?>
		</table>
		<?php } ?>
		<div class="panel-footer">
			<label class="checkbox-inline"><input type="checkbox" onclick="selectall('tables[]',this);">全选</label> 
			<input type="button" class="btn btn-default" value="修复" onclick="myform.action='index.php?u=database-docommand-do-REPAIR';$('#myform').submit();" >
			<input type="button" class="btn btn-default" value="优化" onclick="myform.action='index.php?u=database-docommand-do-OPTIMIZE';$('#myform').submit();">
			<input type="button" class="btn btn-default" value="检查" onclick="myform.action='index.php?u=database-docommand-do-CHECK';$('#myform').submit();">
			<input type="button" class="btn btn-default" value="分析" onclick="myform.action='index.php?u=database-docommand-do-ANALYZE';$('#myform').submit();" >
			<span class="pull-right text-danger">数据库大小：<?php echo(isset($totalSize) ? $totalSize : ''); ?></span>
		</div>
	</div>
</div>
</form>
</body>
</html>