[DX Atlas Gridsquare Export] Added a model for the export

This commit is contained in:
Andreas 2021-09-04 09:30:51 +02:00
parent 2f0cf971c5
commit d397e35d82
2 changed files with 51 additions and 2 deletions

View File

@ -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 = "<?xml version=\"1.0\" encoding=\"utf-8\"?>";
$output .= "<kml xmlns=\"http://www.opengis.net/kml/2.2\">";

View File

@ -0,0 +1,49 @@
<?php
class Dxatlas_model extends CI_Model
{
public $bandslots = array("160m" => 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;
}
}
}
?>