[Dashboard] Nothing exciting just formatted the code

This commit is contained in:
Peter Goodhall 2024-02-17 17:06:33 +00:00
parent e64f842b84
commit f16a2716d8

View File

@ -1,13 +1,14 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
class Dashboard extends CI_Controller {
class Dashboard extends CI_Controller
{
public function index()
{
// If environment is set to development then show the debug toolbar
if(ENVIRONMENT == 'development') {
$this->output->enable_profiler(TRUE);
}
if (ENVIRONMENT == 'development') {
$this->output->enable_profiler(TRUE);
}
// Load language files
$this->lang->load('lotw');
@ -19,13 +20,13 @@ class Dashboard extends CI_Controller {
// LoTW infos
$this->load->model('LotwCert');
if($this->optionslib->get_option('version2_trigger') == "false") {
if ($this->optionslib->get_option('version2_trigger') == "false") {
redirect('welcome');
}
// Check if users logged in
if($this->user_model->validate_session() == 0) {
if ($this->user_model->validate_session() == 0) {
// user is not logged in
redirect('user/login');
}
@ -34,19 +35,19 @@ class Dashboard extends CI_Controller {
$logbooks_locations_array = $this->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
// Calculate Lat/Lng from Locator to use on Maps
if($this->session->userdata('user_locator')) {
$this->load->library('qra');
if ($this->session->userdata('user_locator')) {
$this->load->library('qra');
$qra_position = $this->qra->qra2latlong($this->session->userdata('user_locator'));
if ($qra_position) {
$data['qra'] = "set";
$data['qra_lat'] = $qra_position[0];
$data['qra_lng'] = $qra_position[1];
} else {
$data['qra'] = "none";
}
} else {
$qra_position = $this->qra->qra2latlong($this->session->userdata('user_locator'));
if ($qra_position) {
$data['qra'] = "set";
$data['qra_lat'] = $qra_position[0];
$data['qra_lng'] = $qra_position[1];
} else {
$data['qra'] = "none";
}
} else {
$data['qra'] = "none";
}
$this->load->model('stations');
@ -60,7 +61,7 @@ class Dashboard extends CI_Controller {
$setup_required = false;
if($setup_required) {
if ($setup_required) {
$data['page_title'] = "Cloudlog Setup Checklist";
$this->load->view('interface_assets/header', $data);
@ -88,7 +89,7 @@ class Dashboard extends CI_Controller {
$data['total_countries_confirmed_eqsl'] = $CountriesBreakdown['Countries_Worked_EQSL'];
$data['total_countries_confirmed_lotw'] = $CountriesBreakdown['Countries_Worked_LOTW'];
$QSLStatsBreakdownArray =$this->logbook_model->get_QSLStats($logbooks_locations_array);
$QSLStatsBreakdownArray = $this->logbook_model->get_QSLStats($logbooks_locations_array);
$data['total_qsl_sent'] = $QSLStatsBreakdownArray['QSL_Sent'];
$data['total_qsl_rcvd'] = $QSLStatsBreakdownArray['QSL_Received'];
@ -130,15 +131,13 @@ class Dashboard extends CI_Controller {
$this->load->view('dashboard/index');
$this->load->view('interface_assets/footer');
}
}
function radio_display_component() {
function radio_display_component()
{
$this->load->model('cat');
$data['radio_status'] = $this->cat->recent_status();
$this->load->view('components/radio_display_table', $data);
}
}
}