From 52692e05a8dd2d95204f07f605449e515a4841af Mon Sep 17 00:00:00 2001 From: HB9HIL Date: Sun, 17 Mar 2024 23:25:23 +0100 Subject: [PATCH] catch case if no ref is available --- application/controllers/Labels.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/application/controllers/Labels.php b/application/controllers/Labels.php index 97f3a596a..7d69e1e1c 100644 --- a/application/controllers/Labels.php +++ b/application/controllers/Labels.php @@ -365,12 +365,13 @@ class Labels extends CI_Controller { if ($grid) { $text .= "My call: ".$qso['mycall']." Grid: ".$qso['mygrid']."\n"; } if ($reference) { $ref_text = ""; - if (!empty($qso['sig']) && !empty($qso['sig_info'])) { $ref_text .= $qso['sig'].":".$qso['sig_info']." ";} - if (!empty($qso['sota'])) { $ref_text .= "SOTA:".$qso['sota']." ";} - if (!empty($qso['iota'])) { $ref_text .= "IOTA:".$qso['iota']." ";} - if (!empty($qso['pota'])) { $ref_text .= "POTA:".$qso['pota']." ";} - if (!empty($qso['wwff'])) { $ref_text .= "WWFF:".$qso['wwff'];} - $text .= $ref_text."\n"; + $ref_avail = false; + if (!empty($qso['sig']) && !empty($qso['sig_info'])) { $ref_text .= $qso['sig'].":".$qso['sig_info']." "; $ref_avail = true;} + if (!empty($qso['sota'])) { $ref_text .= "SOTA:".$qso['sota']." "; $ref_avail = true;} + if (!empty($qso['iota'])) { $ref_text .= "IOTA:".$qso['iota']." "; $ref_avail = true;} + if (!empty($qso['pota'])) { $ref_text .= "POTA:".$qso['pota']." "; $ref_avail = true;} + if (!empty($qso['wwff'])) { $ref_text .= "WWFF:".$qso['wwff']; $ref_avail = true;} + if ($ref_avail == true) {$text .= $ref_text."\n";} } $text .= "Thanks for the QSO".($numofqsos>1 ? 's' : ''); $text .= " | ".($qso['qsl_recvd'] == 'Y' ? 'TNX' : 'PSE')." QSL";