From 54dea657ec8e556600ea89c48d13bd16d5675a0f Mon Sep 17 00:00:00 2001 From: Peter Goodhall Date: Tue, 11 Jun 2024 14:50:27 +0100 Subject: [PATCH] Start of the new Setup Welcome code --- application/controllers/Dashboard.php | 10 +++++++ application/controllers/Information.php | 37 +++++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 application/controllers/Information.php diff --git a/application/controllers/Dashboard.php b/application/controllers/Dashboard.php index f20a2874..4cdc91d2 100644 --- a/application/controllers/Dashboard.php +++ b/application/controllers/Dashboard.php @@ -34,6 +34,16 @@ class Dashboard extends CI_Controller $this->load->model('logbooks_model'); $logbooks_locations_array = $this->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); + /* + Setup Code + // Check if the user has any logbook locations if not its setup time + if (empty($logbooks_locations_array)) { + // user has no locations + $this->session->set_flashdata('notice', 'You have no locations, please add one to continue.'); + redirect('information/welcome'); + } + */ + // Calculate Lat/Lng from Locator to use on Maps if ($this->session->userdata('user_locator')) { $this->load->library('qra'); diff --git a/application/controllers/Information.php b/application/controllers/Information.php new file mode 100644 index 00000000..42d4701c --- /dev/null +++ b/application/controllers/Information.php @@ -0,0 +1,37 @@ +load->model('user_model'); + // Make sure users logged in + if ($this->user_model->validate_session() == 0) { + // 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')); + + echo "welcome to cloudlog"; + + // check if user has any station logbooks + + // if user has no logbooks create a General Logbook + + // If logbooks_locations_array is empty + if (empty($logbooks_locations_array)) { + // user has no locations + echo "You have no locations, please add one to continue."; + } + + // Check if they have provided a valid grid locator + + // Check if Callbook information is provided + + // Check country files are present + + // If all is present welcome the user and redirect to the dashboard + } +} \ No newline at end of file