backup onder beheer
This commit is contained in:
@@ -0,0 +1,41 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Created by Pensare Software.
|
||||||
|
* User: Theo Weijmer
|
||||||
|
* Date: 2019-01-02
|
||||||
|
* Time: 17:13
|
||||||
|
*/
|
||||||
|
|
||||||
|
class DownloadDB extends MY_Controller {
|
||||||
|
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
parent::__construct();
|
||||||
|
|
||||||
|
if ( AUTHENTICATED == FALSE ) die( 'NO ACCESS' );
|
||||||
|
}
|
||||||
|
|
||||||
|
public function index()
|
||||||
|
{
|
||||||
|
$this->load->dbutil();
|
||||||
|
|
||||||
|
$filename = "backupDBOIS_" . date( 'YmdHis' );
|
||||||
|
|
||||||
|
$prefs = [
|
||||||
|
'tables' => [], // Array of tables to backup.
|
||||||
|
'ignore' => [], // List of tables to omit from the backup
|
||||||
|
'format' => '', // gzip, zip, txt
|
||||||
|
'filename' => NULL, // File name - NEEDED ONLY WITH ZIP FILES
|
||||||
|
'add_drop' => TRUE, // Whether to add DROP TABLE statements to backup file
|
||||||
|
'add_insert' => TRUE, // Whether to add INSERT data to backup file
|
||||||
|
'newline' => "\n" // Newline character used in backup file
|
||||||
|
];
|
||||||
|
|
||||||
|
$backup = $this->dbutil->backup( $prefs );
|
||||||
|
|
||||||
|
// Load the download helper and send the file to your desktop
|
||||||
|
$this->load->helper( 'download' );
|
||||||
|
force_download( $filename . '.sql', $backup );
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -45,6 +45,7 @@
|
|||||||
<script src="js/lib/modules/reports/employeeHours.js?version=<?= $this->version ?>"></script>
|
<script src="js/lib/modules/reports/employeeHours.js?version=<?= $this->version ?>"></script>
|
||||||
<script src="js/lib/modules/reports/invoicereport.js?version=<?= $this->version ?>"></script>
|
<script src="js/lib/modules/reports/invoicereport.js?version=<?= $this->version ?>"></script>
|
||||||
<script src="js/lib/modules/reports/reservations.js?version=<?= $this->version ?>"></script>
|
<script src="js/lib/modules/reports/reservations.js?version=<?= $this->version ?>"></script>
|
||||||
|
<script src="js/lib/modules/beheer/backupdbModule.js?version=<?= $this->version ?>"></script>
|
||||||
|
|
||||||
<!-- ***********MODALS************* -->
|
<!-- ***********MODALS************* -->
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
/**
|
||||||
|
* Created by Pensare Software.
|
||||||
|
* User: Theo Weijmer
|
||||||
|
* Date: 2019-01-02
|
||||||
|
* Time: 17:09
|
||||||
|
*/
|
||||||
|
|
||||||
|
dbo.backupdbInit = function(){
|
||||||
|
|
||||||
|
window.open( 'index.php/utils/downloaddb' );
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user