[Map][Custom] Allows filtering custom map by band

This commit is contained in:
Peter Goodhall
2021-07-14 11:37:06 +01:00
parent ad7525aae8
commit 08623f4667
4 changed files with 71 additions and 10 deletions

View File

@@ -34,6 +34,26 @@ class Map extends CI_Controller {
function custom()
{
$this->load->model('dxcc');
$this->load->model('modes');
$data['worked_bands'] = $this->dxcc->get_worked_bands(); // Used in the view for band select
$data['modes'] = $this->modes->active(); // Used in the view for mode select
if ($this->input->post('band') != NULL) { // Band is not set when page first loads.
if ($this->input->post('band') == 'All') { // Did the user specify a band? If not, use all bands
$bands = $data['worked_bands'];
}
else {
$bands[] = $this->input->post('band');
}
}
else {
$bands = $data['worked_bands'];
}
$data['bands'] = $bands; // Used for displaying selected band(s) in the table in the view
// Calculate Lat/Lng from Locator to use on Maps
if($this->session->userdata('user_locator')) {
$this->load->library('qra');
@@ -83,11 +103,12 @@ class Map extends CI_Controller {
function map_data_custom() {
$start_date = $this->uri->segment(3);
$end_date = $this->uri->segment(4);
$band = $this->uri->segment(5);
$this->load->model('logbook_model');
$this->load->library('qra');
$qsos = $this->logbook_model->map_week_qsos(rawurldecode($start_date), rawurldecode($end_date));
$qsos = $this->logbook_model->map_custom_qsos(rawurldecode($start_date), rawurldecode($end_date), $band);
echo "{\"markers\": [";
$count = 1;