From d397e35d825208711800db94a241a95d716e2569 Mon Sep 17 00:00:00 2001 From: Andreas <6977712+AndreasK79@users.noreply.github.com> Date: Sat, 4 Sep 2021 09:30:51 +0200 Subject: [PATCH] [DX Atlas Gridsquare Export] Added a model for the export --- application/controllers/Dxatlas.php | 4 +-- application/models/Dxatlas_model.php | 49 ++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 application/models/Dxatlas_model.php diff --git a/application/controllers/Dxatlas.php b/application/controllers/Dxatlas.php index ac8c46ff..07c997df 100644 --- a/application/controllers/Dxatlas.php +++ b/application/controllers/Dxatlas.php @@ -30,7 +30,7 @@ class Dxatlas extends CI_Controller { $this->load->helper('file'); // Load Database connections - $this->load->model('logbook_model'); + $this->load->model('dxatlas_model'); // Parameters $band = $this->input->post('band'); @@ -42,7 +42,7 @@ class Dxatlas extends CI_Controller { $todate = $this->input->post('todate'); // Get QSOs with Valid QRAs - $qsos = $this->logbook_model->kml_get_all_qsos($band, $mode, $dxcc, $cqz, $propagation, $fromdate, $todate); + $qsos = $this->dxatlas_model->get_gridsquares($band, $mode, $dxcc, $cqz, $propagation, $fromdate, $todate); $output = ""; $output .= ""; diff --git a/application/models/Dxatlas_model.php b/application/models/Dxatlas_model.php new file mode 100644 index 00000000..8764ebbb --- /dev/null +++ b/application/models/Dxatlas_model.php @@ -0,0 +1,49 @@ + 0, + "80m" => 0, + "60m" => 0, + "40m" => 0, + "30m" => 0, + "20m" => 0, + "17m" => 0, + "15m" => 0, + "12m" => 0, + "10m" => 0, + "6m" => 0, + "4m" => 0, + "2m" => 0, + "70cm" => 0, + "23cm" => 0, + "13cm" => 0, + "9cm" => 0, + "6cm" => 0, + "3cm" => 0, + "1.25cm" => 0, + "SAT" => 0, + ); + + function __construct() + { + // Call the Model constructor + parent::__construct(); + } + + /* + * Fetches worked and confirmed gridsquare on each band and total + */ + function get_gridsquares($data) { + $gridArray = $this->fetchGrids($band, $mode, $dxcc, $cqz, $propagation, $fromdate, $todate); + + if (isset($gridArray)) { + return $gridArray; + } else { + return 0; + } + } + +} +?>