<?php $tpl = new bQuickTpl(); $tpl->page_title = "Admin Panel - Backup & Restore"; if (!isset($_SESSION['admin_user_id'])) { header("Location: " . _admin_url . "/login"); exit; } //get contents of backup folder $backup_files = directory_contents(getcwd() . "/config/backup_restore", "sql"); //pr($params); if (isset($params[2]) && $params[2] == 'backup') { $backup = backup_db($database); if ($backup) { header("Location: " . _admin_url . "/backup_restore/success/backup"); } else { header("Location: " . _admin_url . "/backup_restore/error/backup"); } } if (isset($params[2]) && $params[2] == 'restore') { $restore = restore_db($database); if ($restore) { header("Location: " . _admin_url . "/backup_restore/success/restore"); } else { header("Location: " . _admin_url . "/backup_restore/error/restore"); } } $tpl->backup_files = $backup_files; include getcwd() . "/modules/adminarea/common.php"; echo $tpl->render("themes/adminarea/html/backup_restore.php");
exit; } if (isset($_GET["start"])) { troubleshoot_start(); exit; } if (isset($_GET["rebuildldap"])) { rebuildldap(); exit; } if (isset($_GET["slapindex"])) { slapindex(); exit; } if (isset($_GET["restore-db"])) { restore_db(); exit; } if (isset($_GET["restore-db-file"])) { restore_db_file(); exit; } if (isset($_GET["artica-branch"])) { artica_branch_js(); exit; } if (isset($_GET["artica-branch-perform"])) { artica_branch_perform(); exit; } js();
$rel_del_id = $_POST['rel_del_id']; $database->delete('fields_mapping', array('id' => $rel_del_id)); } //Relationship ajax Stop //BackUp and Restore ajax Starts if (isset($_POST['action']) and $_POST['action'] == "make_backup") { $backup = backup_db($database); if ($backup == true) { echo 1; } else { echo 0; } } if (isset($_POST['action']) and $_POST['action'] == "restore_db") { $res_path = $_POST['res_path']; $backup = restore_db($database, $res_path); if ($backup == true) { echo 1; } else { echo 0; } } if (isset($_POST['action']) and $_POST['action'] == "get_restore_dates") { $no_backups = true; $backup_points = get_backup_dates(); if (count($backup_points) > 0) { $no_backups = false; } if ($no_backups == true) { echo '<div class="text-danger" style="font-size:16px"> Sorry!! Currently No Backup Dates Are Available<br />Click on Backup Now!! to Create a Database Backup