session fix
This commit is contained in:
@@ -12,7 +12,7 @@ $routes->post('/promoadmin/auth', 'Auth::AuthPromoLogin');
|
||||
$routes->post('/promoauth', 'Auth::AuthPromoLogin');
|
||||
|
||||
$routes->get('/promodash', 'PromoAdmin::AuthPromoDash');
|
||||
$routes->get('/promolist', 'PromoAdmin::AuthPromoDash');
|
||||
$routes->get('/promolist', 'PromoAdmin::PromoMyList');
|
||||
$routes->get('/addRefMember', 'PromoAdmin::addRefMember');
|
||||
|
||||
|
||||
|
||||
@@ -27,30 +27,25 @@ class Auth extends BaseController
|
||||
$out = $this->APIcall('POST', $this->wrenchAdminApiServer(). 'auth',$data);
|
||||
// var_dump( $out );
|
||||
if (is_array($out) && isset($out['sessionid']) && isset($out['promo_admin_id'])){
|
||||
session_status();
|
||||
|
||||
$_SESSION['firstname'] = $out['firstname'];
|
||||
$_SESSION['lastname'] = $out['lastname'];
|
||||
$_SESSION['email'] = $out['email'];
|
||||
$_SESSION['promo_admin_id'] =$out['promo_admin_id'];
|
||||
$_SESSION['sessionid'] = $out['sessionid'];
|
||||
|
||||
$_SESSION['new_users'] = 0;
|
||||
$_SESSION['pending_users'] = 0;
|
||||
$_SESSION['active_users'] = 0;
|
||||
$_SESSION['total_users'] = 0;
|
||||
|
||||
|
||||
return view('admin/index', $out);
|
||||
}
|
||||
|
||||
return view('promo_admin_home', $out);
|
||||
}
|
||||
|
||||
// public function AuthPromoDash(){
|
||||
// $out=[];
|
||||
// //exit();
|
||||
// return view('admin/index', $out);
|
||||
// }
|
||||
|
||||
public function addRefMember(){
|
||||
echo "Ameye Olu Test ";
|
||||
}
|
||||
//$routes->post('/en/promoadmin/api/v1/auth', 'Promo::promoAuth');
|
||||
//$routes->get('/en/promoadmin/api/v1/list', 'Promo::promoList');
|
||||
//$routes->post('/en/promoadmin/api/v1/list', 'Promo::promoAddRef');
|
||||
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ abstract class BaseController extends Controller
|
||||
* Be sure to declare properties for any property fetch you initialized.
|
||||
* The creation of dynamic property is deprecated in PHP 8.2.
|
||||
*/
|
||||
// protected $session;
|
||||
protected $session;
|
||||
|
||||
/**
|
||||
* @return void
|
||||
@@ -54,12 +54,14 @@ abstract class BaseController extends Controller
|
||||
// Preload any models, libraries, etc, here.
|
||||
|
||||
// E.g.: $this->session = \Config\Services::session();
|
||||
$this->session = \Config\Services::session();
|
||||
$httpHost = $_SERVER['HTTP_HOST'];
|
||||
|
||||
if ( $httpHost == 'https://promo.wrenchboard.com' || $httpHost == 'promo.wrenchboard.com' ){
|
||||
$_SERVER['CI_ENV'] = 'production';
|
||||
$_SERVER['CI_ENVIRONMENT'] = 'production';
|
||||
}
|
||||
// if ( session_status() !== PHP_SESSION_ACTIVE ) session_start();
|
||||
}
|
||||
|
||||
public function APIcall($method, $url, $data) {
|
||||
|
||||
@@ -25,19 +25,18 @@ class PromoAdmin extends BaseController
|
||||
return view('admin/index', $out);
|
||||
}
|
||||
|
||||
public function addRefMember(){
|
||||
// $raw_json = file_get_contents('php://input');
|
||||
// $in = json_decode($raw_json, true);
|
||||
// $id_booking = $this->input->post('id_booking');
|
||||
// $in = $this->request->get;
|
||||
// var_dump( $_GET );
|
||||
// exit;
|
||||
$data['email'] = $_GET['email']; // strtolower($this->input->get('email')); // '08174596144';
|
||||
$data['firstname'] = $_GET['firstname']; // $this->input->get('firstname'); //'7978';
|
||||
$data['lastname'] = $_GET['lastname']; // strtolower($this->input->get('lastname')); // '08174596144';
|
||||
|
||||
public function PromoMyList(){
|
||||
$out=[];
|
||||
//exit();
|
||||
return view('admin/mylist', $out);
|
||||
}
|
||||
public function addRefMember(){
|
||||
|
||||
$data['email'] = $_GET['email'];
|
||||
$data['firstname'] = $_GET['firstname'];
|
||||
$data['lastname'] = $_GET['lastname'];
|
||||
|
||||
$out=[];
|
||||
$out = $this->APIcall('POST', $this->wrenchAdminApiServer(). 'list',$data);
|
||||
var_dump( $out );
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
<div class="card-body d-flex align-itemes-center">
|
||||
<div class="media align-items-center w-100">
|
||||
<div class="text-left">
|
||||
<h3 class="mb-0">0</h3>
|
||||
<h3 class="mb-0"><?=$_SESSION['pending_users'] ?? 0 ?></h3>
|
||||
<span>Pending Users</span>
|
||||
</div>
|
||||
<div class="img-icon bg-pink ml-auto">
|
||||
@@ -72,7 +72,7 @@
|
||||
<div class="card-body d-flex align-itemes-center">
|
||||
<div class="media align-items-center w-100">
|
||||
<div class="text-left">
|
||||
<h3 class="mb-0">0 </h3>
|
||||
<h3 class="mb-0"> <?=$_SESSION['new_users'] ?? 0 ?> </h3>
|
||||
<span>New Users</span>
|
||||
</div>
|
||||
<div class="img-icon bg-primary ml-auto">
|
||||
@@ -83,8 +83,8 @@
|
||||
<div class="card-body d-flex align-itemes-center">
|
||||
<div class="media align-items-center w-100">
|
||||
<div class="text-left">
|
||||
<h3 class="mb-0">0 </h3>
|
||||
<span>Deleted Users</span>
|
||||
<h3 class="mb-0"> <?=$_SESSION['total_users'] ?? 0 ?> </h3>
|
||||
<span>Total Users</span>
|
||||
</div>
|
||||
<div class="img-icon bg-orange ml-auto">
|
||||
<i class="ti ti-wallet text-white"></i>
|
||||
@@ -94,7 +94,7 @@
|
||||
<div class="card-body d-flex align-itemes-center">
|
||||
<div class="media align-items-center w-100">
|
||||
<div class="text-left">
|
||||
<h3 class="mb-0">0 </h3>
|
||||
<h3 class="mb-0"> <?=$_SESSION['active_users'] ?? 0 ?> </h3>
|
||||
<span>Active Users</span>
|
||||
</div>
|
||||
<div class="img-icon bg-info ml-auto">
|
||||
|
||||
@@ -0,0 +1,205 @@
|
||||
<?= $this->extend('layouts/adminpage') ?>
|
||||
|
||||
<?= $this->section('content') ?>
|
||||
<!-- begin app-main -->
|
||||
<div class="app-main" id="main">
|
||||
<!-- begin container-fluid -->
|
||||
<div class="container-fluid">
|
||||
<!-- begin row -->
|
||||
<div class="row">
|
||||
<div class="col-md-12 m-b-30">
|
||||
<!-- begin page title -->
|
||||
<div class="d-block d-sm-flex flex-nowrap align-items-center">
|
||||
<div class="page-title mb-2 mb-sm-0">
|
||||
<h1>My Promotions Dash</h1>
|
||||
</div>
|
||||
<div class="ml-auto d-flex align-items-center">
|
||||
<nav>
|
||||
<ol class="breadcrumb p-0 m-b-0">
|
||||
<li class="breadcrumb-item">
|
||||
<a href="index.html"><i class="ti ti-home"></i></a>
|
||||
</li>
|
||||
<li class="breadcrumb-item">
|
||||
Dashboard
|
||||
</li>
|
||||
<li class="breadcrumb-item active text-primary" aria-current="page">Job
|
||||
Portal</li>
|
||||
</ol>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end page title -->
|
||||
</div>
|
||||
</div>
|
||||
<!-- end row -->
|
||||
<!-- begin row -->
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xxl-6 m-b-30">
|
||||
<div class="card card-statistics h-100 mb-0" style="background-color: aliceblue;">
|
||||
<div class="card-header d-flex align-items-center justify-content-between">
|
||||
<div class="card-heading">
|
||||
<h4 class="card-title">Recent Contacts</h4>
|
||||
</div>
|
||||
<div class="dropdown">
|
||||
<a class="p-2 export-btn" href="/promolist" aria-haspopup="true" aria-expanded="false">
|
||||
Go to my list
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="table-responsive">
|
||||
<table id="latestjobs" class="table table-borderless table-striped jobportal-table mb-0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>No.</th>
|
||||
<th>Email</th>
|
||||
<th>Firstname</th>
|
||||
<th>Lastname</th>
|
||||
<th>Action</th>
|
||||
<th>Status</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="text-muted">
|
||||
<tr>
|
||||
<td>#00001</td>
|
||||
<td>
|
||||
<p>james@bond.com</p>
|
||||
</td>
|
||||
<td>Firstname</td>
|
||||
<td>Lastname</td>
|
||||
<td>
|
||||
Initial Task
|
||||
</td>
|
||||
<td>
|
||||
<label class="badge badge-success-inverse mb-0">pending</label>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</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">Recent Actions</h4>
|
||||
</div>
|
||||
<div class="dropdown">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="table-responsive">
|
||||
<table id="openposition" class="table table-borderless table-striped jobportal-table mb-0">
|
||||
<tbody class="text-muted">
|
||||
<tr>
|
||||
<td>
|
||||
<div class="bg-img ml-3">
|
||||
<img src="/asset/img/browser-logo/google.png" class="img-fluid" alt="user-7">
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<p class="d-block"><strong> Senior front-end developer</strong>
|
||||
<span class="d-block"> <i class="fa fa-map-marker mr-2"></i> Montreal, Canada</span></p>
|
||||
</td>
|
||||
<td>
|
||||
<p> Over 1 month ago
|
||||
<span class="d-block"> <i class="fa fa-briefcase mr-2"></i> Full–time </span></p>
|
||||
</td>
|
||||
<td class="text-info text-right">
|
||||
45 Days left
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<div class="bg-img ml-3">
|
||||
<img src="/asset/img/browser-logo/envato.png" class="img-fluid" alt="user-7">
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<p class="d-block"><strong> Sales associate</strong>
|
||||
<span class="d-block"> <i class="fa fa-map-marker mr-2"></i> London, UK</span></p>
|
||||
</td>
|
||||
<td>
|
||||
<p> Over 2 month ago
|
||||
<span class="d-block"> <i class="fa fa-briefcase mr-2"></i> Part–time </span></p>
|
||||
</td>
|
||||
<td class="text-info text-right">
|
||||
80 Days left
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<div class="bg-img ml-3">
|
||||
<img src="/asset/img/browser-logo/invision.png" class="img-fluid" alt="user-7">
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<p class="d-block"><strong> Product designer</strong>
|
||||
<span class="d-block"> <i class="fa fa-map-marker mr-2"></i> Delhi, India</span></p>
|
||||
</td>
|
||||
<td>
|
||||
<p> Over 6 month ago
|
||||
<span class="d-block"> <i class="fa fa-briefcase mr-2"></i> Part–time </span></p>
|
||||
</td>
|
||||
<td class="text-info text-right">
|
||||
50 Days left
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<div class="bg-img ml-3">
|
||||
<img src="/asset/img/browser-logo/slack.png" class="img-fluid" alt="user-7">
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<p class="d-block"><strong> Python engineer</strong>
|
||||
<span class="d-block"> <i class="fa fa-map-marker mr-2"></i> Tokyo, Japan</span></p>
|
||||
</td>
|
||||
<td>
|
||||
<p> Over 10 month ago
|
||||
<span class="d-block"> <i class="fa fa-briefcase mr-2"></i> Full–time </span></p>
|
||||
</td>
|
||||
<td class="text-info text-right">
|
||||
20 Days left
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<div class="bg-img ml-3">
|
||||
<img src="/asset/img/browser-logo/bootstrap.png" class="img-fluid" alt="user-7">
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<p class="d-block"><strong> Account executive</strong>
|
||||
<span class="d-block"> <i class="fa fa-map-marker mr-2"></i> Menlo Park, CA</span></p>
|
||||
</td>
|
||||
<td>
|
||||
<p> Over 4 month ago
|
||||
<span class="d-block"> <i class="fa fa-briefcase mr-2"></i> Casual </span></p>
|
||||
</td>
|
||||
<td class="text-info text-right">
|
||||
10 Days left
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- end row -->
|
||||
</div>
|
||||
<!-- end container-fluid -->
|
||||
</div>
|
||||
<!-- end app-main -->
|
||||
<?= $this->endSection() ?>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user