diff --git a/application/controllers/Awards.php b/application/controllers/Awards.php
index 3e1bdf8f6..e3cc159e5 100644
--- a/application/controllers/Awards.php
+++ b/application/controllers/Awards.php
@@ -2395,6 +2395,7 @@ class Awards extends CI_Controller {
$this->load->model('award_pl_polska');
$this->load->model('bands');
+ $this->load->library('Genfunctions');
// Define valid bands for Polska award (per PZK rules)
// https://awards.pzk.org.pl/polish-awards/polska.html
@@ -2424,14 +2425,21 @@ class Awards extends CI_Controller {
// Add confirmed key for gen_qsl_from_postdata function compatibility
$postdata['confirmed'] = 1;
+ // Generate QSL string for displayContacts links
+ $data['qsl_string'] = $this->genfunctions->gen_qsl_from_postdata($postdata);
+
if ($logbooks_locations_array) {
$location_list = "'".implode("','",$logbooks_locations_array)."'";
- // Simplified data - just confirmed counts
+ // Worked data (all QSOs, not just confirmed)
+ $data['polska_worked'] = $this->award_pl_polska->get_polska_worked_by_modes($location_list);
+ $data['polska_worked_bands'] = $this->award_pl_polska->get_polska_worked_by_bands($data['worked_bands'], $location_list);
+
+ // Confirmed data
$data['polska_array'] = $this->award_pl_polska->get_polska_simple_by_modes($postdata, $location_list);
$data['polska_totals'] = $this->award_pl_polska->get_polska_totals_by_modes($postdata, $location_list);
- // Band-based data (simplified)
+ // Band-based confirmed data
$data['polska_array_bands'] = $this->award_pl_polska->get_polska_simple_by_bands($data['worked_bands'], $postdata, $location_list);
$data['polska_totals_bands'] = $this->award_pl_polska->get_polska_totals_by_bands($data['worked_bands'], $postdata, $location_list);
@@ -2456,6 +2464,8 @@ class Awards extends CI_Controller {
}
} else {
$location_list = null;
+ $data['polska_worked'] = null;
+ $data['polska_worked_bands'] = null;
$data['polska_array'] = null;
$data['polska_totals'] = null;
$data['polska_array_bands'] = null;
@@ -2464,6 +2474,9 @@ class Awards extends CI_Controller {
$data['polska_classes_bands'] = null;
}
+ // Pass postdata for use in view
+ $data['postdata'] = $postdata;
+
// Render page
$data['page_title'] = sprintf(__("Awards - %s"), __('"Polska" Award'));
$data['user_map_custom'] = $this->optionslib->get_map_custom();
diff --git a/application/models/Award_pl_polska.php b/application/models/Award_pl_polska.php
index 6c20fd68d..ef7bd13bb 100644
--- a/application/models/Award_pl_polska.php
+++ b/application/models/Award_pl_polska.php
@@ -151,6 +151,33 @@ class Award_pl_polska extends CI_Model {
return null;
}
+ /**
+ * Get worked (not confirmed) QSO counts by mode categories
+ */
+ function get_polska_worked_by_modes($location_list) {
+ $result = array();
+
+ foreach ($this->voivodeship_names as $code => $name) {
+ $result[$code] = array_fill_keys($this->MODE_CATEGORIES, 0);
+ }
+
+ foreach ($this->MODE_CATEGORIES as $category) {
+ $voivData = $this->queryVoivodeships($location_list, array(
+ 'mode_category' => $category,
+ 'confirmed' => false,
+ 'withCount' => true
+ ));
+
+ foreach ($voivData as $line) {
+ if (isset($result[$line->COL_STATE])) {
+ $result[$line->COL_STATE][$category] = (int)$line->qso_count;
+ }
+ }
+ }
+
+ return $result;
+ }
+
/**
* Get confirmed QSO counts by mode categories
*/
@@ -179,6 +206,33 @@ class Award_pl_polska extends CI_Model {
return $result;
}
+ /**
+ * Get worked (not confirmed) QSO counts by bands
+ */
+ function get_polska_worked_by_bands($bands, $location_list) {
+ $result = array();
+
+ foreach ($this->voivodeship_names as $code => $name) {
+ $result[$code] = array_fill_keys($bands, 0);
+ }
+
+ foreach ($bands as $band) {
+ $voivData = $this->queryVoivodeships($location_list, array(
+ 'band' => $band,
+ 'confirmed' => false,
+ 'withCount' => true
+ ));
+
+ foreach ($voivData as $line) {
+ if (isset($result[$line->COL_STATE])) {
+ $result[$line->COL_STATE][$band] = (int)$line->qso_count;
+ }
+ }
+ }
+
+ return $result;
+ }
+
/**
* Get confirmed QSO counts by bands
*/
diff --git a/application/views/awards/pl_polska/index.php b/application/views/awards/pl_polska/index.php
index f08fa3af0..fcd144364 100644
--- a/application/views/awards/pl_polska/index.php
+++ b/application/views/awards/pl_polska/index.php
@@ -3,6 +3,9 @@
var lang_polish_voivodeship = "= __("Polish Voivodeships"); ?>";
var lang_hover_over_voivodeship = "= __("Hover over a voivodeship"); ?>";
+