<? defined('ROOT_PHPLEFT') or exit(require '../../../404.php');?>
<!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=gbk"/>
<link href="css/main.css" type="text/css" rel="stylesheet"> 
<script type="text/javascript" src="<?=PL_URL?>js/common.js"></script>
<script type="text/javascript">
function checkall(f, t) {
	var t = t ? t : 1;
	for(var i = 0; i < f.elements.length; i++) {
		var e = f.elements[i];
		if(e.type != 'checkbox') continue;
		if(t == 1) e.checked = e.checked ? false : true;
		if(t == 2) e.checked = true;
		if(t == 3) e.checked = false;	
	}
}
</script>
</head>

<body>
<div class="tpis"><img src="images/icos.gif" align="absmiddle"/>当前位置：基础设置 > 数据库管理</div>
<table class="usertableborder bb" cellspacing="1" cellpadding="3" width="100%" align="center"
        border="0">
        <tr>
            <th colspan="3">
               备份数据须知：</th>
        </tr>
        </table>
        <div class="tsc">
       1.备份后储存的位置为 “管理后台文件夹(默认admin)/file/backup”<br />
       2.下版本将增加在线数据导入恢复功能，目前备份后若需恢复请使用其他MYSQL导入工具。
</div>
<form method="post" action="phpleft.php?" id="dform">
<input type="hidden" name="file" value="<?php echo $file;?>"/>
<input type="hidden" name="backup" value="1"/>
<table class="usertableborder bb" cellspacing="1" cellpadding="3" width="100%" align="center"
        border="0">
        <tr>
            <th colspan="3">
                系统创建表[共<?php echo $dtotalsize;?>M,<?php echo count($dtables);?>个表]</th>
        </tr>
        </table>
<table class="usertableborder bb" cellspacing="1" cellpadding="3" width="100%" align="center"
        border="0" style="background:#F3F3F3">
<tr class="list1">
<td width="49" align="center">
<input type="checkbox" onclick="checkall(this.form);"/></td>
<td width="77">表 名</td>
<td width="76">表注释</td>
<td width="58">记录数</td>
<td>大小(M)</td>
<td width="143">碎片</td>
<td width="230">操 作</td>
<td width="335"></td>
</tr>
<?php foreach($dtables as $k=>$v) {?>
<tr align="center" class="list">
<td>
<input type="checkbox" name="tables[]" value="<?php echo $v['name'];?>" checked/>
<input type="hidden" name="sizes[<?php echo $v['name'];?>]" value="<?php echo $v['tsize'];?>"/>
</td>
<td align="left">&nbsp;<?php echo $v['name'];?></td>
<td><a href="?file=<?php echo $file;?>&action=comment&table=<?php echo $v['name'];?>&note=<?php echo urlencode($v['note']);?>" title="点击修改表注释"><?php echo $v['note'] ? $v['note'] : '--';?></a></td>
<td class="px11"><?php echo $v['rows'];?></td>
<td width="86" class="px11" title="数据:<?php echo $v['size'];?> 索引:<?php echo $v['index'];?>"><?php echo $v['tsize'];?></td>
<td class="px11"><?php echo $v['chip'];?></td>
<td><!--<a href="?file=<?php echo $file;?>&action=optimize&tables=<?php echo $v['name'];?>">优化</a> | <a href="?file=<?php echo $file;?>&action=repair&tables=<?php echo $v['name'];?>">修复</a> | <a href="?file=<?php echo $file;?>&action=export&table=<?php echo $v['name'];?>">下载</a>--></td>
<td></td>
</tr>
<?php }?>
</table>
<?php if($tables) {?>
<table class="usertableborder bb" cellspacing="1" cellpadding="3" width="100%" align="center"
        border="0">
        <tr>
            <th colspan="3">
                其他数据表[共<?php echo $totalsize;?>M,<?php echo count($tables);?>个表]</th>
        </tr>
        </table>
<table class="usertableborder bb" cellspacing="1" cellpadding="3" width="100%" align="center"
        border="0" style="background:#F3F3F3">
<tr class="list1">
<td width="49">-</td>
<td width="77">表 名</td>
<td width="76">表注释</td>
<td width="58">记录数</td>
<td>大小(M)</td>
<td width="143">碎片</td>
<td width="230">操 作</td>
<td width="335"></td>
</tr>
<?php foreach($tables as $k=>$v) {?>
<tr align="center" class="list">
<td>
<input type="checkbox" name="tables[]" value="<?php echo $v['name'];?>"/>
<input type="hidden" name="sizes[<?php echo $v['name'];?>]" value="<?php echo $v['tsize'];?>"/>
</td>
<td align="left">&nbsp;<?php echo $v['name'];?></td>
<td><a href="?file=<?php echo $file;?>&action=comment&table=<?php echo $v['name'];?>&note=<?php echo urlencode($v['note']);?>" title="点击修改表注释"><?php echo $v['note'] ? $v['note'] : '--';?></a></td>
<td class="px11"><?php echo $v['rows'];?></td>
<td width="86"  class="px11" title="数据:<?php echo $v['size'];?> 索引:<?php echo $v['index'];?>"><?php echo $v['tsize'];?></td>
<td class="px11"><?php echo $v['chip'];?></td>
<td><!--<a href="?file=<?php echo $file;?>&action=optimize&tables=<?php echo $v['name'];?>">优化</a> | <a href="?file=<?php echo $file;?>&action=repair&tables=<?php echo $v['name'];?>">修复</a> | <a href="?file=<?php echo $file;?>&action=export&table=<?php echo $v['name'];?>">下载</a>--></td>
<td></td>
</tr>
<?php }?>
</table>
<?php } ?>
<table class="usertableborder bb" cellspacing="1" cellpadding="3" width="100%" align="center"
        border="0">
        <tr>
            <th colspan="3">
                备份选中表(请备份常用表)</th>
        </tr>
        </table>
