Cloudlog/application/controllers/Welcome.php

55 wiersze
1.9 KiB
PHP
Czysty Zwykły widok Historia

<?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";
// load stations model
$this->load->model('stations');
$data['CountAllStationLocations'] = $this->stations->CountAllStationLocations();
2022-10-09 15:47:23 +00:00
// load logbooks model
$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);
$this->load->view('welcome/index');
$this->load->view('interface_assets/footer');
}
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";
}
}
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";
}
}
}