<?php if (!defined('THINK_PATH')) exit(); $big_menu = array('恢复数据库' => U('recover')); ?>
<!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" />
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta name="author" content="HANCHAO"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
<?php $csscommon="/Public/bootstrap/css/bootstrap.min.css" ?>
<?php $csscommon.="|/Public/HanChaoUI/css/hanchaoui.css" ?>
<?php $CSSARR[]=THEME_PATH."/common/css/main.css" ?>
<?php $CSSARR[]="/Public/HanChaoUI/css/weebox.css" ?>
<link rel="stylesheet" href="<?php echo min_css($CSSARR,$csscommon);?>" media="all"/>
<?php $jscommon="/Public/script/jquery.min.js" ?>
<?php $jscommon.="|/Public/bootstrap/js/bootstrap.min.js" ?>
<?php $JSARR['min2']=THEME_PATH."/common/js/common.js" ?>
<?php $JSARR['min3']="/Public/HanChaoUI/js/weebox.js" ?>
<script language="javascript">var URL = '/admin.php?s=/database/';var THEME_COLOR = '';var ROOT_PATH = '/';var APP   =   '/admin.php?s=/';var CONTROLLER_NAME   =   '<?php echo (CONTROLLER_NAME); ?>';var THEME_PATH   =   '<?php echo (TPL_PATH); ?>/';</script>
<script type="text/javascript" src="<?php echo min_js($JSARR,$jscommon);?>"></script><!--[if IE]>
<link href="/Public/bootstrap/css/bootstrap.ie.css" rel="stylesheet" type="text/css"/>
 <script src="/Public/bootstrap/js/html5shiv.js"></script>
<![endif]-->
<script language="javascript">
$(function($){
    $(window.parent.document).find('#loading').hide();
    var topid='<?php echo ($_GET['topid']); ?>';
    var leftid='<?php echo ($_GET['leftid']); ?>';
    changemenu(topid,leftid);
});
function changemenu(topid,leftid){
    if(!topid && !leftid)return false;
    if(topid)parent._OPENleft(topid);
    if(leftid){
        $(window.parent.document).find('#_OPENright'+leftid).parent().prev().click();
        $(window.parent.document).find('#_OPENright'+leftid+' a').click();
    }
}
</script>
<title><?php echo (L("website_manage")); ?>Powered by hanchao</title>
</head>
<body><?php if(!empty($big_menu)): ?><div class="pad-lr-10 col-sm-12">
    <div class="btn-handle mt15">
   <?php if(is_array($big_menu)): foreach($big_menu as $k=>$vo): ?><a class="btn <?php if(!empty($menu_hover)): if(in_array(($k), is_array($menu_hover)?$menu_hover:explode(',',$menu_hover))): ?>btn-primary<?php else: ?>btn-default<?php endif; ?>                
   <?php else: ?>btn-primary<?php endif; ?>" href="<?php echo (isset($vo)?$vo:''); ?>"><?php echo (isset($k)?$k:''); ?></a>&nbsp;&nbsp;<?php endforeach; endif; ?>
    </div>
</div><?php endif; ?>
<div class="pad-lr-10 col-sm-12">
    <form id="myform" name="myform" method="post" action="">
        <div>
            <table class="table table-hover table-striped table-hanchao mt15 table-bordered">
                <tbody>
                    <tr>
                        <td colspan="7">数据库管理</td>
                    </tr>
                    <tr>
                        <td>选择</td>
                        <td><?php echo L('NAME');?></td>
                        <td><?php echo L('TYPE');?></td>
                        <td>字符集</td>
                        <td>记录数</td>
                        <td>碎片</td>
                        <td>大小</td>
                    </tr>
                    <?php if(is_array($dataList)): $i = 0; $__LIST__ = $dataList;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><tr>
                        <td><input type="checkbox" name="tables[]" value="<?php echo (isset($vo["name"])?$vo["name"]:''); ?>" id="<?php echo (isset($vo["name"])?$vo["name"]:''); ?>"></td>
                        <td><?php echo (isset($vo["name"])?$vo["name"]:''); ?></td>
                        <td><?php echo (isset($vo["engine"])?$vo["engine"]:''); ?></td>
                        <td><?php echo (isset($vo["collation"])?$vo["collation"]:''); ?></td>
                        <td><?php echo (isset($vo["rows"])?$vo["rows"]:''); ?></td>
                        <td><?php echo (format_bytes($vo["data_free"])); ?></td>
                        <td><?php echo (format_bytes($vo["data_length"])); ?></td>
                    </tr><?php endforeach; endif; else: echo "" ;endif; ?>
                </tbody>
            </table>
        </div>
        <div class="btn col-sm-12">
            <input type="checkbox" value="" id="check_box" onclick="selectall('tables[]');"><?php echo L('SELECT_ALL');?>&nbsp;&nbsp;
            <input type="button" class="btn btn-default"  name="" value="修复" onclick="myform.action='<?php echo U(CONTROLLER_NAME.'/docommand',array('do'=>'repair'));?>';$('#myform').submit();" >
            <input type="button"  class="btn btn-default"  name="" value="检查" onclick="myform.action='<?php echo U(CONTROLLER_NAME.'/docommand',array('do'=>'check'));?>';$('#myform').submit();">
            <input type="button"  class="btn btn-default"  name="" value="分析" onclick="myform.action='<?php echo U(CONTROLLER_NAME.'/docommand',array('do'=>'analyze'));?>';$('#myform').submit();" >
            分卷大小：<input type="text" name="sizelimit" value="2048" class="input-text" size=4>
            <input type="button" class="btn btn-default"  name="" value="执行备份" onclick="myform.action='<?php echo U(CONTROLLER_NAME.'/backup');?>';$('#myform').submit();">
            <font style="float:right;color:#FB0000">数据库大小：<?php echo (format_bytes($totalSize)); ?></font>
        </div>
    </form>
</div>
</body>
</html>