2020-02-18 10:49:27 +01:00
|
|
|
<?php
|
|
|
|
|
defined('BASEPATH') OR exit('No direct script access allowed');
|
|
|
|
|
|
|
|
|
|
class Distances extends CI_Controller {
|
|
|
|
|
|
|
|
|
|
function __construct()
|
|
|
|
|
{
|
|
|
|
|
parent::__construct();
|
|
|
|
|
|
2024-08-16 10:08:44 +02:00
|
|
|
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('error', __("You're not allowed to do that!")); redirect('dashboard'); }
|
2020-02-18 10:49:27 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function index()
|
|
|
|
|
{
|
|
|
|
|
// Render Page
|
2024-06-08 11:01:59 +02:00
|
|
|
$data['page_title'] = __("Distances Worked");
|
2020-02-18 10:49:27 +01:00
|
|
|
|
2021-11-13 15:55:17 +01:00
|
|
|
$this->load->model('bands');
|
|
|
|
|
$data['bands_available'] = $this->bands->get_worked_bands_distances();
|
|
|
|
|
$data['sats_available'] = $this->bands->get_worked_sats();
|
2026-05-07 15:39:10 +02:00
|
|
|
$data['orbits'] = $this->bands->get_worked_orbits();
|
|
|
|
|
$data['user_default_band'] = $this->session->userdata('user_default_band');
|
2026-05-07 22:07:12 +02:00
|
|
|
$data['adif_propmodes'] = $this->config->item('adif_propmodes');
|
2020-02-18 10:49:27 +01:00
|
|
|
|
2026-08-12 16:51:04 +02:00
|
|
|
$this->load->model('distances_model');
|
|
|
|
|
$data['modes'] = $this->distances_model->get_worked_modes();
|
|
|
|
|
|
2020-02-18 10:49:27 +01:00
|
|
|
$this->load->view('interface_assets/header', $data);
|
|
|
|
|
$this->load->view('distances/index');
|
|
|
|
|
$this->load->view('interface_assets/footer');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function get_distances(){
|
|
|
|
|
// POST data
|
|
|
|
|
$postData = $this->input->post();
|
|
|
|
|
|
|
|
|
|
//load model
|
|
|
|
|
$this->load->model('Distances_model');
|
|
|
|
|
|
2020-11-20 11:55:55 +01:00
|
|
|
if ($this->session->userdata('user_measurement_base') == NULL) {
|
|
|
|
|
$measurement_base = $this->config->item('measurement_base');
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
$measurement_base = $this->session->userdata('user_measurement_base');
|
|
|
|
|
}
|
|
|
|
|
|
2020-02-18 10:49:27 +01:00
|
|
|
// get data
|
2020-11-20 11:55:55 +01:00
|
|
|
$data = $this->Distances_model->get_distances($postData, $measurement_base);
|
2020-02-18 10:49:27 +01:00
|
|
|
|
|
|
|
|
return json_encode($data);
|
|
|
|
|
}
|
2022-10-05 14:31:33 +01:00
|
|
|
|
|
|
|
|
public function test_distance(){
|
|
|
|
|
// POST data
|
|
|
|
|
$postdata['band'] = "sat";
|
|
|
|
|
$postdata['sat'] = "All";
|
|
|
|
|
|
|
|
|
|
//load model
|
|
|
|
|
$this->load->model('Distances_model');
|
|
|
|
|
|
|
|
|
|
if ($this->session->userdata('user_measurement_base') == NULL) {
|
|
|
|
|
$measurement_base = $this->config->item('measurement_base');
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
$measurement_base = $this->session->userdata('user_measurement_base');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// get data
|
|
|
|
|
$data = $this->Distances_model->get_distances($postdata, $measurement_base);
|
|
|
|
|
|
|
|
|
|
return json_encode($data);
|
|
|
|
|
}
|
2023-07-16 18:10:11 +02:00
|
|
|
|
|
|
|
|
public function getDistanceQsos(){
|
|
|
|
|
$this->load->model('distances_model');
|
|
|
|
|
|
2026-08-12 16:51:04 +02:00
|
|
|
$distance = $this->input->post('distance', true);
|
|
|
|
|
$band = $this->input->post('band', true);
|
|
|
|
|
$sat = $this->input->post('sat', true);
|
|
|
|
|
$propagation = $this->input->post('propagation', true);
|
|
|
|
|
$mode = $this->input->post('mode', true);
|
2023-07-16 18:10:11 +02:00
|
|
|
|
2026-08-12 16:51:04 +02:00
|
|
|
$data['results'] = $this->distances_model->qso_details($distance, $band, $sat, $propagation, $mode);
|
2026-05-07 22:07:12 +02:00
|
|
|
$data['adif_propmodes'] = $this->config->item('adif_propmodes');
|
2023-07-16 18:10:11 +02:00
|
|
|
|
|
|
|
|
// Render Page
|
|
|
|
|
$data['page_title'] = "Log View - " . $distance;
|
2026-02-24 09:53:37 -05:00
|
|
|
$data['filter'] = __("QSOs with") . " " . $distance . " " . __("and band"). " " . $band. " " . __("and propagation"). " " . $propagation;
|
2023-07-16 18:10:11 +02:00
|
|
|
$this->load->view('awards/details', $data);
|
|
|
|
|
}
|
|
|
|
|
}
|