2022-10-05 14:15:29 +00:00
|
|
|
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
|
|
|
|
|
|
|
|
/*
|
|
|
|
Path: application\controllers\Welcome.php
|
|
|
|
|
|
|
|
Displays the welcome to Cloudlog version 2.0 view to help users with migration from version 1.0
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
class Welcome extends CI_Controller {
|
|
|
|
|
|
|
|
public function index()
|
|
|
|
{
|
|
|
|
$data['page_title'] = "Welcome to Cloudlog Version 2.0";
|
|
|
|
|
2022-10-09 15:46:37 +00:00
|
|
|
// load stations model
|
|
|
|
$this->load->model('stations');
|
|
|
|
$data['CountAllStationLocations'] = $this->stations->CountAllStationLocations();
|
2022-10-09 15:47:23 +00:00
|
|
|
|
|
|
|
// load logbooks model
|
2022-10-09 15:46:37 +00:00
|
|
|
$this->load->model('logbooks_model');
|
|
|
|
$data['NumberOfStationLogbooks'] = $this->logbooks_model->CountAllStationLogbooks();
|
|
|
|
|
2022-10-09 15:47:23 +00:00
|
|
|
// load views
|
2022-10-09 16:01:05 +00:00
|
|
|
$this->load->view('interface_assets/mini_header', $data);
|
2022-10-05 14:15:29 +00:00
|
|
|
$this->load->view('welcome/index');
|
|
|
|
$this->load->view('interface_assets/footer');
|
|
|
|
}
|
2022-10-09 13:55:46 +00:00
|
|
|
|
|
|
|
public function locationsclaim() {
|
|
|
|
try {
|
|
|
|
// load model Stations and call function ClaimAllStationLocations
|
|
|
|
$this->load->model('stations');
|
|
|
|
$this->stations->ClaimAllStationLocations();
|
|
|
|
|
|
|
|
echo "All Station Locations Claimed";
|
|
|
|
} catch (Exception $e) {
|
|
|
|
log_message('error', 'Error Claiming Station Locations during Migration. '.$e->getMessage());
|
|
|
|
echo "Error Claiming Station Locations during Migration. See Logs for further information";
|
|
|
|
}
|
|
|
|
}
|
2022-10-09 15:46:37 +00:00
|
|
|
|
|
|
|
public function defaultlogbook() {
|
|
|
|
try {
|
|
|
|
// load model Stations and call function ClaimAllStationLocations
|
|
|
|
$this->load->model('logbooks_model');
|
|
|
|
$this->logbooks_model->CreateDefaultLogbook();
|
|
|
|
|
|
|
|
echo "Default Logbook Created";
|
|
|
|
} catch (Exception $e) {
|
|
|
|
log_message('error', 'Error Creating Default Logbook during Migration. '.$e->getMessage());
|
|
|
|
echo "Error Creating Default Logbook during Migration. See Logs for further information";
|
|
|
|
}
|
|
|
|
}
|
2022-10-05 14:15:29 +00:00
|
|
|
}
|