diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php
index f44b579e..c4d5bdb4 100755
--- a/application/models/Logbook_model.php
+++ b/application/models/Logbook_model.php
@@ -4857,6 +4857,7 @@ class Logbook_model extends CI_Model
$plot = array('lat' => 0, 'lng' => 0, 'html' => '', 'label' => '', 'flag' => '', 'confirmed' => 'N');
$plot['label'] = $row->COL_CALL;
+ $plot['callsign'] = $row->COL_CALL;
$flag = strtolower($CI->dxccflag->getISO($row->COL_DXCC));
$plot['flag'] = 'name))) . '"> ';
$plot['html'] = ($row->COL_GRIDSQUARE != null ? "Grid: " . $row->COL_GRIDSQUARE . "
" : "");
diff --git a/application/models/Stats.php b/application/models/Stats.php
index 8fb9bf20..2cdbf1c7 100644
--- a/application/models/Stats.php
+++ b/application/models/Stats.php
@@ -88,10 +88,20 @@
}
}
+ // Initialize bandcalls array with all bands set to 0
+ foreach ($bands as $band) {
+ $bandcalls[$band] = 0;
+ }
+
foreach ($bandunique as $band) {
$bandcalls[$band->band] = $band->calls;
}
+ // Initialize modecalls array with all modes set to 0
+ foreach ($modes as $mode) {
+ $modecalls[$mode] = 0;
+ }
+
foreach ($modeunique as $mode) {
//if ($mode->col_submode == null) {
if ($mode->col_submode == null || $mode->col_submode == "") {
diff --git a/application/views/interface_assets/footer.php b/application/views/interface_assets/footer.php
index 87044478..c23b6011 100644
--- a/application/views/interface_assets/footer.php
+++ b/application/views/interface_assets/footer.php
@@ -784,6 +784,26 @@ if ($this->session->userdata('user_id') != null) {
});
// Form "submit" //
$('.custom-map-QSOs .btn_submit_map_custom').off('click').on('click', function() {
+ // Show loading spinner and disable button
+ const $button = $(this);
+ const $spinner = $('#load-spinner');
+
+ $button.prop('disabled', true);
+ $spinner.removeClass('d-none');
+
+ // Hide any previous alerts
+ $('.warningOnSubmit').hide();
+ $('#map-success-alert').addClass('d-none');
+
+ // Failsafe timeout to prevent stuck spinner (60 seconds)
+ const failsafeTimeout = setTimeout(function() {
+ console.warn('Map loading timed out - forcing spinner hide');
+ $button.prop('disabled', false);
+ $spinner.addClass('d-none');
+ $('.warningOnSubmit .warningOnSubmit_txt').text('Map loading timed out. Please try again.');
+ $('.warningOnSubmit').show();
+ }, 60000);
+
var customdata = {
'dataPost': {
'date_from': $('.custom-map-QSOs input[name="from"]').val(),
@@ -795,6 +815,58 @@ if ($this->session->userdata('user_id') != null) {
},
'map_id': '#custommap'
};
+
+ // Add success and error callbacks to the customdata
+ customdata.onSuccess = function(plotjson) {
+ console.log('Map loading success callback called with data:', plotjson);
+
+ // Clear the failsafe timeout
+ clearTimeout(failsafeTimeout);
+
+ try {
+ // Update statistics
+ if (typeof updateMapStatistics === 'function') {
+ console.log('Calling updateMapStatistics function');
+ updateMapStatistics(plotjson);
+ } else {
+ console.warn('updateMapStatistics function not found');
+ }
+
+ // Show success message
+ const qsoCount = plotjson['markers'] ? plotjson['markers'].length : 0;
+ console.log('QSO count:', qsoCount);
+ $('#qso-count-display').text(`Loaded ${qsoCount} QSOs successfully`);
+ $('#map-success-alert').removeClass('d-none');
+
+ setTimeout(() => {
+ $('#map-success-alert').addClass('d-none');
+ }, 3000);
+ } catch (error) {
+ console.error('Error in success callback:', error);
+ $('.warningOnSubmit .warningOnSubmit_txt').text('Map loaded but encountered an error displaying statistics.');
+ $('.warningOnSubmit').show();
+ } finally {
+ // Always re-enable button and hide spinner
+ console.log('Re-enabling button and hiding spinner');
+ $button.prop('disabled', false);
+ $spinner.addClass('d-none');
+ }
+ };
+
+ customdata.onError = function() {
+ console.log('Map loading error callback called');
+
+ // Clear the failsafe timeout
+ clearTimeout(failsafeTimeout);
+
+ $('.warningOnSubmit .warningOnSubmit_txt').text('Failed to load map data. Please try again.');
+ $('.warningOnSubmit').show();
+
+ // Re-enable button and hide spinner
+ $button.prop('disabled', false);
+ $spinner.addClass('d-none');
+ };
+
initplot(qso_loc, customdata);
})
});
@@ -806,6 +878,10 @@ if ($this->session->userdata('user_id') != null) {
success: function(data) {
document.getElementById('from').value = data;
document.getElementById('to').value = new Date().toISOString().split('T')[0];
+ // Update the date range display
+ if (typeof updateDateRangeDisplay === 'function') {
+ updateDateRangeDisplay();
+ }
},
error: function() {},
});
diff --git a/application/views/map/custom_date.php b/application/views/map/custom_date.php
index 58c982c7..65794ec2 100644
--- a/application/views/map/custom_date.php
+++ b/application/views/map/custom_date.php
@@ -1,107 +1,532 @@
+
+
+
+