229 lines
6.6 KiB
PHP
229 lines
6.6 KiB
PHP
<?php
|
|
|
|
namespace App\Controllers;
|
|
|
|
//$session = \Config\Services::session();
|
|
class Projects extends BaseController
|
|
{
|
|
protected $session;
|
|
function __construct()
|
|
{
|
|
$this->session = \Config\Services::session();
|
|
$this->session->start();
|
|
}
|
|
public function index()
|
|
{
|
|
return view('projects/index');
|
|
}
|
|
|
|
public function start()
|
|
{
|
|
$request = \Config\Services::request();
|
|
log_message('critical', "Projects-Entered 0" );
|
|
|
|
if ($request->getMethod() == 'post') {
|
|
log_message('critical', "Projects-Entered 1" );
|
|
$out = [];
|
|
$username = trim($request->getPost('email'));
|
|
$password = trim($request->getPost('password'));
|
|
log_message('critical', "Projects-Entered 1 username->".$username );
|
|
log_message('critical', "Projects-Entered 1 password->".$password );
|
|
if ($this->loginUser($username, $password, $out) == true) {
|
|
log_message('critical', "Projects-Entered 2" );
|
|
$segments = ['/projects/dash'];
|
|
return redirect()->to(site_url($segments));
|
|
}
|
|
} else {
|
|
return view('welcome_message');
|
|
}
|
|
|
|
return view('projects/index');
|
|
}
|
|
|
|
private function loginUser($username, $password, &$out)
|
|
{
|
|
$projData = new \App\Models\projectData();
|
|
|
|
$loginComplete = false;
|
|
//entries sent
|
|
if ($username == '' || $password == '') {
|
|
$loginComplete = false;
|
|
$out['error'] = 'All parameters required';
|
|
}
|
|
if ($username == 'support@chiefsoft.com' && $password == '12345678') {
|
|
$loginComplete = true;
|
|
$out['username'] = 'ameye@chiefsoft.com';
|
|
$out['firstname'] = 'Olusesan';
|
|
$out['lastname'] = 'Ameye';
|
|
$out['uid'] = 'gdgdgdgd-dhdhshdh-gshshshhs-hdhdhuu';
|
|
$out['id'] = '100';
|
|
// $_SESSION['bko_session'] = rand(10000,9999999).'-hhdsdyuyu487484398439843jjhjfhjfdhjfdhjfdhj89498498598jfjfhjf';
|
|
// $_SESSION['bko_user'] = $out;
|
|
|
|
$this->session->set([
|
|
'bko_user' => $out,
|
|
'bko_session' => rand(10000,9999999).'-hhdsdyuyu487484398439843jjhjfhjfdhjfdhjfdhj89498498598jfjfhjf',
|
|
'lastName'=> $out['lastname'],
|
|
'firstName'=> $out['firstname'],
|
|
'username'=> $out['username'],
|
|
'project_list' => $projData->projectList(),
|
|
'project_list_detail' => $projData->projectListDetails(),
|
|
'devop_list' => $this->devOpList(),
|
|
'project_document' => $projData->documentList()
|
|
]);
|
|
}
|
|
|
|
return $loginComplete;
|
|
}
|
|
|
|
private function projectList(){
|
|
$data =[
|
|
'myfit'=>[
|
|
'name' => 'myFit A.I',
|
|
'description' => 'This is the description of the project',
|
|
'banner_image' => 'project_banner.jpg',
|
|
'product_url' => 'www.chiefsoft.com',
|
|
],
|
|
'wrenchboard'=>[
|
|
'name' => 'WrenchBoard',
|
|
'description' => 'This is the description of the project',
|
|
'banner_image' => 'project_banner.jpg',
|
|
'product_url' => 'www.chiefsoft.com',
|
|
],
|
|
'coregrade'=>[
|
|
'name' => 'CoreGrade',
|
|
'description' => 'This is the description of the project',
|
|
'banner_image' => 'project_banner.jpg',
|
|
'product_url' => 'www.chiefsoft.com',
|
|
],
|
|
'float'=>[
|
|
'name' => 'Float (New)',
|
|
'description' => 'This is the description of the project',
|
|
'banner_image' => 'project_banner.jpg',
|
|
'product_url' => 'www.chiefsoft.com',
|
|
],
|
|
'legacyfloat'=>[
|
|
'name' => 'Float (Legacy)',
|
|
'description' => 'This is the description of the project',
|
|
'banner_image' => 'project_banner.jpg',
|
|
'product_url' => 'www.chiefsoft.com',
|
|
],
|
|
'kintcare'=>[
|
|
'name' => 'KintCare',
|
|
'description' => 'This is the description of the project',
|
|
'banner_image' => 'project_banner.jpg',
|
|
'product_url' => 'www.chiefsoft.com',
|
|
],
|
|
'merms'=>[
|
|
'name' => 'Merms EMR',
|
|
'description' => 'This is the description of the project',
|
|
'banner_image' => 'project_banner.jpg',
|
|
'product_url' => 'www.chiefsoft.com',
|
|
],
|
|
'chiefsoft'=>[
|
|
'name' => 'ChiefSoft',
|
|
'description' => 'This is the description of the project',
|
|
'banner_image' => 'project_banner.jpg',
|
|
'product_url' => 'www.chiefsoft.com',
|
|
],
|
|
'jubabox'=>[
|
|
'name' => 'JubaBox',
|
|
'description' => 'This is the description of the project',
|
|
'banner_image' => 'project_banner.jpg',
|
|
'product_url' => 'www.chiefsoft.com',
|
|
],
|
|
];
|
|
return $data;
|
|
}
|
|
private function projectListDetails(){
|
|
$data =[
|
|
'chiefsoft'=>[
|
|
'DEV'=>[
|
|
|
|
],
|
|
'LIVE'=>[
|
|
|
|
]
|
|
],
|
|
'myfit'=>[
|
|
'DEV'=>[
|
|
|
|
],
|
|
'LIVE'=>[
|
|
|
|
]
|
|
],
|
|
'wrenchboard'=>[
|
|
'DEV'=>[
|
|
|
|
],
|
|
'LIVE'=>[
|
|
|
|
]
|
|
],
|
|
'coregrade'=>[
|
|
'DEV'=>[
|
|
|
|
],
|
|
'LIVE'=>[
|
|
|
|
]
|
|
],
|
|
'float'=>[
|
|
'DEV'=>[
|
|
|
|
],
|
|
'LIVE'=>[
|
|
|
|
]
|
|
],
|
|
];
|
|
return $data;
|
|
}
|
|
private function devOpList(){
|
|
$data =[
|
|
'chiefsoft'=>[
|
|
'DEV'=>[
|
|
|
|
],
|
|
'LIVE'=>[
|
|
|
|
]
|
|
],
|
|
'myfit'=>[
|
|
'DEV'=>[
|
|
|
|
],
|
|
'LIVE'=>[
|
|
|
|
]
|
|
],
|
|
'wrenchboard'=>[
|
|
'DEV'=>[
|
|
|
|
],
|
|
'LIVE'=>[
|
|
|
|
]
|
|
],
|
|
'coregrade'=>[
|
|
'DEV'=>[
|
|
|
|
],
|
|
'LIVE'=>[
|
|
|
|
]
|
|
],
|
|
'float'=>[
|
|
'DEV'=>[
|
|
|
|
],
|
|
'LIVE'=>[
|
|
|
|
]
|
|
],
|
|
];
|
|
return $data;
|
|
}
|
|
}
|