<!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>
<title>系统后台</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<link type="text/css" rel="stylesheet" href="<?php echo $this->basedir;?>images/admin/public.css" />
<link type="text/css" rel="stylesheet" href="<?php echo $this->basedir;?>images/admin/style.css" />
<link href="../../images/admin/public.css" rel="stylesheet" type="text/css" />
<link href="../../images/admin/style.css" rel="stylesheet" type="text/css" />
<script src="<?php echo $this->basedir;?>js/jquery.js" language="javascript"></script>
<script src="<?php echo $this->basedir;?>js/calendar.js" language="javascript"></script>
<script language="javascript">
$(document).ready(function() {
     $("#ta tr").mouseover(function(){
      $(this).addClass("over");
     });
     $("#ta tr").mouseout(function(){
      $(this).removeClass("over");
     });
	 $("#ta tr:even").addClass("double");
	 $('#mostrar').click(function(){$('#sh').toggle();});
	 /*全选*/
	 $("#checkall").click(function() {
	 	$("input[@name='id[]']").each(function() {
			$(this).attr("checked", $('#checkall').attr('checked'));
		});
	});
	 $("#all").click(function() {
	 	$("input[@name='id[]']").each(function() {
			$(this).attr("checked", $('#all').attr('checked'));
		});
	});
});
function backup(){
	var frm = document.form1;
	$('#sub').val('正在备份请稍后...');
	document.getElementById('sub').disabled = true;
	frm.onsubmit();
	return true;
}
</script>
<body>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
  <tr align="center" valign="top">
    <td width="*" align="center" valign="top">
	<!-- ######### begin ######### -->
      <div class="Block">

        <div class="BlockBar">备份数据库</div>

		<form id="form1" name="form1" method="post" action="<?php echo $this->installdir;?>vodcms/backup/" onsubmit="return backup();">
        <table border="0" align="center" cellpadding="4" cellspacing="1" class="tab">
          <tr class="row">
            <td width="19%">备份数据库：</td>
            <td width="16%"><select name="pagesize" id="pagesize">
              <option value="1" selected="selected">1M</option>
              <option value="2" >2M</option>
              <option value="5">5M</option>
              <option value="9999">不分卷</option>
                </select>
              </td>
            <td width="21%"><input name="ext" type="radio" class="radio" value=".sql" checked="checked" />
              sql
              <input name="ext" type="radio" class="radio" value=".gz" />
              gzip</td>
            <td width="44%"><select name="charset" id="charset">
              <option value="gbk">编码：GBK</option>
              <option value="utf8">编码：UTF8</option>
              </select>
              <input type="submit" value="开始备份" id="sub" /></td>
          </tr>
        </table>
		</form>
		<div class="BlockBar">已备份文件</div>
        <table width="100%" border="0" cellpadding="4" cellspacing="1" class="tab" id="ta">
          <tr class="rows">
            <td colspan="5" class="align-left">当前位置：<?php if ($this->path){echo '<a href="'.$this->installdir.'vodcms/backup/path/'.base64_encode(dirname($this->path)).'/">'.$this->path.'</a>';}else{ echo '根目录';}?></td>
          </tr>
          <tr class="sub">
            <td width="18%" class="align-center">编号</td>
            <td width="27%" class="align-center">文件名/目录名</td>
            <td width="17%" class="align-center">建立时间</td>
            <td width="19%" class="align-center">文件大小</td>
            <td width="19%" class="align-center">管理</td>
          </tr>

		  <?php
		  if (is_array($this->files))
		  foreach($this->files as $numeric=>$filename){?>
          <tr class="rows">
            <td class="align-center"><?php echo $numeric;?></td>
            <td align="left" class="align-left"><?php if (is_dir($filename)){ echo '<a href="'.$this->installdir.'vodcms/backup/path/'.base64_encode($filename).'/">'.basename($filename).'</a>';}else{ echo(basename($filename));}?></td>
            <td class="align-center"><?php echo date('Y-m-d H:i:s', filectime($filename));?></td>
            <td class="align-center"><?php if(is_file($filename)){echo round(filesize($filename) / 1000/1024 , 3);}else{echo round(disk_total_space($filename) / 1000/1024 , 3); }?>MB</td>
            <td class="align-center"><?php if (is_file($filename)){?><a href="<?php echo $this->installdir;?>vodcms/down/filename/<?php echo base64_encode($filename);?>/">下载</a><?php }?> <a href="<?php echo $this->installdir;?>vodcms/import/filename/<?php echo base64_encode($filename);?>/" onclick="return confirm('确认导入吗!本次操作可能影响数据库结构!\n如果您不清楚此次操作的原因请取消')" >导入</a> <a href="<?php echo $this->installdir;?>vodcms/delete/filename/<?php echo base64_encode($filename);?>/" onclick="return confirm('确认删除吗')">删除</a></td>
          </tr>
		  <?php
		  }?>
        </table>
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td><?php echo $this->printpage;?></td>
          </tr>
        </table> 
      </div>
      <div id="App-Version-Prompt" style="display:none;">
        <div class="space"></div>
        <div class="Block">
          <div class="BlockBar">版本更新信息</div>
          <div class="BlockContent" id="App-Version-Prompt-Body" style="padding:20px 5px 20px 5px; text-align:center; background:#FFFFCC;">loading...</div>
        </div>
      </div>
      <!-- ########## end ########## -->
    </td>
    <td width="5"></td>
    <td width="150" align="center" valign="top">
    <?php
	echo $this->render('menu');
	?>
     </td>
  </tr>
</table>
<?php
echo $this->render('copyright');
?>
</body>
</html>

