73 lines
2.1 KiB
PHP
73 lines
2.1 KiB
PHP
<?php
|
|
|
|
namespace App\Controllers;
|
|
|
|
use CodeIgniter\Controller;
|
|
use CodeIgniter\HTTP\CLIRequest;
|
|
use CodeIgniter\HTTP\IncomingRequest;
|
|
use CodeIgniter\HTTP\RequestInterface;
|
|
use CodeIgniter\HTTP\ResponseInterface;
|
|
use Psr\Log\LoggerInterface;
|
|
|
|
/**
|
|
* Class BaseController
|
|
*
|
|
* BaseController provides a convenient place for loading components
|
|
* and performing functions that are needed by all your controllers.
|
|
* Extend this class in any new controllers:
|
|
* class Home extends BaseController
|
|
*
|
|
* For security be sure to declare any new methods as protected or private.
|
|
*/
|
|
abstract class SecureBaseController extends CoreController
|
|
{
|
|
|
|
public $data = array();
|
|
|
|
public function getSessionArray() {
|
|
$data["current_date"] = date('l jS \of F Y h:i:s A');
|
|
|
|
return $data;
|
|
}
|
|
|
|
private function refreshAccountDetail($member_id) {
|
|
|
|
}
|
|
|
|
protected function providerSecurePage($page_name, $data):string {
|
|
|
|
// you dont have bussines here if you are not in session
|
|
/* if (!isset($_SESSION['session_id']) or ! isset($_SESSION['username']) or $_SESSION['username'] == '') {
|
|
// redirect(logout);
|
|
return redirect()->to('/logout');
|
|
}
|
|
*/
|
|
// echo 'ameye 001';
|
|
// return view('template/provider_page');
|
|
|
|
return
|
|
view('provider/' . $page_name, $data);
|
|
}
|
|
|
|
protected function renderProviderSecurePage($page_name, $data):string {
|
|
|
|
// you dont have bussines here if you are not in session
|
|
/* if (!isset($_SESSION['session_id']) or ! isset($_SESSION['username']) or $_SESSION['username'] == '') {
|
|
// redirect(logout);
|
|
return redirect()->to('/logout');
|
|
}
|
|
*/
|
|
// echo 'ameye 001';
|
|
// return view('template/provider_page');
|
|
|
|
return view('template/provider_header', $data).
|
|
view('provider/' . $page_name, $data).
|
|
view('template/provider_footer', $data);
|
|
}
|
|
protected function renderExternalPage($page_name, $data):string {
|
|
return view('template/header', $data).
|
|
view('' . $page_name, $data).
|
|
view('template/footer', $data);
|
|
}
|
|
}
|