diff --git a/application/controllers/Map.php b/application/controllers/Map.php index 7218938b..717648e3 100644 --- a/application/controllers/Map.php +++ b/application/controllers/Map.php @@ -79,23 +79,12 @@ class Map extends CI_Controller { $data['logbook_name'] = $logbook_name; $data['page_title'] = "Map QSOs"; - if ($this->input->post('from')) { - $from = $this->input->post('from'); - $footer_data['date_from'] = $from; - } else { - $footer_data['date_from'] = date('Y-m-d H:i:00'); - } - if ($this->input->post('to')) { - $to = $this->input->post('to'); - $footer_data['date_to'] = $to; - } else { - $temp_to = new DateTime('tomorrow'); - $footer_data['date_to'] = $temp_to->format('Y-m-d H:i:00'); - } + $data['date_from'] = date('Y-m-d'); + $data['date_to'] = date('Y-m-d', strtotime($data['date_from'].' +1days')); $this->load->view('interface_assets/header', $data); $this->load->view('map/custom_date'); - $this->load->view('interface_assets/footer',$footer_data); + $this->load->view('interface_assets/footer'); } // Generic fonction for return Json for MAP // diff --git a/application/views/interface_assets/footer.php b/application/views/interface_assets/footer.php index edeb3823..62078e78 100644 --- a/application/views/interface_assets/footer.php +++ b/application/views/interface_assets/footer.php @@ -749,10 +749,19 @@ function showActivatorsMap(call, count, grids) { var grid = "No"; - var customdata = {'dataPost':{'date_from':'', 'date_to':'', - 'band':'input->post('band'); ?>', 'mode':'input->post('mode'); ?>', - 'prop_mode':'input->post('prop_mode'); ?>', 'isCustom':true }} - initmap(grid, 'custommap', customdata); + initmap(grid, 'custommap', {'initmap_only':true}); + // Form "submit" // + $('.custom-map-QSOs .btn_submit_map_custom').off('click').on('click',function() { + if ($('.custom-map-QSOs input[name="from"]').val().replaceAll('-','') <= $('.custom-map-QSOs input[name="to"]').val().replaceAll('-','')) { + var customdata = {'dataPost':{'date_from': $('.custom-map-QSOs input[name="from"]').val(), 'date_to': $('.custom-map-QSOs input[name="to"]').val(), + 'band': $('.custom-map-QSOs select[name="band"]').val(), 'mode': $('.custom-map-QSOs select[name="mode"]').val(), + 'prop_mode': $('.custom-map-QSOs select[name="prop_mode"]').val(), 'isCustom':true }, 'map_id':'#custommap'}; + initplot(qso_loc, customdata); + } else { + // TODO + } + }) + }); diff --git a/application/views/map/custom_date.php b/application/views/map/custom_date.php index ead97d0f..a5556b3b 100644 --- a/application/views/map/custom_date.php +++ b/application/views/map/custom_date.php @@ -12,12 +12,12 @@