<?php if (!defined("_VALID_PHP")) { die('Direct access to this location is not allowed.'); } require_once BASEPATH . "lib/class_dbtools.php"; $tools = new dbTools(); if (isset($_GET['backupok']) && $_GET['backupok'] == "1") { $core->msgOk('<span>Success!</span>Backup created successfully!', 1, 1); } if (isset($_GET['restore']) && $_GET['restore'] == "1") { $core->msgOk('<span>Success!</span>Database restored successfully!', 1, 1); } if (isset($_GET['create']) && $_GET['create'] == "1") { $tools->doBackup('', false); } if (isset($_POST['backup_file'])) { $tools->doRestore($_POST['backup_file']); } ?> <h1><img src="../images/system-lrg.png" alt="" />Database Maintenance</h1> <p class="info">Make sure your database is backed up frequently. Click on Create backup to manually backup your database.<br /> The backups are stored in the [<strong>/admin/backups/</strong>] folder and can be downloaded from the list below. <br /> Your most recent backup is highlighted. Make sure you download your most recent backup, and delete the rest.</p> <h2><span> <button onclick="window.location='index.php?do=backup&create=1';" type="button" class="button-alt-sml">Create Backup</button> </span>Viewing Most Recent Backups</h2> <div id="backup"> <?php $dir = BASEPATH . 'admin/backups/';
if (!checkPerms($this->user["userType"], $pageType)) { header("Location: Unauthorized.php" . $this->sess->url("")); exit; } $this->tpl = new rpts_Template(getcwd(), "keep"); $this->tpl->set_file("rptsTemplate", "DBTools.htm"); $this->tpl->set_var("TITLE", "DB Tools"); } function Main() { $this->tpl->set_var("HTTP_HOST", $_SERVER["HTTP_HOST"]); $this->tpl->set_var("uname", $this->user["uname"]); $this->tpl->set_var("today", date("F j, Y")); $this->tpl->set_var("Session", $this->sess->url("")); $this->tpl->parse("templatePage", "rptsTemplate"); $this->tpl->finish("templatePage"); $this->tpl->p("templatePage"); } } ##################################### # Define Procedures and Functions ##################################### ########################################################## # Begin Program Script ########################################################## //* page_open(array("sess" => "rpts_Session", "auth" => "rpts_Challenge_Auth", "perm" => "rpts_Perm")); //*/ $obj = new dbTools($sess); $obj->Main(); page_close();