Cloudlog/application/controllers/Backup.php

74 wiersze
1.8 KiB
PHP
Czysty Zwykły widok Historia

<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Backup extends CI_Controller {
2019-10-05 18:35:55 +00:00
function __construct()
{
parent::__construct();
}
/* User Facing Links to Backup URLs */
public function index()
{
2020-08-10 22:26:02 +00:00
$this->load->model('user_model');
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
2011-11-04 17:32:03 +00:00
$data['page_title'] = "Backup";
2019-01-14 16:29:06 +00:00
$this->load->view('interface_assets/header', $data);
$this->load->view('backup/main');
2019-01-14 16:29:06 +00:00
$this->load->view('interface_assets/footer');
}
2011-10-01 18:35:23 +00:00
/* Gets all QSOs and Dumps them to logbook.adi */
public function adif(){
$this->load->helper('file');
// Set memory limit to unlimited to allow heavy usage
ini_set('memory_limit', '-1');
$this->load->model('adif_data');
$data['qsos'] = $this->adif_data->export_all();
if ( ! write_file('backup/logbook.adi', $this->load->view('backup/exportall', $data, true)))
{
$data['status'] = false;
}
else
{
$data['status'] = true;
}
2011-11-04 17:32:03 +00:00
$data['page_title'] = "ADIF - Backup";
2019-01-14 16:29:06 +00:00
$this->load->view('interface_assets/header', $data);
2011-11-04 17:32:03 +00:00
$this->load->view('backup/adif_view');
2019-01-14 16:29:06 +00:00
$this->load->view('interface_assets/footer');
}
2011-10-01 18:35:23 +00:00
/* Export the notes to XML */
public function notes() {
$this->load->helper('file');
$this->load->model('note');
$data['list_note'] = $this->note->list_all();
if ( ! write_file('backup/notes.xml', $this->load->view('backup/notes', $data, true)))
{
$data['status'] = false;
}
else
{
$data['status'] = true;
}
2011-11-04 17:32:03 +00:00
$data['page_title'] = "Notes - Backup";
2019-01-14 16:29:06 +00:00
$this->load->view('interface_assets/header', $data);
2011-11-04 17:32:03 +00:00
$this->load->view('backup/notes_view');
2019-01-14 16:29:06 +00:00
$this->load->view('interface_assets/footer');
2011-10-01 18:35:23 +00:00
}
}
/* End of file Backup.php */