2023-10-25 10:02:06 +02:00
var $textarea = $ ( "textarea" ) ;
var qsodate = "" ;
var qsotime = "" ;
var band = "" ;
var mode = "" ;
var freq = "" ;
var callsign = "" ;
var errors = [ ] ;
var qsoList = [ ] ;
2025-11-05 16:41:52 +00:00
var satelliteData = { } ; // Will hold satellite frequency/mode data
2023-10-25 10:02:06 +02:00
2025-11-05 22:07:24 +00:00
// Function to update satellite feedback display
function updateSatelliteFeedback ( satName , satMode ) {
if ( satName && satelliteData [ satName ] ) {
// Show satellite feedback - satellite found
$ ( "#sat-name-display" ) . text ( satName ) ;
// Get available modes
var modes = Object . keys ( satelliteData [ satName ] . Modes ) ;
var modesHtml = '<small>Available modes: ' ;
modes . forEach ( function ( mode , index ) {
if ( mode === satMode ) {
// Highlight the selected mode with checkmark
modesHtml += '<span class="badge bg-success me-1"><i class="fas fa-check"></i> ' + mode + '</span> ' ;
} else {
// Show other available modes as clickable suggestions
modesHtml += '<span class="badge bg-secondary me-1" style="opacity: 0.7;">' + mode + '</span> ' ;
}
} ) ;
modesHtml += '</small>' ;
$ ( "#sat-modes-display" ) . html ( modesHtml ) ;
// Make sure it's styled as success
$ ( "#satellite-feedback .alert" ) . removeClass ( "alert-warning" ) . addClass ( "alert-success" ) ;
$ ( "#satellite-feedback .alert" ) . css ( "border-left-color" , "#28a745" ) ;
$ ( "#satellite-feedback" ) . slideDown ( 300 ) ;
} else if ( satName && ! satelliteData [ satName ] ) {
// Satellite name entered but not found in database
$ ( "#sat-name-display" ) . text ( satName ) ;
$ ( "#sat-modes-display" ) . html ( '<small><i class="fas fa-exclamation-triangle"></i> Satellite not found in database. Frequencies will not be auto-populated.</small>' ) ;
// Style as warning
$ ( "#satellite-feedback .alert" ) . removeClass ( "alert-success" ) . addClass ( "alert-warning" ) ;
$ ( "#satellite-feedback .alert" ) . css ( "border-left-color" , "#ffc107" ) ;
$ ( "#satellite-feedback" ) . slideDown ( 300 ) ;
} else {
// No satellite mode, hide feedback
$ ( "#satellite-feedback" ) . slideUp ( 300 ) ;
}
}
// Function to clear satellite feedback
function clearSatelliteFeedback ( ) {
$ ( "#satellite-feedback" ) . slideUp ( 300 ) ;
// Reset to success styling
$ ( "#satellite-feedback .alert" ) . removeClass ( "alert-warning" ) . addClass ( "alert-success" ) ;
$ ( "#satellite-feedback .alert" ) . css ( "border-left-color" , "#28a745" ) ;
}
2023-11-11 01:31:07 -05:00
$ ( "#simpleFleInfoButton" ) . click ( function ( event ) {
var awardInfoLines = [
lang _qso _simplefle _info _ln2 ,
lang _qso _simplefle _info _ln3 ,
lang _qso _simplefle _info _ln4 ,
] ;
var simpleFleInfo = "" ;
awardInfoLines . forEach ( function ( line ) {
simpleFleInfo += line + "<br><br>" ;
} ) ;
BootstrapDialog . alert ( {
title : "<h4>" + lang _qso _simplefle _info _ln1 + "</h4>" ,
message : simpleFleInfo ,
} ) ;
2023-10-25 10:02:06 +02:00
} ) ;
2023-11-11 01:31:07 -05:00
$ ( "#js-syntax" ) . click ( function ( event ) {
$ ( "#js-syntax" ) . prop ( "disabled" , false ) ;
$ . ajax ( {
2023-11-01 21:43:06 +01:00
url : base _url + "index.php/simplefle/displaySyntax" ,
type : "post" ,
success : function ( html ) {
BootstrapDialog . show ( {
title : "<h4>" + lang _qso _simplefle _syntax _help _title + "</h4>" ,
2023-11-01 21:08:21 +01:00
type : BootstrapDialog . TYPE _INFO ,
size : BootstrapDialog . SIZE _WIDE ,
2023-11-01 21:43:06 +01:00
nl2br : false ,
message : html ,
buttons : [
{
label : lang _qso _simplefle _syntax _help _close _w _sample ,
action : function ( ) {
BootstrapDialog . confirm ( {
title : lang _general _word _warning ,
message : lang _qso _simplefle _warning _reset ,
type : BootstrapDialog . TYPE _DANGER ,
btnCancelLabel : lang _general _word _cancel ,
btnOKLabel : lang _general _word _ok ,
btnOKClass : "btn-warning" ,
callback : function ( result ) {
if ( result ) {
clearSession ( ) ;
const logData = `
2023-11-02 08:22:01 +01:00
* example - data *
2023-11-06 13:41:34 +01:00
date 2023 - 05 - 14
2023-11-01 21:43:06 +01:00
80 m cw
1212 m0abc okff - 1234
3 hb9hil
4 ok1tn
20 dl6kva 7 8
2023-11-06 13:41:34 +01:00
5 dl5cw
day ++
2023-11-01 21:43:06 +01:00
ssb
32 ok7wa ol / zl - 071 5 8
33 ok1xxx 4 3
2025-11-05 16:41:52 +00:00
sat
ao - 7 V / U
1400 dl1sat 59 59
1405 g3xyz 57 58
2023-11-01 21:43:06 +01:00
` ;
$textarea . val ( logData . trim ( ) ) ;
handleInput ( ) ;
2023-11-02 08:22:01 +01:00
BootstrapDialog . closeAll ( ) ;
2023-11-01 21:43:06 +01:00
}
} ,
} ) ;
} ,
} ,
{
label : lang _admin _close ,
cssClass : "btn-primary" ,
action : function ( dialogItself ) {
dialogItself . close ( ) ;
} ,
} ,
] ,
} ) ;
} ,
} ) ;
2023-10-25 10:58:34 +02:00
} ) ;
2023-11-04 12:45:07 +01:00
function updateUTCTime ( ) {
const utcTimeElement = document . getElementById ( "utc-time" ) ;
const now = new Date ( ) ;
const utcTimeString = now . toISOString ( ) . split ( "T" ) [ 1 ] . split ( "." ) [ 0 ] ;
utcTimeElement . textContent = utcTimeString ;
}
2023-10-25 10:02:06 +02:00
function handleInput ( ) {
2025-11-05 16:41:52 +00:00
console . log ( "=== handleInput called ===" ) ;
2023-10-25 10:02:06 +02:00
var qsodate = "" ;
if ( $ ( "#qsodate" ) . val ( ) ) {
qsodate = new Date ( $ ( "#qsodate" ) . val ( ) ) . toISOString ( ) . split ( "T" ) [ 0 ] ;
} else {
qsodate = new Date ( ) . toISOString ( ) . split ( "T" ) [ 0 ] ;
}
var operator = $ ( "#operator" ) . val ( ) ;
operator = operator . toUpperCase ( ) ;
2023-10-25 15:14:53 +02:00
var ownCallsign = $ ( "#station-call" ) . val ( ) . toUpperCase ( ) ;
2023-10-25 10:02:06 +02:00
ownCallsign = ownCallsign . toUpperCase ( ) ;
var extraQsoDate = qsodate ;
var band = "" ;
2023-12-23 06:15:24 +01:00
var prevMode = "" ;
2023-10-25 10:02:06 +02:00
var mode = "" ;
var freq = "" ;
2025-11-05 16:41:52 +00:00
var freq _rx = "" ;
var band _rx = "" ;
2023-10-25 10:02:06 +02:00
var callsign = "" ;
2023-11-02 08:44:47 +01:00
var sotaWwff = "" ;
2025-11-05 16:41:52 +00:00
var sat _name = "" ;
var sat _mode = "" ;
var prop _mode = "" ;
var gridsquare = "" ;
2026-01-14 10:23:15 +00:00
var comment = "" ;
2026-04-27 22:41:40 +01:00
var qsotime = "" ;
2023-10-25 10:02:06 +02:00
qsoList = [ ] ;
$ ( "#qsoTable tbody" ) . empty ( ) ;
var text = $textarea . val ( ) . trim ( ) ;
2026-04-27 22:41:40 +01:00
var lines = text . split ( "\n" ) ;
2023-10-25 10:02:06 +02:00
lines . forEach ( ( row ) => {
var rst _s = null ;
var rst _r = null ;
2026-01-14 10:23:15 +00:00
2026-01-14 22:44:43 +00:00
// Reset comment at the beginning of each line iteration
comment = "" ;
2026-01-14 10:23:15 +00:00
// Extract comment from angle brackets < >
var commentMatch = row . match ( /<([^>]+)>/ ) ;
if ( commentMatch ) {
comment = commentMatch [ 1 ] . trim ( ) ;
// Remove the comment from the row before processing
row = row . replace ( /<[^>]+>/ , '' ) . trim ( ) ;
}
2026-04-27 22:41:40 +01:00
var items = row . startsWith ( "day " ) ? [ row ] : row . split ( " " ) ;
2023-10-25 10:02:06 +02:00
var itemNumber = 0 ;
2023-12-23 06:15:24 +01:00
2023-10-25 10:02:06 +02:00
items . forEach ( ( item ) => {
if ( item === "" ) {
return ;
}
2023-10-31 17:05:53 +01:00
if ( item . trim ( ) . match ( /^day (\+)+$/ ) ) {
var plusCount = item . match ( /\+/g ) . length ;
2023-11-09 00:54:26 +01:00
var originalDate = new Date ( extraQsoDate ) ;
2023-10-31 17:05:53 +01:00
originalDate . setDate ( originalDate . getDate ( ) + plusCount ) ;
extraQsoDate = originalDate . toISOString ( ) . split ( "T" ) [ 0 ] ;
2023-10-25 10:02:06 +02:00
} else if (
2023-11-11 01:31:07 -05:00
item . match ( /^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$/ )
2023-10-25 10:02:06 +02:00
) {
2023-11-11 01:31:07 -05:00
extraQsoDate = item ;
2026-04-27 22:41:40 +01:00
} else if ( item . match ( /^([01][0-9]|2[0-3])[0-5][0-9]$/ ) ) {
2023-10-25 10:02:06 +02:00
qsotime = item ;
2023-11-11 01:31:07 -05:00
} else if (
item . match ( /^CW$|^SSB$|^LSB$|^USB$|^FM$|^AM$|^PSK$|^FT8$/i )
) {
2023-12-23 06:15:24 +01:00
if ( mode != "" ) {
freq = 0 ;
console . log ( "QRG is 0 now" ) ;
}
2023-10-25 10:02:06 +02:00
mode = item . toUpperCase ( ) ;
} else if (
2025-11-05 16:41:52 +00:00
item . match ( /^[0-9]{1,4}(?:m|cm|mm)$/ )
2023-10-25 10:02:06 +02:00
) {
2023-10-27 15:57:17 +02:00
band = item ;
2023-10-25 10:02:06 +02:00
freq = 0 ;
2026-04-27 22:41:40 +01:00
// Clear satellite state when switching to a regular band
sat _name = "" ;
sat _mode = "" ;
prop _mode = "" ;
2025-11-05 22:07:24 +00:00
clearSatelliteFeedback ( ) ;
2025-11-05 16:41:52 +00:00
} else if (
item . match ( /^satellite$/i ) ||
item . match ( /^sat$/i )
) {
2026-04-29 09:27:05 +02:00
// Set prop_mode to SAT
2025-11-05 16:41:52 +00:00
console . log ( "SAT keyword detected" ) ;
prop _mode = "SAT" ;
freq = 0 ;
2023-10-25 10:02:06 +02:00
} else if ( item . match ( /^\d+\.\d+$/ ) ) {
freq = item ;
2023-12-23 06:15:24 +01:00
band = getBandFromFreq ( freq ) ;
2023-10-25 10:02:06 +02:00
} else if (
item . match ( /^[1-9]{1}$/ ) &&
qsotime &&
itemNumber === 0
) {
qsotime = qsotime . replace ( /.$/ , item ) ;
} else if (
item . match ( /^[0-5][0-9]{1}$/ ) &&
qsotime &&
itemNumber === 0
) {
qsotime = qsotime . slice ( 0 , - 2 ) + item ;
} else if (
item . match (
2023-12-23 06:15:24 +01:00
/^[A-Z0-9]{1,3}\/[A-Z]{2}-\d{3}|[AENOS]*[FNSUACA]-\d{3}|(?!.*FF)[A-Z0-9]{1,3}-\d{4,5}|[A-Z0-9]{1,3}[F]{2}-\d{4}$/i
2023-10-25 10:02:06 +02:00
)
) {
2025-11-05 16:41:52 +00:00
sotaWwff = item . toUpperCase ( ) ;
} else if (
2026-04-29 09:27:05 +02:00
prop _mode === "SAT" &&
2025-11-05 16:41:52 +00:00
item . match ( /^[A-Z0-9]+-\d+[A-Z]*$/i )
) {
// Satellite name (e.g., AO-7, ISS, FO-29)
sat _name = item . toUpperCase ( ) ;
console . log ( "Satellite name detected:" , sat _name , "band is:" , band ) ;
2025-11-05 22:07:24 +00:00
// Update visual feedback
updateSatelliteFeedback ( sat _name , null ) ;
2025-11-05 16:41:52 +00:00
// Try to auto-populate frequency and mode if we have satellite data
if ( satelliteData [ sat _name ] ) {
// We'll need the sat_mode first, so just store the name for now
console . log ( "Satellite found in database" ) ;
} else {
console . log ( "Satellite NOT found in database. Available:" , Object . keys ( satelliteData ) . length , "satellites" ) ;
}
} else if (
2026-04-29 09:27:05 +02:00
prop _mode === "SAT" &&
2025-11-05 16:41:52 +00:00
item . match ( /^(ISS|ARISS)$/i )
) {
// Handle satellites without numbers (ISS, ARISS)
sat _name = item . toUpperCase ( ) ;
console . log ( "Special satellite name detected:" , sat _name ) ;
2025-11-05 22:07:24 +00:00
// Update visual feedback
updateSatelliteFeedback ( sat _name , null ) ;
2025-11-05 16:41:52 +00:00
} else if (
2026-04-29 09:27:05 +02:00
prop _mode === "SAT" &&
2025-11-05 16:41:52 +00:00
sat _name &&
2026-04-27 22:41:40 +01:00
item . match ( /^[UVLSCX](\/[UVLSCX])?$/i )
2025-11-05 16:41:52 +00:00
) {
2026-04-27 22:41:40 +01:00
// Satellite mode (e.g., V/U, U/V, L/S, S/X for QO-100)
2025-11-05 16:41:52 +00:00
sat _mode = item . toUpperCase ( ) ;
2025-11-05 22:07:24 +00:00
// Update visual feedback with selected mode
updateSatelliteFeedback ( sat _name , sat _mode ) ;
2025-11-05 16:41:52 +00:00
// Now populate frequencies from satellite_data.json
2026-04-29 09:27:05 +02:00
console . log ( "Looking up satellite:" , sat _name , "mode:" , sat _mode ) ;
2025-11-05 16:41:52 +00:00
if ( satelliteData [ sat _name ] && satelliteData [ sat _name ] . Modes && satelliteData [ sat _name ] . Modes [ sat _mode ] ) {
var modeData = satelliteData [ sat _name ] . Modes [ sat _mode ] [ 0 ] ;
freq = modeData . Uplink _Freq / 1000000 ;
2026-04-29 09:27:05 +02:00
band = getBandFromFreq ( freq ) ;
2025-11-05 16:41:52 +00:00
freq _rx = modeData . Downlink _Freq / 1000000 ;
band _rx = getBandFromFreq ( freq _rx ) ;
// Set mode based on uplink/downlink
if ( ( modeData . Downlink _Mode === "LSB" && modeData . Uplink _Mode === "USB" ) ||
( modeData . Downlink _Mode === "USB" && modeData . Uplink _Mode === "LSB" ) ) {
mode = "SSB" ; // Inverting transponder
} else {
mode = modeData . Uplink _Mode ;
}
2026-04-29 09:27:05 +02:00
console . log ( "Satellite data found. Freq:" , freq , "Mode:" , mode , "Band:" , band , "Band RX:" , band _rx ) ;
2025-11-05 16:41:52 +00:00
} else {
// Satellite mode not found in database, but still valid
// User will need to manually set mode if not in database
console . log ( "Satellite mode " + sat _mode + " not found for " + sat _name ) ;
console . log ( "Available satellites:" , Object . keys ( satelliteData ) . join ( ", " ) ) ;
}
2026-04-27 22:41:40 +01:00
} else if (
item . match ( /^[A-R]{2}[0-9]{2}([a-x]{2})?(,[A-R]{2}[0-9]{2}([a-x]{2})?)*$/i )
) {
// Gridsquare (e.g., IO91, IO91AB, IO91,IO92 for corner locations)
// Format: 2 letters + 2 digits + optionally 2 subsquare letters, comma-separated if multiple
// Check gridsquare BEFORE callsign since gridsquare pattern can match some callsigns
gridsquare = item . toUpperCase ( ) ;
2025-11-05 16:41:52 +00:00
} else if (
2023-10-25 10:02:06 +02:00
item . match (
2023-12-23 06:15:24 +01:00
/([a-zA-Z0-9]{1,3}[0-9][a-zA-Z0-9]{0,3}[a-zA-Z])|.*\/([a-zA-Z0-9]{1,3}[0-9][a-zA-Z0-9]{0,3}[a-zA-Z])|([a-zA-Z0-9]{1,3}[0-9][a-zA-Z0-9]{0,3}[a-zA-Z])\/.*/
2023-10-25 10:02:06 +02:00
)
) {
callsign = item . toUpperCase ( ) ;
2025-05-28 17:08:54 +01:00
} else if ( itemNumber > 0 && ( item . match ( /^\d{1,3}$/ ) || item . match ( /^[+-]\d{1,2}$/ ) ) ) {
2023-10-25 10:02:06 +02:00
if ( rst _s === null ) {
rst _s = item ;
} else {
rst _r = item ;
}
}
itemNumber = itemNumber + 1 ;
} ) ;
errors = [ ] ;
checkMainFieldsErrors ( ) ;
if ( callsign ) {
2025-11-05 16:41:52 +00:00
console . log ( "Processing QSO for callsign:" , callsign , "Band:" , band , "Mode:" , mode , "Freq:" , freq , "Sat:" , sat _name , sat _mode ) ;
// For satellite QSOs, freq should already be set from satellite mode lookup
// For regular QSOs, calculate freq if not provided
2026-04-29 09:27:05 +02:00
if ( prop _mode === "SAT" ) {
2025-11-05 16:41:52 +00:00
// Satellite QSO - freq and mode should be set from satellite mode lookup
// If not set (satellite not in database), freq will be 0 or empty
if ( ! freq || freq === 0 || freq === "" ) {
// Satellite not found in database or mode not recognized
// We still have band=SAT but no freq - this is okay for sat QSOs
freq = 0 ;
}
} else {
// Regular QSO
if ( freq === 0 || freq === "" ) {
freq = getFreqFromBand ( band , mode ) ;
} else if ( band === "" ) {
band = getBandFromFreq ( freq ) ;
}
2023-10-25 10:02:06 +02:00
}
if ( band === "" ) {
2023-10-30 23:52:20 +01:00
addErrorMessage ( lang _qso _simplefle _error _band ) ;
2023-10-25 10:02:06 +02:00
}
if ( mode === "" ) {
2023-10-30 23:52:20 +01:00
addErrorMessage ( lang _qso _simplefle _error _mode ) ;
2023-10-25 10:02:06 +02:00
}
if ( qsotime === "" ) {
2023-10-30 23:52:20 +01:00
addErrorMessage ( lang _qso _simplefle _error _time ) ;
2023-10-25 10:02:06 +02:00
}
if ( isValidDate ( extraQsoDate ) === false ) {
2023-11-11 01:31:07 -05:00
addErrorMessage (
2023-12-23 06:15:24 +01:00
lang _qso _simplefle _error _date + " " + extraQsoDate
2023-11-11 01:31:07 -05:00
) ;
2023-10-25 10:02:06 +02:00
extraQsoDate = qsodate ;
}
rst _s = getReportByMode ( rst _s , mode ) ;
rst _r = getReportByMode ( rst _r , mode ) ;
qsoList . push ( [
extraQsoDate ,
qsotime ,
callsign ,
freq ,
band ,
mode ,
rst _s ,
rst _r ,
2023-11-02 08:44:47 +01:00
sotaWwff ,
2025-11-05 16:41:52 +00:00
sat _name ,
sat _mode ,
prop _mode ,
freq _rx ,
band _rx ,
gridsquare ,
2026-01-14 10:23:15 +00:00
comment ,
2023-10-25 10:02:06 +02:00
] ) ;
2023-11-02 15:07:57 +01:00
let sotaWwffText = "" ;
if ( isSOTA ( sotaWwff ) ) {
sotaWwffText = ` S: ${ sotaWwff } ` ;
} else if ( isPOTA ( sotaWwff ) ) {
sotaWwffText = ` P: ${ sotaWwff } ` ;
} else if ( isIOTA ( sotaWwff ) ) {
sotaWwffText = ` I: ${ sotaWwff } ` ;
} else if ( isWWFF ( sotaWwff ) ) {
sotaWwffText = ` W: ${ sotaWwff } ` ;
}
2025-11-05 16:41:52 +00:00
// Display satellite info
let satText = "" ;
if ( sat _name ) {
satText = sat _name ;
if ( sat _mode ) {
satText += " " + sat _mode ;
}
}
2023-10-25 10:02:06 +02:00
const tableRow = $ ( ` <tr>
2025-11-05 22:27:30 +00:00
< td style = "padding: 0.5rem; width: 110px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;" > $ { extraQsoDate } < / t d >
< td style = "padding: 0.5rem; width: 70px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;" > $ { qsotime } < / t d >
< td style = "padding: 0.5rem; width: 90px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;" > $ { callsign } < / t d >
< td style = "padding: 0.5rem; width: 140px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;" > < span data - bs - toggle = "tooltip" data - placement = "left" title = "${freq}" > $ { band } $ { satText ? ' ' + satText : '' } < / s p a n > < / t d >
< td style = "padding: 0.5rem; width: 70px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;" > $ { mode } < / t d >
< td style = "padding: 0.5rem; width: 70px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;" > $ { rst _s } < / t d >
< td style = "padding: 0.5rem; width: 70px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;" > $ { rst _r } < / t d >
< td style = "padding: 0.5rem; width: 90px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;" > $ { operator } < / t d >
< td style = "padding: 0.5rem; width: 110px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;" > $ { sotaWwffText } < / t d >
2026-04-27 22:41:40 +01:00
< td style = "padding: 0.5rem; width: 80px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;" > $ { gridsquare } < / t d >
2026-01-14 10:23:15 +00:00
< td style = "padding: 0.5rem; width: 150px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;" title = "${comment}" > $ { comment } < / t d >
2023-11-02 15:07:57 +01:00
< / t r > ` ) ;
2023-10-25 10:02:06 +02:00
$ ( "#qsoTable > tbody:last-child" ) . append ( tableRow ) ;
2023-11-11 01:31:07 -05:00
localStorage . setItem (
` user_ ${ user _id } _tabledata ` ,
2023-12-23 06:15:24 +01:00
$ ( "#qsoTable" ) . html ( )
2023-11-11 01:31:07 -05:00
) ;
localStorage . setItem (
` user_ ${ user _id } _my-call ` ,
2023-12-23 06:15:24 +01:00
$ ( "#station-call" ) . val ( )
2023-11-11 01:31:07 -05:00
) ;
localStorage . setItem (
` user_ ${ user _id } _operator ` ,
2023-12-23 06:15:24 +01:00
$ ( "#operator" ) . val ( )
2023-11-11 01:31:07 -05:00
) ;
localStorage . setItem (
` user_ ${ user _id } _my-sota-wwff ` ,
2023-12-23 06:15:24 +01:00
$ ( "#my-sota-wwff" ) . val ( )
2023-11-11 01:31:07 -05:00
) ;
localStorage . setItem (
` user_ ${ user _id } _qso-area ` ,
2023-12-23 06:15:24 +01:00
$ ( ".qso-area" ) . val ( )
2023-11-11 01:31:07 -05:00
) ;
localStorage . setItem (
` user_ ${ user _id } _qsodate ` ,
2023-12-23 06:15:24 +01:00
$ ( "#qsodate" ) . val ( )
2023-11-11 01:31:07 -05:00
) ;
localStorage . setItem (
` user_ ${ user _id } _my-power ` ,
2023-12-23 06:15:24 +01:00
$ ( "#my-power" ) . val ( )
2023-11-11 01:31:07 -05:00
) ;
localStorage . setItem (
` user_ ${ user _id } _my-grid ` ,
2023-12-23 06:15:24 +01:00
$ ( "#my-grid" ) . val ( )
2023-11-11 01:31:07 -05:00
) ;
2023-10-25 10:02:06 +02:00
callsign = "" ;
2023-11-02 08:44:47 +01:00
sotaWwff = "" ;
2025-11-05 16:41:52 +00:00
gridsquare = "" ;
// Don't reset satellite info - it persists for multiple QSOs
2023-10-25 10:02:06 +02:00
}
2023-12-23 06:15:24 +01:00
prevMode = mode ;
2023-10-25 10:02:06 +02:00
showErrors ( ) ;
} ) ; //lines.forEach((row)
// Scroll to the bototm of #qsoTableBody (scroll by the value of its scrollheight property)
$ ( "#qsoTableBody" ) . scrollTop ( $ ( "#qsoTableBody" ) . get ( 0 ) . scrollHeight ) ;
var qsoCount = qsoList . length ;
if ( qsoCount ) {
2023-11-11 01:31:07 -05:00
$ ( ".js-qso-count" ) . html (
"<strong>" +
lang _qso _simplefle _qso _list _total +
":</strong> " +
qsoCount +
" " +
2023-12-23 06:15:24 +01:00
lang _gen _hamradio _qso
2023-11-11 01:31:07 -05:00
) ;
2023-10-25 10:02:06 +02:00
} else {
$ ( ".js-qso-count" ) . html ( "" ) ;
}
if ( errors ) {
$ ( ".js-status" ) . html ( errors . join ( "<br>" ) ) ;
}
}
function checkMainFieldsErrors ( ) {
2023-11-11 01:31:07 -05:00
if ( $ ( "#station-call" ) . val ( ) === "-" ) {
$ ( "#warningStationCall" ) . show ( ) ;
$ ( "#station-call" ) . css ( "border" , "2px solid rgb(217, 83, 79)" ) ;
$ ( "#warningStationCall" ) . text ( lang _qso _simplefle _error _stationcall ) ;
2023-10-26 22:50:55 +02:00
} else {
2023-11-11 01:31:07 -05:00
$ ( "#station-call" ) . css ( "border" , "" ) ;
$ ( "#warningStationCall" ) . hide ( ) ;
}
2023-10-25 10:02:06 +02:00
if ( $ ( "#operator" ) . val ( ) === "" ) {
2023-11-11 01:31:07 -05:00
$ ( "#warningOperatorField" ) . show ( ) ;
$ ( "#operator" ) . css ( "border" , "2px solid rgb(217, 83, 79)" ) ;
$ ( "#warningOperatorField" ) . text ( lang _qso _simplefle _error _operator ) ;
} else {
$ ( "#operator" ) . css ( "border" , "" ) ;
$ ( "#warningOperatorField" ) . hide ( ) ;
}
2023-10-26 22:50:55 +02:00
if ( $ ( "textarea" ) . val ( ) === "" ) {
2023-11-11 01:31:07 -05:00
$ ( "#textarea" ) . css ( "border" , "2px solid rgb(217, 83, 79)" ) ;
setTimeout ( function ( ) {
$ ( "#textarea" ) . css ( "border" , "" ) ;
} , 2000 ) ;
} else {
$ ( "#textarea" ) . css ( "border" , "" ) ;
}
2023-10-25 10:02:06 +02:00
}
$textarea . keydown ( function ( event ) {
if ( event . which == 13 ) {
handleInput ( ) ;
}
} ) ;
2025-11-05 22:07:24 +00:00
// Also trigger handleInput on space or when typing satellite-related keywords
// This provides real-time feedback for satellite detection
$textarea . on ( 'input' , function ( ) {
var text = $ ( this ) . val ( ) . trim ( ) ;
var lines = text . split ( "\n" ) ;
var lastLine = lines [ lines . length - 1 ] ;
// Check if the last line or recent lines contain satellite keywords
// Trigger feedback update if we detect satellite patterns
if ( text . match ( /\bsat\b/i ) || text . match ( /\bsatellite\b/i ) ||
text . match ( /[A-Z0-9]+-\d+/i ) || text . match ( /\b(ISS|ARISS)\b/i ) ) {
// Debounce the update to avoid too many calls while typing
clearTimeout ( this . updateTimeout ) ;
this . updateTimeout = setTimeout ( function ( ) {
handleInput ( ) ;
} , 300 ) ; // Wait 300ms after typing stops
}
} ) ;
2023-10-25 10:02:06 +02:00
$textarea . focus ( function ( ) {
errors = [ ] ;
checkMainFieldsErrors ( ) ;
showErrors ( ) ;
} ) ;
function addErrorMessage ( errorMessage ) {
errorMessage = '<span class="text-danger">' + errorMessage + "</span>" ;
if ( errors . includes ( errorMessage ) == false ) {
errors . push ( errorMessage ) ;
}
}
function isValidDate ( d ) {
return new Date ( d ) !== "Invalid Date" && ! isNaN ( new Date ( d ) ) ;
}
$ ( ".js-reload-qso" ) . click ( function ( ) {
handleInput ( ) ;
} ) ;
$ ( ".js-empty-qso" ) . click ( function ( ) {
2023-10-26 22:50:55 +02:00
BootstrapDialog . confirm ( {
2023-10-30 23:52:20 +01:00
title : lang _general _word _warning ,
message : lang _qso _simplefle _warning _reset ,
2023-10-26 22:50:55 +02:00
type : BootstrapDialog . TYPE _DANGER ,
2023-10-30 23:52:20 +01:00
btnCancelLabel : lang _general _word _cancel ,
btnOKLabel : lang _general _word _ok ,
2023-10-26 22:50:55 +02:00
btnOKClass : "btn-warning" ,
callback : function ( result ) {
if ( result ) {
clearSession ( ) ;
}
} ,
} ) ;
2023-10-25 10:02:06 +02:00
} ) ;
2023-10-26 22:50:55 +02:00
function clearSession ( ) {
2023-10-27 21:45:15 +02:00
localStorage . removeItem ( ` user_ ${ user _id } _tabledata ` ) ;
localStorage . removeItem ( ` user_ ${ user _id } _my-call ` ) ;
localStorage . removeItem ( ` user_ ${ user _id } _operator ` ) ;
localStorage . removeItem ( ` user_ ${ user _id } _my-sota-wwff ` ) ;
localStorage . removeItem ( ` user_ ${ user _id } _qso-area ` ) ;
localStorage . removeItem ( ` user_ ${ user _id } _qsodate ` ) ;
localStorage . removeItem ( ` user_ ${ user _id } _my-grid ` ) ;
2023-10-26 22:50:55 +02:00
$ ( "#qsodate" ) . val ( "" ) ;
$ ( "#qsoTable tbody" ) . empty ( ) ;
$ ( "#my-sota-wwff" ) . val ( "" ) ;
// $("#station-call").val(""); Do not clear that?
// $("#operator").val(""); Do not clear that?
$ ( ".qso-area" ) . val ( "" ) ;
$ ( "#my-grid" ) . val ( "" ) ;
qsoList = [ ] ;
$ ( ".js-qso-count" ) . html ( "" ) ;
2025-11-05 22:07:24 +00:00
clearSatelliteFeedback ( ) ;
2023-10-26 22:50:55 +02:00
}
2023-10-25 10:02:06 +02:00
function showErrors ( ) {
if ( errors ) {
$ ( ".js-status" ) . html ( errors . join ( "<br>" ) ) ;
}
}
$ ( ".js-download-qso" ) . click ( function ( ) {
handleInput ( ) ;
} ) ;
function getBandFromFreq ( freq ) {
if ( freq > 1.7 && freq < 2 ) {
2023-10-27 15:57:17 +02:00
return "160m" ;
2023-10-25 10:02:06 +02:00
} else if ( freq > 3.4 && freq < 4 ) {
2023-10-27 15:57:17 +02:00
return "80m" ;
2023-10-25 10:02:06 +02:00
} else if ( freq > 6.9 && freq < 7.3 ) {
2023-10-27 15:57:17 +02:00
return "40m" ;
2023-10-25 10:02:06 +02:00
} else if ( freq > 5 && freq < 6 ) {
2023-10-27 15:57:17 +02:00
return "60m" ;
2023-10-25 10:02:06 +02:00
} else if ( freq > 10 && freq < 11 ) {
2023-10-27 15:57:17 +02:00
return "30m" ;
2023-10-25 10:02:06 +02:00
} else if ( freq > 13 && freq < 15 ) {
2023-10-27 15:57:17 +02:00
return "20m" ;
2023-10-25 10:02:06 +02:00
} else if ( freq > 18 && freq < 19 ) {
2023-10-27 15:57:17 +02:00
return "17m" ;
2023-10-25 10:02:06 +02:00
} else if ( freq > 20 && freq < 22 ) {
2023-10-27 15:57:17 +02:00
return "15m" ;
2023-10-25 10:02:06 +02:00
} else if ( freq > 24 && freq < 25 ) {
2023-10-27 15:57:17 +02:00
return "12m" ;
2023-10-25 10:02:06 +02:00
} else if ( freq > 27 && freq < 30 ) {
2023-10-27 15:57:17 +02:00
return "10m" ;
2023-10-25 10:02:06 +02:00
} else if ( freq > 50 && freq < 55 ) {
2023-10-27 15:57:17 +02:00
return "6m" ;
2023-10-25 10:02:06 +02:00
} else if ( freq > 144 && freq < 149 ) {
2023-10-27 15:57:17 +02:00
return "2m" ;
2023-10-25 10:02:06 +02:00
} else if ( freq > 430 && freq < 460 ) {
2023-10-27 15:57:17 +02:00
return "70cm" ;
2026-04-29 08:20:06 +02:00
} else if ( freq > 1240 && freq < 1300 ) {
return "23cm" ;
} else if ( freq > 2300 && freq < 2450 ) {
return "13cm" ;
} else if ( freq > 3300 && freq < 3500 ) {
return "9cm" ;
} else if ( freq > 5650 && freq < 5925 ) {
return "6cm" ;
} else if ( freq > 10000 && freq < 10500 ) {
return "3cm" ;
2023-10-25 10:02:06 +02:00
}
return "" ;
}
function getFreqFromBand ( band , mode ) {
2023-11-09 21:49:17 +01:00
var settingsMode = getSettingsMode ( mode . toUpperCase ( ) ) ;
var settingsBand = "b" + band . toUpperCase ( ) ;
var bandData = Bands [ settingsBand ] ;
if ( bandData ) {
2023-11-11 01:31:07 -05:00
return bandData [ settingsMode ] / 1000000 ;
}
2023-10-25 10:02:06 +02:00
}
function getSettingsMode ( mode ) {
2023-11-11 01:31:07 -05:00
if (
mode === "AM" ||
mode === "FM" ||
mode === "SSB" ||
mode === "LSB" ||
mode === "USB"
) {
2023-10-25 10:02:06 +02:00
return "SSB" ;
}
if ( mode === "CW" ) {
return "CW" ;
}
return "DIGI" ;
}
var htmlSettings = "" ;
for ( const [ key , value ] of Object . entries ( Bands ) ) {
htmlSettings = `
$ { htmlSettings }
< div class = "row" >
< div class = "col-3 mt-4" >
< strong > $ { key . slice ( 1 ) } < / s t r o n g >
< / d i v >
< div class = "col-3" >
< div class = "form-group" >
< label for = "${key.slice(1)}CW" > CW < / l a b e l >
< input type = "text" class = "form-control text-uppercase" id = " $ { key . slice (
2023-12-23 06:15:24 +01:00
1
2023-10-25 10:02:06 +02:00
) } CW " value=" $ { value . cw } " >
2023-10-26 15:25:34 +02:00
< / d i v >
2023-10-25 10:02:06 +02:00
< / d i v >
< div class = "col-3" >
< div class = "form-group" >
< label for = "${key.slice(1)}SSB" > SSB < / l a b e l >
< input type = "text" class = "form-control text-uppercase" id = " $ { key . slice (
2023-12-23 06:15:24 +01:00
1
2023-10-25 10:02:06 +02:00
) } SSB " value=" $ { value . ssb } " >
2023-10-26 15:25:34 +02:00
< / d i v >
2023-10-25 10:02:06 +02:00
< / d i v >
< div class = "col-3" >
< div class = "form-group" >
< label for = "${key.slice(1)}DIGI" > DIGI < / l a b e l >
< input type = "text" class = "form-control text-uppercase" id = " $ { key . slice (
2023-12-23 06:15:24 +01:00
1
2023-10-25 10:02:06 +02:00
) } DIGI " value=" $ { value . digi } " >
2023-10-26 15:25:34 +02:00
< / d i v >
2023-10-25 10:02:06 +02:00
< / d i v >
2023-10-26 15:25:34 +02:00
2023-10-25 10:02:06 +02:00
< / d i v >
` ;
}
$ ( ".js-band-settings" ) . html ( htmlSettings ) ;
function isBandModeEntered ( ) {
let isBandModeOK = true ;
qsoList . forEach ( ( item ) => {
if ( item [ 4 ] === "" || item [ 5 ] === "" ) {
isBandModeOK = false ;
}
} ) ;
return isBandModeOK ;
}
2023-11-08 17:51:26 +01:00
function isTimeEntered ( ) {
let isTimeOK = true ;
qsoList . forEach ( ( item ) => {
if ( item [ 1 ] === "" ) {
isTimeOK = false ;
}
} ) ;
return isTimeOK ;
}
2023-11-02 08:22:01 +01:00
function isExampleDataEntered ( ) {
let isExampleData = false ;
if ( textarea . value . startsWith ( "*example-data*" ) ) {
isExampleData = true ;
2023-11-11 01:31:07 -05:00
}
2023-11-02 08:22:01 +01:00
return isExampleData ;
}
2023-10-25 10:02:06 +02:00
function getAdifTag ( tagName , value ) {
return "<" + tagName + ":" + value . length + ">" + value + " " ;
}
function getReportByMode ( rst , mode ) {
settingsMode = getSettingsMode ( mode ) ;
if ( rst === null ) {
if ( settingsMode === "SSB" ) {
return "59" ;
}
return "599" ;
}
2025-05-28 17:08:54 +01:00
// Handle digital modes with dB signal reports (e.g., -09, +00)
if ( ( mode . toUpperCase ( ) === "FT8" || mode . toUpperCase ( ) === "FT4" || mode . toUpperCase ( ) === "JS8" ||
mode . toUpperCase ( ) === "JT65" || mode . toUpperCase ( ) === "JT65B" || mode . toUpperCase ( ) === "JT6C" ||
mode . toUpperCase ( ) === "JTMS" || mode . toUpperCase ( ) === "ISCAT" || mode . toUpperCase ( ) === "MSK144" ||
mode . toUpperCase ( ) === "JTMSK" || mode . toUpperCase ( ) === "QRA64" || mode . toUpperCase ( ) === "JT9" ||
mode . toUpperCase ( ) === "JT9-1" || mode . toUpperCase ( ) === "ROS" || mode . toUpperCase ( ) === "Q65" ||
mode . toUpperCase ( ) === "FST4" || mode . toUpperCase ( ) === "FST4W" ) && rst . match ( /^[+-]\d{1,2}$/ ) ) {
return rst ;
}
2023-10-25 10:02:06 +02:00
if ( settingsMode === "SSB" ) {
if ( rst . length === 1 ) {
return "5" + rst ;
}
2023-10-31 10:26:15 +01:00
if ( rst . length === 3 ) {
return rst . slice ( 0 , 2 ) ;
}
2023-10-25 10:02:06 +02:00
return rst ;
}
if ( rst . length === 1 ) {
return "5" + rst + "9" ;
} else if ( rst . length === 2 ) {
return rst + "9" ;
}
return rst ;
}
function isSOTA ( value ) {
2023-10-31 23:06:49 +01:00
if ( value . match ( /^[A-Z0-9]{1,3}\/[A-Z]{2}-\d{3}$/ ) ) {
2023-10-25 10:02:06 +02:00
return true ;
}
return false ;
}
2023-10-31 23:06:49 +01:00
function isIOTA ( value ) {
if ( value . match ( /^[AENOS]*[FNSUACA]-\d{3}$/ ) ) {
return true ;
}
}
function isPOTA ( value ) {
2023-11-11 01:25:21 -05:00
if ( value . match ( /^(?!.*FF)[A-Z0-9]{1,3}-\d{4,5}$/ ) ) {
2023-10-31 23:06:49 +01:00
return true ;
}
}
2023-10-25 10:02:06 +02:00
function isWWFF ( value ) {
2023-10-31 23:06:49 +01:00
if ( value . match ( /^[A-Z0-9]{1,3}[F]{2}-\d{4}$/ ) ) {
2023-10-25 10:02:06 +02:00
return true ;
}
return false ;
}
$ ( document ) . ready ( function ( ) {
2023-11-04 12:45:07 +01:00
setInterval ( updateUTCTime , 1000 ) ;
updateUTCTime ( ) ;
2025-11-05 16:41:52 +00:00
// Load satellite data for frequency/mode lookups
$ . getJSON ( base _url + "assets/json/satellite_data.json" , function ( data ) {
satelliteData = data ;
2025-11-05 22:15:15 +00:00
console . log ( "Satellite data loaded:" , Object . keys ( satelliteData ) . length , "satellites" ) ;
// Now that satellite data is loaded, restore session data
restoreSessionData ( ) ;
2025-11-05 16:41:52 +00:00
} ) ;
2025-11-05 22:15:15 +00:00
function restoreSessionData ( ) {
var tabledata = localStorage . getItem ( ` user_ ${ user _id } _tabledata ` ) ;
var mycall = localStorage . getItem ( ` user_ ${ user _id } _my-call ` ) ;
var operator = localStorage . getItem ( ` user_ ${ user _id } _operator ` ) ;
var mysotawwff = localStorage . getItem ( ` user_ ${ user _id } _my-sota-wwff ` ) ;
var qsoarea = localStorage . getItem ( ` user_ ${ user _id } _qso-area ` ) ;
var qsodate = localStorage . getItem ( ` user_ ${ user _id } _qsodate ` ) ;
var myPower = localStorage . getItem ( ` user_ ${ user _id } _my-power ` ) ;
var myGrid = localStorage . getItem ( ` user_ ${ user _id } _my-grid ` ) ;
if ( mycall != null ) {
$ ( "#station-call" ) . val ( mycall ) ;
}
2023-10-25 10:02:06 +02:00
2025-11-05 22:15:15 +00:00
if ( operator != null ) {
$ ( "#operator" ) . val ( operator ) ;
}
2023-10-25 10:02:06 +02:00
2025-11-05 22:15:15 +00:00
if ( mysotawwff != null ) {
$ ( "#my-sota-wwff" ) . val ( mysotawwff ) ;
}
2023-10-25 10:02:06 +02:00
2025-11-05 22:15:15 +00:00
if ( qsoarea != null ) {
$ ( ".qso-area" ) . val ( qsoarea ) ;
}
2023-10-25 10:02:06 +02:00
2025-11-05 22:15:15 +00:00
if ( qsodate != null ) {
$ ( "#qsodate" ) . val ( qsodate ) ;
}
2023-10-25 10:02:06 +02:00
2025-11-05 22:15:15 +00:00
if ( myPower != null ) {
$ ( "#my-power" ) . val ( myPower ) ;
}
2023-10-25 10:02:06 +02:00
2025-11-05 22:15:15 +00:00
if ( myGrid != null ) {
$ ( "#my-grid" ) . val ( myGrid ) ;
}
2023-10-25 10:02:06 +02:00
2025-11-05 22:15:15 +00:00
if ( tabledata != null ) {
$ ( "#qsoTable" ) . html ( tabledata ) ;
handleInput ( ) ;
}
2023-10-25 10:02:06 +02:00
}
} ) ;
2023-10-26 20:46:13 +02:00
$ ( ".js-save-to-log" ) . click ( function ( ) {
2023-10-26 22:50:55 +02:00
if ( $ ( "textarea" ) . val ( ) === "" ) {
2023-11-11 01:31:07 -05:00
$ ( "#textarea" ) . css ( "border" , "2px solid rgb(217, 83, 79)" ) ;
setTimeout ( function ( ) {
$ ( "#textarea" ) . css ( "border" , "" ) ;
} , 2000 ) ;
2023-11-02 08:22:01 +01:00
return false ;
2023-10-27 19:32:21 +02:00
}
if ( false === isBandModeEntered ( ) ) {
BootstrapDialog . alert ( {
2023-10-30 23:52:20 +01:00
title : lang _general _word _warning ,
message : lang _qso _simplefle _warning _missing _band _mode ,
2023-10-27 19:32:21 +02:00
type : BootstrapDialog . TYPE _DANGER ,
2023-10-30 23:52:20 +01:00
btnCancelLabel : lang _general _word _cancel ,
btnOKLabel : lang _general _word _ok ,
2023-10-27 19:32:21 +02:00
btnOKClass : "btn-warning" ,
} ) ;
return false ;
}
2023-11-08 17:51:26 +01:00
if ( false === isTimeEntered ( ) ) {
BootstrapDialog . alert ( {
title : lang _general _word _warning ,
message : lang _qso _simplefle _warning _missing _time ,
type : BootstrapDialog . TYPE _DANGER ,
btnCancelLabel : lang _general _word _cancel ,
btnOKLabel : lang _general _word _ok ,
btnOKClass : "btn-warning" ,
} ) ;
return false ;
}
2023-11-02 08:22:01 +01:00
if ( true === isExampleDataEntered ( ) ) {
BootstrapDialog . alert ( {
title : lang _general _word _warning ,
message : lang _qso _simplefle _warning _example _data ,
type : BootstrapDialog . TYPE _DANGER ,
btnCancelLabel : lang _general _word _cancel ,
btnOKLabel : lang _general _word _ok ,
btnOKClass : "btn-warning" ,
} ) ;
return false ;
2023-11-11 01:31:07 -05:00
} else {
2023-10-26 22:50:55 +02:00
handleInput ( ) ;
BootstrapDialog . confirm ( {
2023-10-30 23:52:20 +01:00
title : lang _general _word _attention ,
2023-11-11 01:31:07 -05:00
message : lang _qso _simplefle _confirm _save _to _log ,
2023-10-26 22:50:55 +02:00
type : BootstrapDialog . TYPE _INFO ,
2023-10-30 23:52:20 +01:00
btnCancelLabel : lang _general _word _cancel ,
btnOKLabel : lang _general _word _ok ,
2023-10-26 22:50:55 +02:00
btnOKClass : "btn-info" ,
callback : function ( result ) {
if ( result ) {
var operator = $ ( "#operator" ) . val ( ) ;
operator = operator . toUpperCase ( ) ;
var ownCallsign = $ ( "#station-call" ) . val ( ) . toUpperCase ( ) ;
ownCallsign = ownCallsign . toUpperCase ( ) ;
2023-10-30 08:53:06 +01:00
// var mySotaWwff = $("#my-sota-wwff").val().toUpperCase();
2023-10-26 22:50:55 +02:00
2023-10-30 08:53:06 +01:00
// var myPower = $("#my-power").val();
// var myGrid = $("#my-grid").val().toUpperCase();
2023-10-26 22:50:55 +02:00
qsoList . forEach ( ( item ) => {
var callsign = item [ 2 ] ;
var rst _rcvd = item [ 7 ] ;
var rst _sent = item [ 6 ] ;
2023-10-27 12:40:34 +02:00
var start _date = item [ 0 ] ;
2023-11-11 01:31:07 -05:00
var start _time =
item [ 1 ] [ 0 ] +
item [ 1 ] [ 1 ] +
":" +
item [ 1 ] [ 2 ] +
item [ 1 ] [ 3 ] ;
2023-10-26 22:50:55 +02:00
var band = item [ 4 ] ;
var mode = item [ 5 ] ;
2023-11-06 13:26:48 +01:00
var freq _display = item [ 3 ] * 1000000 ;
2023-10-27 12:40:34 +02:00
var station _profile = $ ( ".station_id" ) . val ( ) ;
2023-11-11 01:31:07 -05:00
var sota _ref = "" ;
var iota _ref = "" ;
var pota _ref = "" ;
var wwff _ref = "" ;
2023-10-31 20:50:05 +01:00
if ( isSOTA ( item [ 8 ] ) ) {
sota _ref = item [ 8 ] ;
2023-10-31 23:06:49 +01:00
} else if ( isIOTA ( item [ 8 ] ) ) {
iota _ref = item [ 8 ] ;
} else if ( isPOTA ( item [ 8 ] ) ) {
pota _ref = item [ 8 ] ;
2023-10-31 20:50:05 +01:00
} else if ( isWWFF ( item [ 8 ] ) ) {
2023-10-31 23:06:49 +01:00
wwff _ref = item [ 8 ] ;
2023-10-31 20:50:05 +01:00
}
2025-11-05 16:41:52 +00:00
// Satellite data
var sat _name = item [ 9 ] || "" ;
var sat _mode = item [ 10 ] || "" ;
var prop _mode = item [ 11 ] || "" ;
var freq _display _rx = item [ 12 ] ? item [ 12 ] * 1000000 : "" ;
var band _rx = item [ 13 ] || "" ;
var gridsquare = item [ 14 ] || "" ;
2026-01-14 10:23:15 +00:00
var comment = item [ 15 ] || "" ;
2023-10-27 12:40:34 +02:00
2026-04-27 22:41:40 +01:00
// Check if gridsquare contains multiple comma-separated grids (VUCC)
var locator = "" ;
var vucc _grids = "" ;
if ( gridsquare && gridsquare . includes ( "," ) ) {
// Multiple gridsquares - store as VUCC grids
vucc _grids = gridsquare ;
} else {
// Single gridsquare
locator = gridsquare ;
}
2023-10-27 12:40:34 +02:00
$ . ajax ( {
url : base _url + "index.php/qso/saveqso" ,
type : "post" ,
data : {
callsign : callsign ,
rst _rcvd : rst _rcvd ,
rst _sent : rst _sent ,
start _date : start _date ,
band : band ,
mode : mode ,
freq _display : freq _display ,
start _time : start _time ,
station _profile : station _profile ,
2023-10-31 20:50:05 +01:00
sota _ref : sota _ref ,
2023-10-31 23:06:49 +01:00
iota _ref : iota _ref ,
pota _ref : pota _ref ,
wwff _ref : wwff _ref ,
2025-11-05 16:41:52 +00:00
sat _name : sat _name ,
sat _mode : sat _mode ,
prop _mode : prop _mode ,
freq _display _rx : freq _display _rx ,
band _rx : band _rx ,
2026-04-27 22:41:40 +01:00
locator : locator ,
vucc _grids : vucc _grids ,
2026-01-14 10:23:15 +00:00
comment : comment ,
2023-12-23 06:15:24 +01:00
isSFLE : true ,
2023-10-27 12:40:34 +02:00
} ,
success : function ( result ) { } ,
2023-10-26 22:50:55 +02:00
} ) ;
} ) ;
2023-10-27 12:35:07 +02:00
2023-10-26 22:50:55 +02:00
clearSession ( ) ;
BootstrapDialog . alert ( {
2023-10-30 23:52:20 +01:00
title : lang _qso _simplefle _success _save _to _log _header ,
2023-11-11 01:31:07 -05:00
message : lang _qso _simplefle _success _save _to _log ,
2023-10-26 22:50:55 +02:00
} ) ;
}
2023-10-26 20:46:13 +02:00
} ,
} ) ;
2023-10-26 22:50:55 +02:00
}
2023-10-26 20:46:13 +02:00
} ) ;