diff --git a/application/controllers/Dashboard.php b/application/controllers/Dashboard.php index 8c5ae246..6f4f1b36 100644 --- a/application/controllers/Dashboard.php +++ b/application/controllers/Dashboard.php @@ -29,7 +29,7 @@ class Dashboard extends CI_Controller { // user is not logged in redirect('user/login'); } - + $this->load->model('logbooks_model'); $logbooks_locations_array = $this->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); @@ -41,15 +41,21 @@ class Dashboard extends CI_Controller { if ($qra_position) { $data['qra'] = "set"; $data['qra_lat'] = $qra_position[0]; - $data['qra_lng'] = $qra_position[1]; + $data['qra_lng'] = $qra_position[1]; } else { $data['qra'] = "none"; } } else { $data['qra'] = "none"; } - + $this->load->model('stations'); + $this->load->model('setup_model'); + + $data['countryCount'] = $this->setup_model->getCountryCount(); + $data['logbookCount'] = $this->setup_model->getLogbookCount(); + $data['locationCount'] = $this->setup_model->getLocationCount(); + $data['current_active'] = $this->stations->find_active(); $setup_required = false; @@ -62,7 +68,7 @@ class Dashboard extends CI_Controller { $this->load->view('interface_assets/footer'); } else { - // + // $this->load->model('cat'); $this->load->model('vucc'); @@ -120,7 +126,7 @@ class Dashboard extends CI_Controller { } } - + function radio_display_component() { $this->load->model('cat'); @@ -130,7 +136,7 @@ class Dashboard extends CI_Controller { function map() { $this->load->model('logbook_model'); - + $this->load->library('qra'); $qsos = $this->logbook_model->get_last_qsos('18'); @@ -145,7 +151,7 @@ class Dashboard extends CI_Controller { echo ","; } - if($row->COL_SAT_NAME != null) { + if($row->COL_SAT_NAME != null) { echo "{\"lat\":\"".$stn_loc[0]."\",\"lng\":\"".$stn_loc[1]."\", \"html\":\"Callsign: ".$row->COL_CALL."
Date/Time: ".$row->COL_TIME_ON."
SAT: ".$row->COL_SAT_NAME."
Mode: "; echo $row->COL_SUBMODE==null?$row->COL_MODE:$row->COL_SUBMODE; echo "\",\"label\":\"".$row->COL_CALL."\"}"; @@ -162,10 +168,10 @@ class Dashboard extends CI_Controller { if (count($grids) == 2) { $grid1 = $this->qra->qra2latlong(trim($grids[0])); $grid2 = $this->qra->qra2latlong(trim($grids[1])); - + $coords[]=array('lat' => $grid1[0],'lng'=> $grid1[1]); - $coords[]=array('lat' => $grid2[0],'lng'=> $grid2[1]); - + $coords[]=array('lat' => $grid2[0],'lng'=> $grid2[1]); + $stn_loc = $this->qra->get_midpoint($coords); } if (count($grids) == 4) { @@ -173,20 +179,20 @@ class Dashboard extends CI_Controller { $grid2 = $this->qra->qra2latlong(trim($grids[1])); $grid3 = $this->qra->qra2latlong(trim($grids[2])); $grid4 = $this->qra->qra2latlong(trim($grids[3])); - + $coords[]=array('lat' => $grid1[0],'lng'=> $grid1[1]); - $coords[]=array('lat' => $grid2[0],'lng'=> $grid2[1]); - $coords[]=array('lat' => $grid3[0],'lng'=> $grid3[1]); - $coords[]=array('lat' => $grid4[0],'lng'=> $grid4[1]); - + $coords[]=array('lat' => $grid2[0],'lng'=> $grid2[1]); + $coords[]=array('lat' => $grid3[0],'lng'=> $grid3[1]); + $coords[]=array('lat' => $grid4[0],'lng'=> $grid4[1]); + $stn_loc = $this->qra->get_midpoint($coords); } if($count != 1) { echo ","; } - - if($row->COL_SAT_NAME != null) { + + if($row->COL_SAT_NAME != null) { echo "{\"lat\":\"".$stn_loc[0]."\",\"lng\":\"".$stn_loc[1]."\", \"html\":\"Callsign: ".$row->COL_CALL."
Date/Time: ".$row->COL_TIME_ON."
SAT: ".$row->COL_SAT_NAME."
Mode: "; echo $row->COL_SUBMODE==null?$row->COL_MODE:$row->COL_SUBMODE; echo "\",\"label\":\"".$row->COL_CALL."\"}"; @@ -195,7 +201,7 @@ class Dashboard extends CI_Controller { echo $row->COL_SUBMODE==null?$row->COL_MODE:$row->COL_SUBMODE; echo "\",\"label\":\"".$row->COL_CALL."\"}"; } - + $count++; } else { if($count != 1) { @@ -218,5 +224,5 @@ class Dashboard extends CI_Controller { } - + } diff --git a/application/language/bulgarian/general_words_lang.php b/application/language/bulgarian/general_words_lang.php index 97987ff3..de44e5f7 100644 --- a/application/language/bulgarian/general_words_lang.php +++ b/application/language/bulgarian/general_words_lang.php @@ -190,3 +190,8 @@ $lang['southamerica'] = 'South America'; $lang['gen_band_selection'] = 'Band selection'; $lang['general_word_today'] = 'Today'; + +$lang['dashboard_php_version_warning'] = 'You need to upgrade your PHP version. Minimum version is 7.4. Your version is'; +$lang['dashboard_country_files_warning'] = 'You need to update country files! Go here to do it!'; +$lang['dashboard_locations_warning'] = 'You have no station locations. Go here to create it!'; +$lang['dashboard_logbooks_warning'] = 'You have no station logbook. Go here to create it!'; diff --git a/application/language/chinese_simplified/general_words_lang.php b/application/language/chinese_simplified/general_words_lang.php index 4c9123f7..5294fddd 100644 --- a/application/language/chinese_simplified/general_words_lang.php +++ b/application/language/chinese_simplified/general_words_lang.php @@ -190,3 +190,8 @@ $lang['southamerica'] = '南美洲'; $lang['gen_band_selection'] = '波段选择'; $lang['general_word_today'] = 'Today'; + +$lang['dashboard_php_version_warning'] = 'You need to upgrade your PHP version. Minimum version is 7.4. Your version is'; +$lang['dashboard_country_files_warning'] = 'You need to update country files! Go here to do it!'; +$lang['dashboard_locations_warning'] = 'You have no station locations. Go here to create it!'; +$lang['dashboard_logbooks_warning'] = 'You have no station logbook. Go here to create it!'; diff --git a/application/language/dutch/general_words_lang.php b/application/language/dutch/general_words_lang.php index 0b52154e..d0f7f6de 100644 --- a/application/language/dutch/general_words_lang.php +++ b/application/language/dutch/general_words_lang.php @@ -190,3 +190,8 @@ $lang['southamerica'] = 'South America'; $lang['gen_band_selection'] = 'Band selection'; $lang['general_word_today'] = 'Today'; + +$lang['dashboard_php_version_warning'] = 'You need to upgrade your PHP version. Minimum version is 7.4. Your version is'; +$lang['dashboard_country_files_warning'] = 'You need to update country files! Go here to do it!'; +$lang['dashboard_locations_warning'] = 'You have no station locations. Go here to create it!'; +$lang['dashboard_logbooks_warning'] = 'You have no station logbook. Go here to create it!'; diff --git a/application/language/english/general_words_lang.php b/application/language/english/general_words_lang.php index 19f6155d..e9ed32c8 100644 --- a/application/language/english/general_words_lang.php +++ b/application/language/english/general_words_lang.php @@ -188,3 +188,8 @@ $lang['southamerica'] = 'South America'; $lang['gen_band_selection'] = 'Band selection'; $lang['general_word_today'] = 'Today'; + +$lang['dashboard_php_version_warning'] = 'You need to upgrade your PHP version. Minimum version is 7.4. Your version is'; +$lang['dashboard_country_files_warning'] = 'You need to update country files! Go here to do it!'; +$lang['dashboard_locations_warning'] = 'You have no station locations. Go here to create it!'; +$lang['dashboard_logbooks_warning'] = 'You have no station logbook. Go here to create it!'; diff --git a/application/language/finnish/general_words_lang.php b/application/language/finnish/general_words_lang.php index 1430d65c..21bd1f0e 100644 --- a/application/language/finnish/general_words_lang.php +++ b/application/language/finnish/general_words_lang.php @@ -190,3 +190,8 @@ $lang['southamerica'] = 'Etelä-Amerikka'; $lang['gen_band_selection'] = 'Bandin valinta'; $lang['general_word_today'] = 'Today'; + +$lang['dashboard_php_version_warning'] = 'You need to upgrade your PHP version. Minimum version is 7.4. Your version is'; +$lang['dashboard_country_files_warning'] = 'You need to update country files! Go here to do it!'; +$lang['dashboard_locations_warning'] = 'You have no station locations. Go here to create it!'; +$lang['dashboard_logbooks_warning'] = 'You have no station logbook. Go here to create it!'; diff --git a/application/language/french/general_words_lang.php b/application/language/french/general_words_lang.php index cefcb7aa..9e5931e8 100644 --- a/application/language/french/general_words_lang.php +++ b/application/language/french/general_words_lang.php @@ -190,3 +190,8 @@ $lang['southamerica'] = 'South America'; $lang['gen_band_selection'] = 'Band selection'; $lang['general_word_today'] = 'Today'; + +$lang['dashboard_php_version_warning'] = 'You need to upgrade your PHP version. Minimum version is 7.4. Your version is'; +$lang['dashboard_country_files_warning'] = 'You need to update country files! Go here to do it!'; +$lang['dashboard_locations_warning'] = 'You have no station locations. Go here to create it!'; +$lang['dashboard_logbooks_warning'] = 'You have no station logbook. Go here to create it!'; diff --git a/application/language/greek/general_words_lang.php b/application/language/greek/general_words_lang.php index a0f6f036..fceaf31f 100644 --- a/application/language/greek/general_words_lang.php +++ b/application/language/greek/general_words_lang.php @@ -190,3 +190,8 @@ $lang['southamerica'] = 'South America'; $lang['gen_band_selection'] = 'Band selection'; $lang['general_word_today'] = 'Today'; + +$lang['dashboard_php_version_warning'] = 'You need to upgrade your PHP version. Minimum version is 7.4. Your version is'; +$lang['dashboard_country_files_warning'] = 'You need to update country files! Go here to do it!'; +$lang['dashboard_locations_warning'] = 'You have no station locations. Go here to create it!'; +$lang['dashboard_logbooks_warning'] = 'You have no station logbook. Go here to create it!'; diff --git a/application/language/italian/general_words_lang.php b/application/language/italian/general_words_lang.php index e6df26f7..c223323c 100644 --- a/application/language/italian/general_words_lang.php +++ b/application/language/italian/general_words_lang.php @@ -190,3 +190,8 @@ $lang['southamerica'] = 'South America'; $lang['gen_band_selection'] = 'Band selection'; $lang['general_word_today'] = 'Today'; + +$lang['dashboard_php_version_warning'] = 'You need to upgrade your PHP version. Minimum version is 7.4. Your version is'; +$lang['dashboard_country_files_warning'] = 'You need to update country files! Go here to do it!'; +$lang['dashboard_locations_warning'] = 'You have no station locations. Go here to create it!'; +$lang['dashboard_logbooks_warning'] = 'You have no station logbook. Go here to create it!'; diff --git a/application/language/russian/general_words_lang.php b/application/language/russian/general_words_lang.php index 65c2bd70..e4b56626 100644 --- a/application/language/russian/general_words_lang.php +++ b/application/language/russian/general_words_lang.php @@ -191,3 +191,8 @@ $lang['southamerica'] = 'Южная Америка'; $lang['gen_band_selection'] = 'Выбор диапазона'; $lang['general_word_today'] = 'Today'; + +$lang['dashboard_php_version_warning'] = 'You need to upgrade your PHP version. Minimum version is 7.4. Your version is'; +$lang['dashboard_country_files_warning'] = 'You need to update country files! Go here to do it!'; +$lang['dashboard_locations_warning'] = 'You have no station locations. Go here to create it!'; +$lang['dashboard_logbooks_warning'] = 'You have no station logbook. Go here to create it!'; diff --git a/application/language/spanish/general_words_lang.php b/application/language/spanish/general_words_lang.php index 169f4734..b3253a6a 100644 --- a/application/language/spanish/general_words_lang.php +++ b/application/language/spanish/general_words_lang.php @@ -190,3 +190,8 @@ $lang['southamerica'] = 'South America'; $lang['gen_band_selection'] = 'Band selection'; $lang['general_word_today'] = 'Today'; + +$lang['dashboard_php_version_warning'] = 'You need to upgrade your PHP version. Minimum version is 7.4. Your version is'; +$lang['dashboard_country_files_warning'] = 'You need to update country files! Go here to do it!'; +$lang['dashboard_locations_warning'] = 'You have no station locations. Go here to create it!'; +$lang['dashboard_logbooks_warning'] = 'You have no station logbook. Go here to create it!'; diff --git a/application/language/swedish/general_words_lang.php b/application/language/swedish/general_words_lang.php index 5efc7004..4202ec6c 100644 --- a/application/language/swedish/general_words_lang.php +++ b/application/language/swedish/general_words_lang.php @@ -1,192 +1,197 @@ -here to do it!'; +$lang['dashboard_locations_warning'] = 'You have no station locations. Go here to create it!'; +$lang['dashboard_logbooks_warning'] = 'You have no station logbook. Go here to create it!'; diff --git a/application/language/turkish/general_words_lang.php b/application/language/turkish/general_words_lang.php index d23b6749..aa1b70f6 100644 --- a/application/language/turkish/general_words_lang.php +++ b/application/language/turkish/general_words_lang.php @@ -190,3 +190,8 @@ $lang['southamerica'] = 'South America'; $lang['gen_band_selection'] = 'Band selection'; $lang['general_word_today'] = 'Today'; + +$lang['dashboard_php_version_warning'] = 'You need to upgrade your PHP version. Minimum version is 7.4. Your version is'; +$lang['dashboard_country_files_warning'] = 'You need to update country files! Go here to do it!'; +$lang['dashboard_locations_warning'] = 'You have no station locations. Go here to create it!'; +$lang['dashboard_logbooks_warning'] = 'You have no station logbook. Go here to create it!'; diff --git a/application/models/Setup_model.php b/application/models/Setup_model.php new file mode 100644 index 00000000..66692014 --- /dev/null +++ b/application/models/Setup_model.php @@ -0,0 +1,29 @@ +db->query($sql); + + return $query->row()->count; + } + + function getLogbookCount() { + $userid = xss_clean($this->session->userdata('user_id')); + $sql = 'select count(*) as count from station_logbooks where user_id =' . $userid; + $query = $this->db->query($sql); + + return $query->row()->count; + } + + function getLocationCount() { + $userid = xss_clean($this->session->userdata('user_id')); + $sql = 'select count(*) as count from station_profile where user_id =' . $userid; + $query = $this->db->query($sql); + + return $query->row()->count; + } +} + +?> diff --git a/application/views/dashboard/index.php b/application/views/dashboard/index.php index 38ad16c9..dc686380 100644 --- a/application/views/dashboard/index.php +++ b/application/views/dashboard/index.php @@ -48,7 +48,31 @@ function echoQrbCalcLink($mygrid, $grid, $vucc) { ?>
config->item('use_auth') && ($this->session->userdata('user_type') >= 2)) || $this->config->item('use_auth') === FALSE) { ?> - + + + + + + + + + + + + + + + + + optionslib->get_option('dashboard_banner') != "false") { ?> = 1) { ?>