diff --git a/application/controllers/Awards.php b/application/controllers/Awards.php index 9ddf96398..47aae088a 100644 --- a/application/controllers/Awards.php +++ b/application/controllers/Awards.php @@ -1360,6 +1360,9 @@ class Awards extends CI_Controller { } } + // DC is combined with MD - copy MD status to DC for map display + $states['DC'] = $states['MD']; + header('Content-Type: application/json'); echo json_encode($states); } diff --git a/application/models/Was.php b/application/models/Was.php index c840be292..7a868f6cd 100644 --- a/application/models/Was.php +++ b/application/models/Was.php @@ -36,15 +36,17 @@ class was extends CI_Model { if ($postdata['worked'] != NULL) { $wasBand = $this->getWasWorked($location_list, $band, $postdata); foreach ($wasBand as $line) { - $bandWas[$line->col_state][$band] = '
col_state . '","' . $band . '","All","All","'. $postdata['mode'] . '","WAS", "")\'>W
'; - $states[$line->col_state]['count']++; + $state = $this->normalizeState($line->col_state); // DC counts as MD + $bandWas[$state][$band] = '
W
'; + $states[$state]['count']++; } } if ($postdata['confirmed'] != NULL) { $wasBand = $this->getWasConfirmed($location_list, $band, $postdata); foreach ($wasBand as $line) { - $bandWas[$line->col_state][$band] = '
col_state . '","' . $band . '","All","All","'. $postdata['mode'] . '","WAS", "'.$qsl.'")\'>C
'; - $states[$line->col_state]['count']++; + $state = $this->normalizeState($line->col_state); // DC counts as MD + $bandWas[$state][$band] = '
C
'; + $states[$state]['count']++; } } } @@ -112,7 +114,8 @@ class was extends CI_Model { function getSummaryByBand($band, $postdata, $location_list) { $bindings=[]; - $sql = "SELECT count(distinct thcv.col_state) as count FROM " . $this->config->item('table_name') . " thcv"; + // DC is combined with MD, so we use CASE to normalize + $sql = "SELECT count(distinct CASE WHEN thcv.col_state = 'DC' THEN 'MD' ELSE thcv.col_state END) as count FROM " . $this->config->item('table_name') . " thcv"; $sql .= " where station_id in (" . $location_list . ")"; if ($band == 'SAT') { @@ -148,7 +151,8 @@ class was extends CI_Model { function getSummaryByBandConfirmed($band, $postdata, $location_list) { $bindings=[]; - $sql = "SELECT count(distinct thcv.col_state) as count FROM " . $this->config->item('table_name') . " thcv"; + // DC is combined with MD, so we use CASE to normalize + $sql = "SELECT count(distinct CASE WHEN thcv.col_state = 'DC' THEN 'MD' ELSE thcv.col_state END) as count FROM " . $this->config->item('table_name') . " thcv"; $sql .= " where station_id in (" . $location_list . ")"; if ($band == 'SAT') { @@ -255,8 +259,16 @@ class was extends CI_Model { function addStateToQuery() { $sql = ''; $sql .= " and COL_DXCC in ('291', '6', '110')"; - $sql .= " and COL_STATE in ('AK','AL','AR','AZ','CA','CO','CT','DE','FL','GA','HI','IA','ID','IL','IN','KS','KY','LA','MA','MD','ME','MI','MN','MO','MS','MT','NC','ND','NE','NH','NJ','NM','NV','NY','OH','OK','OR','PA','RI','SC','SD','TN','TX','UT','VA','VT','WA','WI','WV','WY')"; + // DC is combined with MD for WAS award + $sql .= " and COL_STATE in ('AK','AL','AR','AZ','CA','CO','CT','DC','DE','FL','GA','HI','IA','ID','IL','IN','KS','KY','LA','MA','MD','ME','MI','MN','MO','MS','MT','NC','ND','NE','NH','NJ','NM','NV','NY','OH','OK','OR','PA','RI','SC','SD','TN','TX','UT','VA','VT','WA','WI','WV','WY')"; return $sql; } + + /** + * Normalize state code - DC counts as MD for WAS award + */ + function normalizeState($state) { + return ($state === 'DC') ? 'MD' : $state; + } } ?> diff --git a/application/views/awards/was/index.php b/application/views/awards/was/index.php index 70b1c1d50..b3496ee1c 100644 --- a/application/views/awards/was/index.php +++ b/application/views/awards/was/index.php @@ -2,6 +2,7 @@ var tileUrl="optionslib->get_option('option_map_tile_server');?>"; var lang_usa_state = ""; var lang_hover_over_a_state = ""; + var lang_inc = "";