2023-02-09 01:05:36 +01:00
|
|
|
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
|
|
|
|
|
|
|
|
|
|
class Continents extends CI_Controller {
|
|
|
|
|
|
2026-07-24 13:46:53 +02:00
|
|
|
function __construct() {
|
|
|
|
|
parent::__construct();
|
|
|
|
|
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('error', __("You're not allowed to do that!")); redirect('dashboard'); }
|
|
|
|
|
}
|
|
|
|
|
|
2023-02-09 01:05:36 +01:00
|
|
|
public function index()
|
|
|
|
|
{
|
|
|
|
|
$this->load->model('bands');
|
2023-02-09 12:35:30 +01:00
|
|
|
$this->load->model('logbookadvanced_model');
|
2025-01-24 15:55:20 +01:00
|
|
|
$this->load->model('gridmap_model');
|
2023-02-09 12:35:30 +01:00
|
|
|
|
|
|
|
|
$data['bands'] = $this->bands->get_worked_bands();
|
2025-01-24 15:55:20 +01:00
|
|
|
$data['modes'] = $this->gridmap_model->get_worked_modes();
|
2026-07-24 13:46:53 +02:00
|
|
|
|
2023-02-09 01:05:36 +01:00
|
|
|
// Render User Interface
|
|
|
|
|
|
|
|
|
|
// Set Page Title
|
2024-06-08 11:01:59 +02:00
|
|
|
$data['page_title'] = __("Continents");
|
2023-02-09 01:05:36 +01:00
|
|
|
|
|
|
|
|
// Load Views
|
|
|
|
|
$this->load->view('interface_assets/header', $data);
|
|
|
|
|
$this->load->view('continents/index');
|
|
|
|
|
$this->load->view('interface_assets/footer');
|
|
|
|
|
}
|
2025-01-24 15:55:20 +01:00
|
|
|
|
2023-02-09 01:05:36 +01:00
|
|
|
|
|
|
|
|
public function get_continents() {
|
2023-02-09 12:35:30 +01:00
|
|
|
|
|
|
|
|
$searchCriteria = array(
|
|
|
|
|
'mode' => xss_clean($this->input->post('mode')),
|
|
|
|
|
'band' => xss_clean($this->input->post('band')),
|
|
|
|
|
);
|
|
|
|
|
|
2023-02-09 01:05:36 +01:00
|
|
|
$this->load->model('logbook_model');
|
|
|
|
|
|
|
|
|
|
$continentsstats = array();
|
|
|
|
|
|
2023-02-09 12:35:30 +01:00
|
|
|
$total_continents = $this->logbook_model->total_continents($searchCriteria);
|
2023-02-09 01:05:36 +01:00
|
|
|
$i = 0;
|
|
|
|
|
|
|
|
|
|
if ($total_continents) {
|
|
|
|
|
foreach($total_continents->result() as $qso_numbers) {
|
|
|
|
|
$continentsstats[$i]['cont'] = $qso_numbers->COL_CONT;
|
|
|
|
|
$continentsstats[$i++]['count'] = $qso_numbers->count;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
header('Content-Type: application/json');
|
|
|
|
|
echo json_encode($continentsstats);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|