Location: PHPKode > projects > Template CMS > templatecms_2_0_3_en/plugins/box/backup/BackupAdmin.php
<?php


    /**
     * Backup admin
     */
    function backupAdmin() {

        $backups_path = '../data/backups/';

        $backups_list = array();

        // Create backup
        if(isPost('create_backup')) {
            $zip = new ZipFile();
            $zip->filesArchive('../data');            
            $zip->createArchive($backups_path.dateFormat(time(),"Y-m-d-H-i-s").'.zip');
        }
        
        // Delete backup
        if(get('sub_id') == 'backup') {
            if(get('delete_file')) {
                deleteFile($backups_path.get('delete_file'));
                redirect(getSiteUrl(false).'admin/index.php?id=system&sub_id=backup');
            }
        }

        // Get backup list
        $backups_list = listFiles($backups_path, '.zip');

        // note: styles based on Filesmanger Plugin
        include 'templates/backend/BackupTemplate.php';
    }
Return current item: Template CMS