backup list and backup download (.sql)

This commit is contained in:
Ricsi
2017-02-23 23:32:02 +01:00
parent 7096af6df3
commit 9440072ee0
9 changed files with 217 additions and 1 deletions

View File

@@ -136,6 +136,26 @@ switch ($this->get_id()) {
case 'money_expense_category':
# ÚJ KIADÁS KATEGÓRIA
$smarty->display('money_expense_category_create.tpl');
break;
case 'backup':
# BACKUP
//létrehozzá, és hozzáfűzi az ID-t a dátumhoz
//visszatér a backup oldalra
//backup classből hívogat, statikusan
$new_bu_id = $sql->insert_into('backup', array('bu_date' => date('Y-m-d')));
$sql->update_table('backup', array('bu_name' => date('Ymd') . '_' . $new_bu_id), array('bu_id' => $new_bu_id));
//log
$dump_content = $sql->export_database();
$file_name = date('Ymd') . '_' . $new_bu_id . '.sql';
$path = 'backup/';
touch($path.$file_name);
file_put_contents($path.$file_name, $dump_content);
header("Location: /admin/settings/3");
break;
default:
# code...