on map custom, date to can't be big than date from

pull/2810/head
abarrau 2023-12-13 22:54:04 +01:00
rodzic f8dd94c520
commit 0143e79fa6
4 zmienionych plików z 18 dodań i 12 usunięć

Wyświetl plik

@ -79,8 +79,7 @@ class Map extends CI_Controller {
$data['logbook_name'] = $logbook_name;
$data['page_title'] = "Map QSOs";
$data['date_from'] = date('Y-m-d');
$data['date_to'] = date('Y-m-d', strtotime($data['date_from'].' +1days'));
$data['date_from'] = $data['date_to'] = date('Y-m-d');
$this->load->view('interface_assets/header', $data);
$this->load->view('map/custom_date');

Wyświetl plik

@ -2113,7 +2113,7 @@ function check_if_callsign_worked_in_logbook($callsign, $StationLocationsArray =
}
$this->db->join('dxcc_entities', $this->config->item('table_name').'.col_dxcc = dxcc_entities.adif', 'left');
$this->db->where("COL_TIME_ON BETWEEN '".$start."' AND '".$end."'");
$this->db->where("COL_TIME_ON BETWEEN '".$start." 00:00:00' AND '".$end." 23:59:59'");
$this->db->where_in("station_id", $logbooks_locations_array);
if($band != "All" && $band != "SAT") {

Wyświetl plik

@ -750,16 +750,23 @@ function showActivatorsMap(call, count, grids) {
var grid = "No";
<?php } ?>
initmap(grid, 'custommap', {'initmap_only':true});
// Check and change date if to < from //
$('.custom-map-QSOs input[name="to"]').off('change').on('change', function() {
if ($('.custom-map-QSOs input[name="to"]').val().replaceAll('-','') < $('.custom-map-QSOs input[name="from"]').val().replaceAll('-','')) {
$('.custom-map-QSOs input[name="from"]').val($('.custom-map-QSOs input[name="to"]').val());
}
});
$('.custom-map-QSOs input[name="from"]').off('change').on('change', function() {
if ($('.custom-map-QSOs input[name="from"]').val().replaceAll('-','') > $('.custom-map-QSOs input[name="to"]').val().replaceAll('-','')) {
$('.custom-map-QSOs input[name="to"]').val($('.custom-map-QSOs input[name="from"]').val());
}
});
// 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
}
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);
})

Wyświetl plik

@ -17,7 +17,7 @@
<div class="mb-3 col-md-3">
<label for="to"><?php echo lang('gen_to_date') . ": " ?></label>
<input name="to" id="to" type="date" class="form-control w-auto" value="<?php echo $date_to; ?>">
<input name="to" id="to" type="date" class="form-control w-auto" value="<?php echo $date_to; ?>" max="<?php echo $date_to; ?>">
</div>
</div>