wavelog/application/controllers/Map.php

42 lines
1.4 KiB
PHP
Raw Normal View History

<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Map extends CI_Controller {
2023-12-27 20:10:45 +01:00
function index() {
2024-03-08 08:46:20 +01:00
redirect('dashboard');
}
2023-12-12 08:18:42 +01:00
// Generic fonction for return Json for MAP //
2023-12-12 14:58:55 +01:00
public function map_plot_json() {
2023-11-30 18:11:22 +01:00
$this->load->model('Stations');
$this->load->model('logbook_model');
2024-02-08 11:18:24 +01:00
2023-12-12 08:18:42 +01:00
// set informations //
2024-03-07 09:28:41 +01:00
$nb_qso = (intval($this->input->post('nb_qso'))>0)?xss_clean($this->input->post('nb_qso')):18;
$offset = (intval($this->input->post('offset'))>0)?xss_clean($this->input->post('offset')):null;
$qsos = $this->logbook_model->get_qsos($nb_qso, $offset);
2023-12-12 08:18:42 +01:00
// [PLOT] ADD plot //
$plot_array = $this->logbook_model->get_plot_array_for_map($qsos->result());
2023-11-30 18:11:22 +01:00
// [MAP Custom] ADD Station //
2023-12-12 08:18:42 +01:00
$station_array = $this->Stations->get_station_array_for_map();
2024-02-08 11:18:24 +01:00
2023-12-12 08:18:42 +01:00
header('Content-Type: application/json; charset=utf-8');
echo json_encode(array_merge($plot_array, $station_array));
}
2023-12-12 08:18:42 +01:00
2024-03-15 07:59:18 +00:00
// Generic fonction for return Json for MAP //
public function glob_plot() {
2024-03-15 08:09:54 +00:00
$footerData = [];
$footerData['scripts'] = [
2024-03-16 15:48:12 +01:00
'assets/js/globe/globe.gl.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/globe/globe.gl.js")),
2024-03-15 08:09:54 +00:00
'assets/js/sections/globe.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/sections/globe.js")),
];
2024-03-15 07:59:18 +00:00
$this->load->view('interface_assets/header');
$this->load->view('globe/index');
2024-03-15 08:09:54 +00:00
$this->load->view('interface_assets/footer',$footerData);
2024-03-15 07:59:18 +00:00
}
}