<?php
/*
* @package LabCMS
* @copyright (c) 2006 Alexander Levin aka Loki (loki_angel@mail.ru)
* @support http://labcms.ru
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*/
include dirname(__FILE__)."/config.php";

$mod_template="dump_list.tpl";
$files=glob(PATH.'*.sql.gz');

$dump_list=array();

if ($files) {
	foreach ($files as $var) {
		if (preg_match('/(\d{4})-(\d{2})-(\d{2})_(\d{2})-(\d{2})/', basename($var), $time))
			$time=mktime($time[4], $time[5], 0, $time[2], $time[3], $time[1]);
		else
			$time=filemtime($var);
		$dump_list[$time]=array(
							'name' =>basename($var),
							'time' =>$time,
							'size' =>round(filesize($var) / 1048576, 2) .' '._m("МБ"));
	}
	krsort($dump_list);
}

Tpl::i()->assign('dump_list', $dump_list);