diff --git a/application/controllers/Awards.php b/application/controllers/Awards.php index 663518e4..cd405b62 100644 --- a/application/controllers/Awards.php +++ b/application/controllers/Awards.php @@ -523,6 +523,112 @@ class Awards extends CI_Controller { $this->load->view('awards/details', $data); } + public function gridmaster() { + $data['page_title']= lang('menu_us_gridmaster'); + + $this->load->model('bands'); + $this->load->model('gridmap_model'); + $this->load->model('stations'); + + $data['homegrid']= explode(',', $this->stations->find_gridsquare()); + + $data['modes'] = $this->gridmap_model->get_worked_modes(); + $data['bands']= $this->bands->get_worked_bands(); + $data['sats_available']= $this->bands->get_worked_sats(); + + $data['layer']= $this->optionslib->get_option('option_map_tile_server'); + + $data['attribution']= $this->optionslib->get_option('option_map_tile_server_copyright'); + + $data['gridsquares_gridsquares']= lang('gridsquares_gridsquares'); + $data['gridsquares_gridsquares_worked']= lang('gridsquares_gridsquares_worked'); + $data['gridsquares_gridsquares_lotw']= lang('gridsquares_gridsquares_lotw'); + $data['gridsquares_gridsquares_paper']= lang('gridsquares_gridsquares_paper'); + + $footerData = []; + $footerData['scripts']= [ + 'assets/js/leaflet/geocoding.js', + 'assets/js/leaflet/L.MaidenheadColouredGridmasterMap.js', + 'assets/js/sections/gridmaster.js?' + ]; + + $this->load->view('interface_assets/header',$data); + $this->load->view('awards/gridmaster/index'); + $this->load->view('interface_assets/footer',$footerData); + } + + public function getGridmasterGridsjs() { + $this->load->model('gridmaster_model'); + + $array_grid_4char = array(); + $array_grid_4char_lotw = array(); + $array_grid_4char_paper = array(); + + $grid_4char = ""; + $grid_4char_lotw = ""; + + $query = $this->gridmaster_model->get_lotw(); + if ($query && $query->num_rows() > 0) { + foreach ($query->result() as $row) { + $grid_4char_lotw = strtoupper(substr($row->GRID_SQUARES,0,4)); + if(!in_array($grid_4char_lotw, $array_grid_4char_lotw)){ + array_push($array_grid_4char_lotw, $grid_4char_lotw); + } + } + } + + $query = $this->gridmaster_model->get_paper(); + if ($query && $query->num_rows() > 0) { + foreach ($query->result() as $row) { + $grid_4char_paper = strtoupper(substr($row->GRID_SQUARES,0,4)); + if(!in_array($grid_4char_paper, $array_grid_4char_paper)){ + array_push($array_grid_4char_paper, $grid_4char_paper); + } + } + } + + $query = $this->gridmaster_model->get_worked(); + if ($query && $query->num_rows() > 0) { + foreach ($query->result() as $row) { + $grid_four = strtoupper(substr($row->GRID_SQUARES,0,4)); + if(!in_array($grid_four, $array_grid_4char)){ + array_push($array_grid_4char, $grid_four); + } + } + } + + $vucc_grids = $this->gridmaster_model->get_vucc_lotw(); + foreach($vucc_grids as $key) { + $grid_four_lotw = strtoupper(substr($key,0,4)); + if(!in_array($grid_four_lotw, $array_grid_4char_lotw)){ + array_push($array_grid_4char_lotw, $grid_four_lotw); + } + } + + $vucc_grids = $this->gridmaster_model->get_vucc_paper(); + foreach($vucc_grids as $key) { + $grid_four_paper = strtoupper(substr($key,0,4)); + if(!in_array($grid_four_paper, $array_grid_4char_paper)){ + array_push($array_grid_4char_paper, $grid_four_paper); + } + } + + $vucc_grids = $this->gridmaster_model->get_vucc_worked(); + foreach($vucc_grids as $key) { + $grid_four = strtoupper(substr($key,0,4)); + if(!in_array($grid_four, $array_grid_4char)){ + array_push($array_grid_4char, $grid_four); + } + } + + $data['grid_4char_lotw'] = ($array_grid_4char_lotw); + $data['grid_4char_paper'] = ($array_grid_4char_paper); + $data['grid_4char'] = ($array_grid_4char); + + header('Content-Type: application/json'); + echo json_encode($data); + } + /* Handles showing worked Sigs Adif fields: my_sig diff --git a/application/language/bulgarian/menu_lang.php b/application/language/bulgarian/menu_lang.php index a0722674..9a61fb7d 100644 --- a/application/language/bulgarian/menu_lang.php +++ b/application/language/bulgarian/menu_lang.php @@ -42,6 +42,7 @@ $lang['menu_pota'] = 'POTA'; $lang['menu_sig'] = 'SIG'; $lang['menu_sota'] = 'SOTA'; $lang['menu_us_counties'] = 'US Counties'; +$lang['menu_us_gridmaster'] = 'US Gridmaster'; $lang['menu_vucc'] = 'VUCC'; $lang['menu_was'] = 'WAS'; $lang['menu_wwff'] = 'WWFF'; diff --git a/application/language/chinese_simplified/gridsquares_lang.php b/application/language/chinese_simplified/gridsquares_lang.php index 7f461cc1..a2d127dd 100644 --- a/application/language/chinese_simplified/gridsquares_lang.php +++ b/application/language/chinese_simplified/gridsquares_lang.php @@ -23,5 +23,7 @@ $lang['gridsquares_button_plot'] = '绘制'; $lang['gridsquares_gridsquares'] = '网格'; $lang['gridsquares_gridsquares_confirmed'] = '已确认的网格'; $lang['gridsquares_gridsquares_not_confirmed'] = '未确认的网格'; +$lang['gridsquares_gridsquares_lotw'] = 'Gridsquares confirmed on LoTW'; +$lang['gridsquares_gridsquares_paper'] = 'Gridsquares confirmed by paper QSL'; $lang['gridsquares_gridsquares_total_worked'] = '总共工作过的网格'; -$lang['gridsquares_gridsquares_total_activated'] = 'Total gridsquares activated'; \ No newline at end of file +$lang['gridsquares_gridsquares_total_activated'] = 'Total gridsquares activated'; diff --git a/application/language/chinese_simplified/menu_lang.php b/application/language/chinese_simplified/menu_lang.php index 3872580d..0d8609d8 100644 --- a/application/language/chinese_simplified/menu_lang.php +++ b/application/language/chinese_simplified/menu_lang.php @@ -42,6 +42,7 @@ $lang['menu_pota'] = 'POTA'; $lang['menu_sig'] = 'SIG'; $lang['menu_sota'] = 'SOTA'; $lang['menu_us_counties'] = 'US Counties'; +$lang['menu_us_gridmaster'] = 'US Gridmaster'; $lang['menu_vucc'] = 'VUCC'; $lang['menu_was'] = 'WAS'; $lang['menu_wwff'] = 'WWFF'; diff --git a/application/language/czech/gridsquares_lang.php b/application/language/czech/gridsquares_lang.php index fd6949fb..13ffd30d 100644 --- a/application/language/czech/gridsquares_lang.php +++ b/application/language/czech/gridsquares_lang.php @@ -22,6 +22,8 @@ $lang['gridsquares_button_plot'] = 'Zobrazit'; $lang['gridsquares_gridsquares'] = 'Lokátory'; $lang['gridsquares_gridsquares_confirmed'] = 'Potvrzené lokátory'; +$lang['gridsquares_gridsquares_lotw'] = 'Gridsquares confirmed on LoTW'; +$lang['gridsquares_gridsquares_paper'] = 'Gridsquares confirmed by paper QSL'; $lang['gridsquares_gridsquares_not_confirmed'] = 'Nepotvrzené lokátory'; $lang['gridsquares_gridsquares_total_worked'] = 'Celkový počet odpracovaných lokátorů'; -$lang['gridsquares_gridsquares_total_activated'] = 'Total gridsquares activated'; \ No newline at end of file +$lang['gridsquares_gridsquares_total_activated'] = 'Total gridsquares activated'; diff --git a/application/language/czech/menu_lang.php b/application/language/czech/menu_lang.php index bb2d244d..db5861f6 100644 --- a/application/language/czech/menu_lang.php +++ b/application/language/czech/menu_lang.php @@ -42,6 +42,7 @@ $lang['menu_pota'] = 'POTA'; $lang['menu_sig'] = 'SIG'; $lang['menu_sota'] = 'SOTA'; $lang['menu_us_counties'] = 'US okresy'; +$lang['menu_us_gridmaster'] = 'US Gridmaster'; $lang['menu_vucc'] = 'VUCC'; $lang['menu_was'] = 'WAS'; $lang['menu_wwff'] = 'WWFF'; diff --git a/application/language/dutch/gridsquares_lang.php b/application/language/dutch/gridsquares_lang.php index aa739b29..d8d4a1b7 100644 --- a/application/language/dutch/gridsquares_lang.php +++ b/application/language/dutch/gridsquares_lang.php @@ -22,6 +22,8 @@ $lang['gridsquares_button_plot'] = 'Plot'; $lang['gridsquares_gridsquares'] = 'Gridsquares'; $lang['gridsquares_gridsquares_confirmed'] = 'Gridsquares confirmed'; +$lang['gridsquares_gridsquares_lotw'] = 'Gridsquares confirmed on LoTW'; +$lang['gridsquares_gridsquares_paper'] = 'Gridsquares confirmed by paper QSL'; $lang['gridsquares_gridsquares_not_confirmed'] = 'Gridsquares not confirmed'; $lang['gridsquares_gridsquares_total_worked'] = 'Total gridsquares worked'; $lang['gridsquares_gridsquares_total_activated'] = 'Total gridsquares activated'; \ No newline at end of file diff --git a/application/language/dutch/menu_lang.php b/application/language/dutch/menu_lang.php index 7428ddd3..7672f1be 100644 --- a/application/language/dutch/menu_lang.php +++ b/application/language/dutch/menu_lang.php @@ -42,6 +42,7 @@ $lang['menu_pota'] = 'POTA'; $lang['menu_sig'] = 'SIG'; $lang['menu_sota'] = 'SOTA'; $lang['menu_us_counties'] = 'US Counties'; +$lang['menu_us_gridmaster'] = 'US Gridmaster'; $lang['menu_vucc'] = 'VUCC'; $lang['menu_was'] = 'WAS'; $lang['menu_wwff'] = 'WWFF'; diff --git a/application/language/english/gridsquares_lang.php b/application/language/english/gridsquares_lang.php index ae5e2867..0b18933e 100644 --- a/application/language/english/gridsquares_lang.php +++ b/application/language/english/gridsquares_lang.php @@ -21,7 +21,10 @@ $lang['gridsquares_confirmation'] = 'Confirmation'; $lang['gridsquares_button_plot'] = 'Plot'; $lang['gridsquares_gridsquares'] = 'Gridsquares'; +$lang['gridsquares_gridsquares_worked'] = 'Gridsquares worked'; $lang['gridsquares_gridsquares_confirmed'] = 'Gridsquares confirmed'; +$lang['gridsquares_gridsquares_lotw'] = 'Gridsquares confirmed on LoTW'; +$lang['gridsquares_gridsquares_paper'] = 'Gridsquares confirmed by paper QSL'; $lang['gridsquares_gridsquares_not_confirmed'] = 'Gridsquares not confirmed'; $lang['gridsquares_gridsquares_total_worked'] = 'Total gridsquares worked'; -$lang['gridsquares_gridsquares_total_activated'] = 'Total gridsquares activated'; \ No newline at end of file +$lang['gridsquares_gridsquares_total_activated'] = 'Total gridsquares activated'; diff --git a/application/language/english/menu_lang.php b/application/language/english/menu_lang.php index 4d6acd63..52a06af3 100644 --- a/application/language/english/menu_lang.php +++ b/application/language/english/menu_lang.php @@ -42,6 +42,7 @@ $lang['menu_pota'] = 'POTA'; $lang['menu_sig'] = 'SIG'; $lang['menu_sota'] = 'SOTA'; $lang['menu_us_counties'] = 'US Counties'; +$lang['menu_us_gridmaster'] = 'US Gridmaster'; $lang['menu_vucc'] = 'VUCC'; $lang['menu_was'] = 'WAS'; $lang['menu_wwff'] = 'WWFF'; diff --git a/application/language/finnish/gridsquares_lang.php b/application/language/finnish/gridsquares_lang.php index fadea256..af17febc 100644 --- a/application/language/finnish/gridsquares_lang.php +++ b/application/language/finnish/gridsquares_lang.php @@ -22,6 +22,8 @@ $lang['gridsquares_button_plot'] = 'Merkitse'; $lang['gridsquares_gridsquares'] = 'Gridsquares'; $lang['gridsquares_gridsquares_confirmed'] = 'Gridsquares confirmed'; +$lang['gridsquares_gridsquares_lotw'] = 'Gridsquares confirmed on LoTW'; +$lang['gridsquares_gridsquares_paper'] = 'Gridsquares confirmed by paper QSL'; $lang['gridsquares_gridsquares_not_confirmed'] = 'Gridsquares not confirmed'; $lang['gridsquares_gridsquares_total_worked'] = 'Total gridsquares worked'; $lang['gridsquares_gridsquares_total_activated'] = 'Total gridsquares activated'; \ No newline at end of file diff --git a/application/language/finnish/menu_lang.php b/application/language/finnish/menu_lang.php index b7d762e0..9ae8e3ec 100644 --- a/application/language/finnish/menu_lang.php +++ b/application/language/finnish/menu_lang.php @@ -42,6 +42,7 @@ $lang['menu_pota'] = 'POTA'; $lang['menu_sig'] = 'SIG'; $lang['menu_sota'] = 'SOTA'; $lang['menu_us_counties'] = 'USA Osavaltiot'; +$lang['menu_us_gridmaster'] = 'US Gridmaster'; $lang['menu_vucc'] = 'VUCC'; $lang['menu_was'] = 'WAS'; $lang['menu_wwff'] = 'WWFF'; diff --git a/application/language/french/gridsquares_lang.php b/application/language/french/gridsquares_lang.php index 572124c8..d1611bf6 100644 --- a/application/language/french/gridsquares_lang.php +++ b/application/language/french/gridsquares_lang.php @@ -22,6 +22,8 @@ $lang['gridsquares_button_plot'] = 'Plot'; $lang['gridsquares_gridsquares'] = 'Locators'; $lang['gridsquares_gridsquares_confirmed'] = 'Locators confirmés'; +$lang['gridsquares_gridsquares_lotw'] = 'Gridsquares confirmed on LoTW'; +$lang['gridsquares_gridsquares_paper'] = 'Gridsquares confirmed by paper QSL'; $lang['gridsquares_gridsquares_not_confirmed'] = 'Locators non confirmés'; $lang['gridsquares_gridsquares_total_worked'] = 'Total des Locators contactés'; -$lang['gridsquares_gridsquares_total_activated'] = 'Total gridsquares activated'; \ No newline at end of file +$lang['gridsquares_gridsquares_total_activated'] = 'Total gridsquares activated'; diff --git a/application/language/german/gridsquares_lang.php b/application/language/german/gridsquares_lang.php index 6fc2a3c9..9d9fb621 100644 --- a/application/language/german/gridsquares_lang.php +++ b/application/language/german/gridsquares_lang.php @@ -21,7 +21,10 @@ $lang['gridsquares_confirmation'] = 'Bestätigung'; $lang['gridsquares_button_plot'] = 'Kartieren'; $lang['gridsquares_gridsquares'] = 'Planquadrate'; +$lang['gridsquares_gridsquares_worked'] = 'Gearbeitete Planquadrate'; $lang['gridsquares_gridsquares_confirmed'] = 'Planquadrate bestätigt'; -$lang['gridsquares_gridsquares_not_confirmed'] = 'Planquadrate nicht bestätigt'; +$lang['gridsquares_gridsquares_lotw'] = 'Auf LoTW bestätigte Planquadrate'; +$lang['gridsquares_gridsquares_paper'] = 'Per Papier QSL bestätigte Planquadrate'; +$lang['gridsquares_gridsquares_not_confirmed'] = 'Unbestätigte Planquadrate'; $lang['gridsquares_gridsquares_total_worked'] = 'Summe gearbeiteter Planquadrate'; -$lang['gridsquares_gridsquares_total_activated'] = 'Summe aktivierter Planquadrate'; \ No newline at end of file +$lang['gridsquares_gridsquares_total_activated'] = 'Summe aktivierter Planquadrate'; diff --git a/application/language/german/menu_lang.php b/application/language/german/menu_lang.php index 88aac521..ac6f7103 100644 --- a/application/language/german/menu_lang.php +++ b/application/language/german/menu_lang.php @@ -42,6 +42,7 @@ $lang['menu_pota'] = 'POTA'; $lang['menu_sig'] = 'SIG'; $lang['menu_sota'] = 'SOTA'; $lang['menu_us_counties'] = 'US Countys'; +$lang['menu_us_gridmaster'] = 'US Gridmaster'; $lang['menu_vucc'] = 'VUCC'; $lang['menu_was'] = 'WAS'; $lang['menu_wwff'] = 'WWFF'; diff --git a/application/language/greek/gridsquares_lang.php b/application/language/greek/gridsquares_lang.php index ae5e2867..cecb256c 100644 --- a/application/language/greek/gridsquares_lang.php +++ b/application/language/greek/gridsquares_lang.php @@ -22,6 +22,8 @@ $lang['gridsquares_button_plot'] = 'Plot'; $lang['gridsquares_gridsquares'] = 'Gridsquares'; $lang['gridsquares_gridsquares_confirmed'] = 'Gridsquares confirmed'; +$lang['gridsquares_gridsquares_lotw'] = 'Gridsquares confirmed on LoTW'; +$lang['gridsquares_gridsquares_paper'] = 'Gridsquares confirmed by paper QSL'; $lang['gridsquares_gridsquares_not_confirmed'] = 'Gridsquares not confirmed'; $lang['gridsquares_gridsquares_total_worked'] = 'Total gridsquares worked'; -$lang['gridsquares_gridsquares_total_activated'] = 'Total gridsquares activated'; \ No newline at end of file +$lang['gridsquares_gridsquares_total_activated'] = 'Total gridsquares activated'; diff --git a/application/language/greek/menu_lang.php b/application/language/greek/menu_lang.php index 4d6acd63..52a06af3 100644 --- a/application/language/greek/menu_lang.php +++ b/application/language/greek/menu_lang.php @@ -42,6 +42,7 @@ $lang['menu_pota'] = 'POTA'; $lang['menu_sig'] = 'SIG'; $lang['menu_sota'] = 'SOTA'; $lang['menu_us_counties'] = 'US Counties'; +$lang['menu_us_gridmaster'] = 'US Gridmaster'; $lang['menu_vucc'] = 'VUCC'; $lang['menu_was'] = 'WAS'; $lang['menu_wwff'] = 'WWFF'; diff --git a/application/language/italian/gridsquares_lang.php b/application/language/italian/gridsquares_lang.php index ae5e2867..cecb256c 100644 --- a/application/language/italian/gridsquares_lang.php +++ b/application/language/italian/gridsquares_lang.php @@ -22,6 +22,8 @@ $lang['gridsquares_button_plot'] = 'Plot'; $lang['gridsquares_gridsquares'] = 'Gridsquares'; $lang['gridsquares_gridsquares_confirmed'] = 'Gridsquares confirmed'; +$lang['gridsquares_gridsquares_lotw'] = 'Gridsquares confirmed on LoTW'; +$lang['gridsquares_gridsquares_paper'] = 'Gridsquares confirmed by paper QSL'; $lang['gridsquares_gridsquares_not_confirmed'] = 'Gridsquares not confirmed'; $lang['gridsquares_gridsquares_total_worked'] = 'Total gridsquares worked'; -$lang['gridsquares_gridsquares_total_activated'] = 'Total gridsquares activated'; \ No newline at end of file +$lang['gridsquares_gridsquares_total_activated'] = 'Total gridsquares activated'; diff --git a/application/language/italian/menu_lang.php b/application/language/italian/menu_lang.php index 4d6acd63..52a06af3 100644 --- a/application/language/italian/menu_lang.php +++ b/application/language/italian/menu_lang.php @@ -42,6 +42,7 @@ $lang['menu_pota'] = 'POTA'; $lang['menu_sig'] = 'SIG'; $lang['menu_sota'] = 'SOTA'; $lang['menu_us_counties'] = 'US Counties'; +$lang['menu_us_gridmaster'] = 'US Gridmaster'; $lang['menu_vucc'] = 'VUCC'; $lang['menu_was'] = 'WAS'; $lang['menu_wwff'] = 'WWFF'; diff --git a/application/language/polish/gridsquares_lang.php b/application/language/polish/gridsquares_lang.php index ae5e2867..cecb256c 100644 --- a/application/language/polish/gridsquares_lang.php +++ b/application/language/polish/gridsquares_lang.php @@ -22,6 +22,8 @@ $lang['gridsquares_button_plot'] = 'Plot'; $lang['gridsquares_gridsquares'] = 'Gridsquares'; $lang['gridsquares_gridsquares_confirmed'] = 'Gridsquares confirmed'; +$lang['gridsquares_gridsquares_lotw'] = 'Gridsquares confirmed on LoTW'; +$lang['gridsquares_gridsquares_paper'] = 'Gridsquares confirmed by paper QSL'; $lang['gridsquares_gridsquares_not_confirmed'] = 'Gridsquares not confirmed'; $lang['gridsquares_gridsquares_total_worked'] = 'Total gridsquares worked'; -$lang['gridsquares_gridsquares_total_activated'] = 'Total gridsquares activated'; \ No newline at end of file +$lang['gridsquares_gridsquares_total_activated'] = 'Total gridsquares activated'; diff --git a/application/language/polish/menu_lang.php b/application/language/polish/menu_lang.php index 4d6acd63..52a06af3 100644 --- a/application/language/polish/menu_lang.php +++ b/application/language/polish/menu_lang.php @@ -42,6 +42,7 @@ $lang['menu_pota'] = 'POTA'; $lang['menu_sig'] = 'SIG'; $lang['menu_sota'] = 'SOTA'; $lang['menu_us_counties'] = 'US Counties'; +$lang['menu_us_gridmaster'] = 'US Gridmaster'; $lang['menu_vucc'] = 'VUCC'; $lang['menu_was'] = 'WAS'; $lang['menu_wwff'] = 'WWFF'; diff --git a/application/language/russian/gridsquares_lang.php b/application/language/russian/gridsquares_lang.php index 224dca7f..3f7ccdd2 100644 --- a/application/language/russian/gridsquares_lang.php +++ b/application/language/russian/gridsquares_lang.php @@ -22,6 +22,8 @@ $lang['gridsquares_button_plot'] = 'Отобразить'; $lang['gridsquares_gridsquares'] = 'Квадраты'; $lang['gridsquares_gridsquares_confirmed'] = 'Подтверждёно квадратов'; +$lang['gridsquares_gridsquares_lotw'] = 'Gridsquares confirmed on LoTW'; +$lang['gridsquares_gridsquares_paper'] = 'Gridsquares confirmed by paper QSL'; $lang['gridsquares_gridsquares_not_confirmed'] = 'Неподтверждёно квадратов'; $lang['gridsquares_gridsquares_total_worked'] = 'Всего сработано квадратов'; -$lang['gridsquares_gridsquares_total_activated'] = 'Total gridsquares activated'; \ No newline at end of file +$lang['gridsquares_gridsquares_total_activated'] = 'Total gridsquares activated'; diff --git a/application/language/russian/menu_lang.php b/application/language/russian/menu_lang.php index ecae3659..f8758a76 100644 --- a/application/language/russian/menu_lang.php +++ b/application/language/russian/menu_lang.php @@ -42,6 +42,7 @@ $lang['menu_pota'] = 'POTA'; $lang['menu_sig'] = 'SIG'; $lang['menu_sota'] = 'SOTA'; $lang['menu_us_counties'] = 'US Counties'; +$lang['menu_us_gridmaster'] = 'US Gridmaster'; $lang['menu_vucc'] = 'VUCC'; $lang['menu_was'] = 'WAS'; $lang['menu_wwff'] = 'WWFF'; diff --git a/application/language/spanish/gridsquares_lang.php b/application/language/spanish/gridsquares_lang.php index ae5e2867..cecb256c 100644 --- a/application/language/spanish/gridsquares_lang.php +++ b/application/language/spanish/gridsquares_lang.php @@ -22,6 +22,8 @@ $lang['gridsquares_button_plot'] = 'Plot'; $lang['gridsquares_gridsquares'] = 'Gridsquares'; $lang['gridsquares_gridsquares_confirmed'] = 'Gridsquares confirmed'; +$lang['gridsquares_gridsquares_lotw'] = 'Gridsquares confirmed on LoTW'; +$lang['gridsquares_gridsquares_paper'] = 'Gridsquares confirmed by paper QSL'; $lang['gridsquares_gridsquares_not_confirmed'] = 'Gridsquares not confirmed'; $lang['gridsquares_gridsquares_total_worked'] = 'Total gridsquares worked'; -$lang['gridsquares_gridsquares_total_activated'] = 'Total gridsquares activated'; \ No newline at end of file +$lang['gridsquares_gridsquares_total_activated'] = 'Total gridsquares activated'; diff --git a/application/language/spanish/menu_lang.php b/application/language/spanish/menu_lang.php index 4d6acd63..52a06af3 100644 --- a/application/language/spanish/menu_lang.php +++ b/application/language/spanish/menu_lang.php @@ -42,6 +42,7 @@ $lang['menu_pota'] = 'POTA'; $lang['menu_sig'] = 'SIG'; $lang['menu_sota'] = 'SOTA'; $lang['menu_us_counties'] = 'US Counties'; +$lang['menu_us_gridmaster'] = 'US Gridmaster'; $lang['menu_vucc'] = 'VUCC'; $lang['menu_was'] = 'WAS'; $lang['menu_wwff'] = 'WWFF'; diff --git a/application/language/swedish/gridsquares_lang.php b/application/language/swedish/gridsquares_lang.php index 48e8bdee..32b06bd0 100644 --- a/application/language/swedish/gridsquares_lang.php +++ b/application/language/swedish/gridsquares_lang.php @@ -22,6 +22,8 @@ $lang['gridsquares_button_plot'] = 'Plot'; $lang['gridsquares_gridsquares'] = 'Gridsquares'; $lang['gridsquares_gridsquares_confirmed'] = 'Gridsquares bekräftad'; +$lang['gridsquares_gridsquares_lotw'] = 'Gridsquares confirmed on LoTW'; +$lang['gridsquares_gridsquares_paper'] = 'Gridsquares confirmed by paper QSL'; $lang['gridsquares_gridsquares_not_confirmed'] = 'Gridsquares inte bekräftat'; $lang['gridsquares_gridsquares_total_worked'] = 'Totala gridsquares arbetade'; -$lang['gridsquares_gridsquares_total_activated'] = 'Total gridsquares activated'; \ No newline at end of file +$lang['gridsquares_gridsquares_total_activated'] = 'Total gridsquares activated'; diff --git a/application/language/swedish/menu_lang.php b/application/language/swedish/menu_lang.php index dba3fe04..e7b0ca27 100644 --- a/application/language/swedish/menu_lang.php +++ b/application/language/swedish/menu_lang.php @@ -42,6 +42,7 @@ $lang['menu_pota'] = 'POTA'; $lang['menu_sig'] = 'SIG'; $lang['menu_sota'] = 'SOTA'; $lang['menu_us_counties'] = 'USA:s grevskap'; +$lang['menu_us_gridmaster'] = 'US Gridmaster'; $lang['menu_vucc'] = 'VUCC'; $lang['menu_was'] = 'WAS'; $lang['menu_wwff'] = 'WWFF'; diff --git a/application/language/turkish/gridsquares_lang.php b/application/language/turkish/gridsquares_lang.php index ae5e2867..cecb256c 100644 --- a/application/language/turkish/gridsquares_lang.php +++ b/application/language/turkish/gridsquares_lang.php @@ -22,6 +22,8 @@ $lang['gridsquares_button_plot'] = 'Plot'; $lang['gridsquares_gridsquares'] = 'Gridsquares'; $lang['gridsquares_gridsquares_confirmed'] = 'Gridsquares confirmed'; +$lang['gridsquares_gridsquares_lotw'] = 'Gridsquares confirmed on LoTW'; +$lang['gridsquares_gridsquares_paper'] = 'Gridsquares confirmed by paper QSL'; $lang['gridsquares_gridsquares_not_confirmed'] = 'Gridsquares not confirmed'; $lang['gridsquares_gridsquares_total_worked'] = 'Total gridsquares worked'; -$lang['gridsquares_gridsquares_total_activated'] = 'Total gridsquares activated'; \ No newline at end of file +$lang['gridsquares_gridsquares_total_activated'] = 'Total gridsquares activated'; diff --git a/application/language/turkish/menu_lang.php b/application/language/turkish/menu_lang.php index 4d6acd63..52a06af3 100644 --- a/application/language/turkish/menu_lang.php +++ b/application/language/turkish/menu_lang.php @@ -42,6 +42,7 @@ $lang['menu_pota'] = 'POTA'; $lang['menu_sig'] = 'SIG'; $lang['menu_sota'] = 'SOTA'; $lang['menu_us_counties'] = 'US Counties'; +$lang['menu_us_gridmaster'] = 'US Gridmaster'; $lang['menu_vucc'] = 'VUCC'; $lang['menu_was'] = 'WAS'; $lang['menu_wwff'] = 'WWFF'; diff --git a/application/models/Gridmaster_model.php b/application/models/Gridmaster_model.php new file mode 100644 index 00000000..868c7b44 --- /dev/null +++ b/application/models/Gridmaster_model.php @@ -0,0 +1,189 @@ +load->model('logbooks_model'); + $logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); + + if (!$logbooks_locations_array) { + return null; + } + $location_list = "'".implode("','",$logbooks_locations_array)."'"; + + $sql = 'SELECT distinct substring(COL_GRIDSQUARE,1,4) as GRID_SQUARES FROM ' + .$this->config->item('table_name') + .' WHERE station_id in ('.$location_list.')' + ." and COL_LOTW_QSL_RCVD = 'Y'" + ." and COL_PROP_MODE = 'SAT'" + .' AND substring(COL_GRIDSQUARE,1,4) in (\''.implode('\',\'', $this->us_grids).'\')'; + return $this->db->query($sql); + } + + function get_paper() { + $CI =& get_instance(); + $CI->load->model('logbooks_model'); + $logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); + + if (!$logbooks_locations_array) { + return null; + } + $location_list = "'".implode("','",$logbooks_locations_array)."'"; + + $sql = 'SELECT distinct substring(COL_GRIDSQUARE,1,4) as GRID_SQUARES FROM ' + .$this->config->item('table_name') + .' WHERE station_id in ('.$location_list.')' + ." and COL_QSL_RCVD = 'Y'" + ." and COL_PROP_MODE = 'SAT'" + .' AND substring(COL_GRIDSQUARE,1,4) in (\''.implode('\',\'', $this->us_grids).'\')'; + return $this->db->query($sql); + } + + function get_worked() { + $CI =& get_instance(); + $CI->load->model('logbooks_model'); + $logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); + + if (!$logbooks_locations_array) { + return null; + } + $location_list = "'".implode("','",$logbooks_locations_array)."'"; + + $sql = 'SELECT distinct substring(COL_GRIDSQUARE,1,4) as GRID_SQUARES FROM ' + .$this->config->item('table_name') + .' WHERE station_id in ('.$location_list.')' + ." and COL_PROP_MODE = 'SAT'" + .' AND substring(COL_GRIDSQUARE,1,4) in (\''.implode('\',\'', $this->us_grids).'\')'; + return $this->db->query($sql); + } + + function get_vucc_lotw() { + $CI =& get_instance(); + $CI->load->model('logbooks_model'); + $logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); + + if (!$logbooks_locations_array) { + return null; + } + $location_list = "'".implode("','",$logbooks_locations_array)."'"; + + $sql = 'SELECT distinct COL_VUCC_GRIDS as VUCC_GRIDS FROM ' + .$this->config->item('table_name') + .' WHERE station_id in ('.$location_list.')' + ." and COL_LOTW_QSL_RCVD = 'Y'" + ." and COL_VUCC_GRIDS != ''" + ." and COL_VUCC_GRIDS IS NOT NULL" + ." and COL_PROP_MODE = 'SAT'"; + $query = $this->db->query($sql); + $vucc_grids = []; + foreach ($query->result() as $row) { + $grids = explode(',', $row->VUCC_GRIDS); + foreach ($grids as $grid) { + if (in_array(substr($grid, 0, 4), $this->us_grids)) { + if (!in_array(substr($grid, 0, 4), $vucc_grids)) { + $vucc_grids[] = substr($grid, 0, 4); + } + } + } + } + return $vucc_grids; + } + + function get_vucc_paper() { + $CI =& get_instance(); + $CI->load->model('logbooks_model'); + $logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); + + if (!$logbooks_locations_array) { + return null; + } + $location_list = "'".implode("','",$logbooks_locations_array)."'"; + + $sql = 'SELECT distinct COL_VUCC_GRIDS as VUCC_GRIDS FROM ' + .$this->config->item('table_name') + .' WHERE station_id in ('.$location_list.')' + ." and COL_QSL_RCVD = 'Y'" + ." and COL_VUCC_GRIDS != ''" + ." and COL_VUCC_GRIDS IS NOT NULL" + ." and COL_PROP_MODE = 'SAT'"; + $query = $this->db->query($sql); + $vucc_grids = []; + foreach ($query->result() as $row) { + $grids = explode(',', $row->VUCC_GRIDS); + foreach ($grids as $grid) { + if (in_array(substr($grid, 0, 4), $this->us_grids)) { + if (!in_array(substr($grid, 0, 4), $vucc_grids)) { + $vucc_grids[] = substr($grid, 0, 4); + } + } + } + } + return $vucc_grids; + } + + function get_vucc_worked() { + $CI =& get_instance(); + $CI->load->model('logbooks_model'); + $logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); + + if (!$logbooks_locations_array) { + return null; + } + $location_list = "'".implode("','",$logbooks_locations_array)."'"; + + $sql = 'SELECT distinct COL_VUCC_GRIDS as VUCC_GRIDS FROM ' + .$this->config->item('table_name') + .' WHERE station_id in ('.$location_list.')' + ." and COL_VUCC_GRIDS != ''" + ." and COL_VUCC_GRIDS IS NOT NULL" + ." and COL_PROP_MODE = 'SAT'"; + $query = $this->db->query($sql); + $vucc_grids = []; + foreach ($query->result() as $row) { + $grids = explode(',', $row->VUCC_GRIDS); + foreach ($grids as $grid) { + if (in_array(substr($grid, 0, 4), $this->us_grids)) { + if (!in_array(substr($grid, 0, 4), $vucc_grids)) { + $vucc_grids[] = substr($grid, 0, 4); + } + } + } + } + return $vucc_grids; + } + +} diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index cff40679..d0917603 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -420,14 +420,17 @@ class Logbook_model extends CI_Model { $this->db->where($sql); } - if ($mode != 'All') { + if ($mode != 'All' && $mode != '') { $this->db->where("(COL_MODE='" . $mode . "' OR COL_SUBMODE='" . $mode ."')"); } $this->db->order_by("COL_TIME_ON", "desc"); $this->db->limit(500); - return $this->db->get($this->config->item('table_name')); + $result = $this->db->get($this->config->item('table_name')); + log_message('debug', 'SQL: '.$this->db->last_query()); + return $result; + //return $this->db->get($this->config->item('table_name')); } public function activated_grids_qso_details($searchphrase, $band, $mode){ diff --git a/application/views/awards/gridmaster/index.php b/application/views/awards/gridmaster/index.php new file mode 100644 index 00000000..6caed124 --- /dev/null +++ b/application/views/awards/gridmaster/index.php @@ -0,0 +1,84 @@ + + + +