<table cellpadding="2" cellspacing="1" class="tb">
<tr>
<td width="120">&nbsp;&nbsp;&nbsp;分卷文件大小</td>
<td>

&nbsp;<input type="text" name="sizelimit" value="2048" size="5"/> K</td>
</tr>
<tr>
<td>&nbsp;&nbsp;&nbsp;建表语句格式</td>
<td>&nbsp;<input type="radio" name="sqlcompat" value="" checked="checked"/> 默认 &nbsp;</td>
</tr>
<tr>
<td>&nbsp;&nbsp;&nbsp;强制字符集</td>
<td>&nbsp;<input type="radio" name="sqlcharset" value="" checked/> 默认 &nbsp; <input type="radio" name="sqlcharset" value="utf8"/> UTF-8 &nbsp; <input type="radio" name="sqlcharset" value="gbk"/> GBK &nbsp; <input type="radio" name="sqlcharset" value="latin1"/> LATIN1</td>
</tr>
</table>
<div class="btns">
<input type="submit" name="submit" value="开始备份" class="btn"/>&nbsp;<!--
<input type="submit" value="优化表" class="btn" onclick="this.form.action='?file=<?php echo $file;?>&action=optimize';"/>&nbsp;
<input type="submit" value="修复表" class="btn" onclick="this.form.action='?file=<?php echo $file;?>&action=repair';"/>&nbsp;
<input type="submit" value="重建注释" class="btn" onclick="if(confirm('确定要重建表注释吗？')){this.form.action='?file=<?php echo $file;?>&action=comments';}else{return false;}"/>-->&nbsp;
</div>
</form>
<br/>
<script type="text/javascript">
function Dict(t, n) {
	mkDialog('', '<iframe src="?file=tag&action=dict&table='+t+'&note='+n+'" width="600" height=300" border="0" vspace="0" hspace="0" marginwidth="0" marginheight="0" framespacing="0" frameborder="0" scrolling="yes"></iframe>', '数据字典', 620, 0, 0);
}
</script>
<script type="text/javascript">Menuon(0);</script>

    
</body>
</html>
