<?php
require_once('inc/common.inc.php');
CommTool::checkIncludeByAdminPhp();

$info = array();
$infos = array();
$sqlFiles = glob(KUWEBS_ADMIN_PATH.'databak/kuwebs_sql_*.zip');
if(is_array($sqlFiles))
{
  $prePre = '';
  foreach($sqlFiles as $key=>$file)
  {
    if(preg_match("/(kuwebs_sql_[0-9]{14})\.zip/i", basename($file), $num))
    {
      $info['fileName'] = basename($file);
      $info['fileSize'] = round(filesize($file)/1024, 2);
      $info['makeTime'] = date('Y-m-d H:i:s', filemtime($file));
      $info['pre'] = $num[1];
      $info['number'] = $num[2];
      if(!$id) $prebgcolor = '#CFEFFF';
      if($info['pre'] == $prepre)
      {
       $info['bgcolor'] = $prebgcolor;
      }
      else
      {
       $info['bgcolor'] = $prebgcolor == '#CFEFFF' ? '#F1F3F5' : '#CFEFFF';
      }
      $prebgcolor = $info['bgcolor'];
      $prepre = $info['pre'];
      $infos[] = $info;
    }
  }
}

include_once template('restore.html', $adminTemplateName);
?>