Compare commits
3 Commits
a2c2c5efa5
...
45657aa0b5
| Author | SHA1 | Date | |
|---|---|---|---|
| 45657aa0b5 | |||
| ddbb801480 | |||
| eff90cea50 |
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
class Bkoadmin extends Admin_Controller {
|
||||
|
||||
public function index() {
|
||||
|
||||
$this->load->helper('url');
|
||||
$data = array();
|
||||
|
||||
$this->load->library('table');
|
||||
$this->table->set_template($this->template);
|
||||
|
||||
$mysql = "SELECT '<a href=\"/practice/viewPendingPractice/'||id||'\"><button type=\"button\" class=\"btn btn-warning\"><i class=\"fa fa-check-circle\"></i>View</button></a>' AS View"
|
||||
. ",username,firstname, lastname,email,status,added FROM bko_users ORDER BY username LIMIT 15";
|
||||
|
||||
$data['users_list'] = "";
|
||||
$query = $this->db->query($mysql);
|
||||
$this->table->set_heading(array('data' => 'View', 'style' => 'width:50px'), 'Username', 'Firstname', 'Lastname', 'Email', 'Status', 'Added');
|
||||
$data['users_list'] = $this->table->generate($query);
|
||||
|
||||
$data['page_title'] = "Back Offfice Users";
|
||||
|
||||
$this->renderBkoadminPage('view_users', $data);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -64,46 +64,45 @@ class MCORE_Controller extends CI_Controller {
|
||||
|
||||
/*
|
||||
RET: added=2019-10-01 22:11:40.050111
|
||||
- 20:00:59.180 INFO [11950]: RET: backoffice_id=1
|
||||
- 20:00:59.180 INFO [11950]: RET: email=ses66181@gmail.com
|
||||
- 20:00:59.180 INFO [11950]: RET: firstname=Olusesan
|
||||
- 20:00:59.180 INFO [11950]: RET: id=1
|
||||
- 20:00:59.180 INFO [11950]: RET: lastname=Ameye
|
||||
- 20:00:59.180 INFO [11950]: RET: pass=d0fbea2563b377ea7074bced45c88dcb
|
||||
- 20:00:59.180 INFO [11950]: RET: result=YES I GET TO BACK END
|
||||
- 20:00:59.180 INFO [11950]: RET: sessionid=acabab4686eec2d683d9f7595d4880ba
|
||||
- 20:00:59.180 INFO [11950]: RET: status=1
|
||||
- 20:00:59.180 INFO [11950]: RET: stauts=OK
|
||||
- 20:00:59.180 INFO [11950]: RET: username=oameye
|
||||
*/
|
||||
|
||||
- 20:00:59.180 INFO [11950]: RET: backoffice_id=1
|
||||
- 20:00:59.180 INFO [11950]: RET: email=ses66181@gmail.com
|
||||
- 20:00:59.180 INFO [11950]: RET: firstname=Olusesan
|
||||
- 20:00:59.180 INFO [11950]: RET: id=1
|
||||
- 20:00:59.180 INFO [11950]: RET: lastname=Ameye
|
||||
- 20:00:59.180 INFO [11950]: RET: pass=d0fbea2563b377ea7074bced45c88dcb
|
||||
- 20:00:59.180 INFO [11950]: RET: result=YES I GET TO BACK END
|
||||
- 20:00:59.180 INFO [11950]: RET: sessionid=acabab4686eec2d683d9f7595d4880ba
|
||||
- 20:00:59.180 INFO [11950]: RET: status=1
|
||||
- 20:00:59.180 INFO [11950]: RET: stauts=OK
|
||||
- 20:00:59.180 INFO [11950]: RET: username=oameye
|
||||
*/
|
||||
|
||||
protected function loginAdminUser($data, $out) {
|
||||
|
||||
$data['action'] = MERMSEMR_BKO_LOGIN;
|
||||
// $data['mlog'] = $mlog;
|
||||
// $data['member_id'] = $_SESSION['member_id'];
|
||||
$this->load->model('backend_model');
|
||||
$out = array();
|
||||
$res = $this->backend_model->mermsemr_api($data, $out);
|
||||
|
||||
$data['action'] = MERMSEMR_BKO_LOGIN;
|
||||
// $data['mlog'] = $mlog;
|
||||
// $data['member_id'] = $_SESSION['member_id'];
|
||||
$this->load->model('backend_model');
|
||||
$out = array();
|
||||
$res = $this->backend_model->mermsemr_api($data, $out);
|
||||
//echo $res." -------------------------------------++";
|
||||
$loginReturn = false;
|
||||
$loginReturn = false;
|
||||
|
||||
if ($res == PHP_API_OK && isset($out["sessionid"]) && $out["backoffice_id"] > 0) {
|
||||
$_SESSION['session_id'] = $out['sessionid']; // "";
|
||||
$_SESSION['username'] = $out['username']; // "";
|
||||
$_SESSION['backoffice_id'] = $out['backoffice_id'];
|
||||
$_SESSION['user_firstname'] = $out['firstname'];
|
||||
$_SESSION['user_lastname'] = $out['lastname'];
|
||||
$_SESSION['user_email'] = $out['email'];
|
||||
$_SESSION['user_id'] = $out['backoffice_id'];
|
||||
$_SESSION['current_user'] = $out['firstname'] . " " . $out['lastname'];
|
||||
$loginReturn = true;
|
||||
} else {
|
||||
$data['error_message'] = "Invalid Username or Password";
|
||||
}
|
||||
|
||||
if ( $res==PHP_API_OK && isset($out["sessionid"]) && $out["backoffice_id"] > 0 ){
|
||||
$_SESSION['session_id'] =$out['sessionid']; // "";
|
||||
$_SESSION['username'] = $out['username']; // "";
|
||||
$_SESSION['backoffice_id'] = $out['backoffice_id'];
|
||||
$_SESSION['user_firstname'] = $out['firstname'];
|
||||
$_SESSION['user_lastname'] = $out['lastname'];
|
||||
$_SESSION['user_email'] = $out['email'];
|
||||
$_SESSION['user_id'] = $out['backoffice_id'];
|
||||
$_SESSION['current_user'] = $out['firstname']." " . $out['lastname'];
|
||||
$loginReturn = true;
|
||||
}
|
||||
else {
|
||||
$data['error_message']="Invalid Username or Password";
|
||||
}
|
||||
|
||||
|
||||
return $loginReturn;
|
||||
}
|
||||
|
||||
@@ -164,7 +163,6 @@ class MCORE_Controller extends CI_Controller {
|
||||
|
||||
|
||||
return $str;
|
||||
|
||||
}
|
||||
|
||||
protected function sql_escape_func($inp) {
|
||||
@@ -202,8 +200,6 @@ class MCORE_Controller extends CI_Controller {
|
||||
//$this->load->view('users/view_external_footer');
|
||||
}
|
||||
|
||||
|
||||
|
||||
protected function readFixedText($text_key) {
|
||||
|
||||
$page_key = trim($text_key);
|
||||
@@ -256,19 +252,22 @@ class MCORE_Controller extends CI_Controller {
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
|
||||
|
||||
protected function renderProviderSecurePage($page_name, $data) {
|
||||
|
||||
// you dont have bussines here if you are not in session
|
||||
|
||||
// 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);
|
||||
}
|
||||
|
||||
|
||||
$this->load->view('template/provider_header', $data);
|
||||
$this->load->view('provider/' . $page_name, $data);
|
||||
$this->load->view('template/provider_footer', $data);
|
||||
}
|
||||
|
||||
protected function renderBkoadminPage($page_name, $data) {
|
||||
$this->load->view('template/secure_header', $data);
|
||||
$this->load->view('bkoadmin/' . $page_name, $data);
|
||||
$this->load->view('template/secure_footer', $data);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2,7 +2,26 @@
|
||||
|
||||
class Admin_Controller extends MCORE_Controller {
|
||||
|
||||
|
||||
public $template = array(
|
||||
'table_open' => "<table datatable-scroll-y class='table table-striped table-hover table-bordered table-condensed'>",
|
||||
'thead_open' => '<thead class=\'bg-indigo\'>',
|
||||
'thead_close' => '</thead>',
|
||||
'heading_row_start' => '<tr>',
|
||||
'heading_row_end' => '</tr>',
|
||||
'heading_cell_start' => '<th>',
|
||||
'heading_cell_end' => '</th>',
|
||||
'tbody_open' => '<tbody>',
|
||||
'tbody_close' => '</tbody>',
|
||||
'row_start' => '<tr>',
|
||||
'row_end' => '</tr>',
|
||||
'cell_start' => '<td>',
|
||||
'cell_end' => '</td>',
|
||||
'row_alt_start' => '<tr>',
|
||||
'row_alt_end' => '</tr>',
|
||||
'cell_alt_start' => '<td>',
|
||||
'cell_alt_end' => '</td>',
|
||||
'table_close' => '</table>',
|
||||
);
|
||||
public $data = array();
|
||||
|
||||
function __construct() {
|
||||
@@ -12,23 +31,19 @@ class Admin_Controller extends MCORE_Controller {
|
||||
$this->load->helper('url');
|
||||
|
||||
// you dont have bussines here if you are not in session
|
||||
if (!isset($_SESSION['session_id']) or ! isset($_SESSION['backoffice_id']) ) {
|
||||
if (!isset($_SESSION['session_id']) or ! isset($_SESSION['backoffice_id'])) {
|
||||
redirect('/logout');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public function getSessionArray() {
|
||||
$data["current_date"] = date('l jS \of F Y h:i:s A');
|
||||
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
private function refreshAccountDetail($member_id) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,109 @@
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xxl-6 m-b-30">
|
||||
|
||||
<div class="card card-statistics h-100 mb-0">
|
||||
<div class="card-header d-flex align-items-center justify-content-between">
|
||||
<div class="card-heading">
|
||||
<h4 class="card-title">Users</h4>
|
||||
</div>
|
||||
<div id="transp_detail"></div>
|
||||
<div class="dropdown">
|
||||
<a class="p-2 export-btn" href="#!" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
Action
|
||||
</a>
|
||||
<div class="dropdown-menu custom-dropdown dropdown-menu-right p-4">
|
||||
<h6 class="mb-1">Action</h6>
|
||||
<a class="dropdown-item" href="/dash/pendingpractice"><i class="fa-fw fa fa-file-pdf-o pr-2"></i>Manage</a>
|
||||
<a class="dropdown-item" href="/reports/pendingpractice"><i class="fa-fw fa fa-file-excel-o pr-2"></i>Report</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="table-responsive">
|
||||
<?= $users_list ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xxl-6 m-b-30">
|
||||
<div class="card card-statistics h-100 mb-0 jobportal-contant">
|
||||
<div class="card-header d-flex align-items-center justify-content-between">
|
||||
<div class="card-heading">
|
||||
<h4 class="card-title">View User</h4>
|
||||
</div>
|
||||
<div class="dropdown">
|
||||
<a class="p-2 export-btn" href="#!" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
Action
|
||||
</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<!-- end row -->
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
< ! --
|
||||
|
||||
function viewMember(member_id) {
|
||||
|
||||
$('#transp_detail').html('Processing...');
|
||||
$('#acc' + member_id).prop('disabled', true);
|
||||
$.ajax({
|
||||
url: "/member/viewmember?proc=PROCESS&member_id=" + member_id
|
||||
}).done(function (data) {
|
||||
$('#transp_detail').html(data);
|
||||
$('#acc' + member_id).prop('dis abled', fals e);
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
function selectPendingPractice(pending_practice_id) {
|
||||
// alert(pending_practice_id);
|
||||
|
||||
$('#transp_detail').html('Processing...');
|
||||
// $('#acc' + pending_practice_id).prop('disabled', true);
|
||||
$.ajax({
|
||||
url: "/practice/selectPendingPractice?proc=PROCESS&pending_ practice_id=" + pending_practice_id
|
||||
}).done(function (data) {
|
||||
$('#transp_detail').html(data);
|
||||
// $('#acc' + pendin g_practice_i d).prop('disabled', fa lse);
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
function resendEmail(pending_practice_id) {
|
||||
// alert(pending_practice_id);
|
||||
|
||||
$('#transp_detail').html('Processing...');
|
||||
$('#bremail' + pending_practice_id).prop('disabled', true);
|
||||
$.ajax({
|
||||
url: "/practice/resen dEmail?proc=PROCESS&pending_practice_id=" + pending_practice_id
|
||||
}).done(function (data) {
|
||||
$('#transp_detail').html(data);
|
||||
$('#bremail' + pending_practice_id).prop('disabled',false);
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
// -->
|
||||
</script>
|
||||
|
||||
|
||||
@@ -284,13 +284,13 @@
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-static-title">Extra Tools</li>
|
||||
<li class="nav-static-title">Configurations & Tools</li>
|
||||
<li>
|
||||
<a class="has-arrow" href="javascript:void(0)" aria-expanded="false"><i class="nav-icon ti ti-map-alt"></i><span class="nav-title">Pending</span></a>
|
||||
<ul aria-expanded="false">
|
||||
<li> <a href="#">Pending</a> </li>
|
||||
<li> <a href="#">Pending </a> </li>
|
||||
<li> <a href="#">Pending </a> </li>
|
||||
<li> <a href="/bkoadmin">Office Users </a> </li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user