diff --git a/application/controllers/Sattimers.php b/application/controllers/Sattimers.php index a89a5148..bdcfdcfd 100644 --- a/application/controllers/Sattimers.php +++ b/application/controllers/Sattimers.php @@ -10,15 +10,38 @@ class Sattimers extends CI_Controller { } public function index() { + $this->load->model('stations'); $footerData = []; $footerData['scripts'] = [ 'assets/js/sections/sattimers.js?' ]; - $url = 'https://www.df2et.de/tevel/api.php'; + $url = 'https://www.df2et.de/tevel/api2.php?grid='.strtoupper($this->stations->find_gridsquare()); $json = file_get_contents($url); $data['activations'] = json_decode($json, true)['data']; + $data['gridsquare'] = strtoupper($this->stations->find_gridsquare()); $data['page_title'] = "Satellite Timers"; + + $CI =& get_instance(); + if($CI->session->userdata('user_date_format')) { + $data['custom_date_format'] = $CI->session->userdata('user_date_format'); + } else { + $data['custom_date_format'] = $CI->config->item('qso_date_format'); + } + + switch ($data['custom_date_format']) { + case "d/m/y": $data['custom_date_format'] = 'DD/MM/YY'; break; + case "d/m/Y": $data['custom_date_format'] = 'DD/MM/YYYY'; break; + case "m/d/y": $data['custom_date_format'] = 'MM/DD/YY'; break; + case "m/d/Y": $data['custom_date_format'] = 'MM/DD/YYYY'; break; + case "d.m.Y": $data['custom_date_format'] = 'DD.MM.YYYY'; break; + case "y/m/d": $data['custom_date_format'] = 'YY/MM/DD'; break; + case "Y-m-d": $data['custom_date_format'] = 'YYYY-MM-DD'; break; + case "M d, Y": $data['custom_date_format'] = 'MMM DD, YYYY'; break; + case "M d, y": $data['custom_date_format'] = 'MMM DD, YY'; break; + default: $data['custom_date_format'] = 'DD/MM/YYYY'; + } + $this->load->view('interface_assets/header', $data); $this->load->view('/sattimers/index', $data); $this->load->view('interface_assets/footer', $footerData); diff --git a/application/views/interface_assets/footer.php b/application/views/interface_assets/footer.php index 30f1cea4..3d6d4cf1 100644 --- a/application/views/interface_assets/footer.php +++ b/application/views/interface_assets/footer.php @@ -85,7 +85,7 @@ function load_was_map() { -uri->segment(1) == "adif" || $this->uri->segment(1) == "qrz" || $this->uri->segment(1) == "hrdlog" ||$this->uri->segment(1) == "webadif") { ?> +uri->segment(1) == "adif" || $this->uri->segment(1) == "qrz" || $this->uri->segment(1) == "hrdlog" || $this->uri->segment(1) == "webadif" || $this->uri->segment(1) == "sattimers") { ?> diff --git a/application/views/sattimers/index.php b/application/views/sattimers/index.php index 633e843b..6cb1898e 100644 --- a/application/views/sattimers/index.php +++ b/application/views/sattimers/index.php @@ -1,8 +1,11 @@ +
This data is from https://www.df2et.de/tevel/
+This data is from https://www.df2et.de/tevel/ calculated for current station location grid .