testaccount
This commit is contained in:
@@ -10,9 +10,10 @@ use CodeIgniter\Router\RouteCollection;
|
||||
$routes->get('/promoadmin', 'Auth::AuthPromoAdmin');
|
||||
$routes->post('/promoadmin/auth', 'Auth::AuthPromoLogin');
|
||||
$routes->post('/promoauth', 'Auth::AuthPromoLogin');
|
||||
$routes->get('/promodash', 'Auth::AuthPromoDash');
|
||||
|
||||
$routes->get('/addRefMember', 'Auth::addRefMember');
|
||||
$routes->get('/promodash', 'PromoAdmin::AuthPromoDash');
|
||||
$routes->get('/promolist', 'PromoAdmin::AuthPromoDash');
|
||||
$routes->get('/addRefMember', 'PromoAdmin::addRefMember');
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -18,12 +18,22 @@ class Auth extends BaseController
|
||||
|
||||
public function AuthPromoLogin(){
|
||||
$raw_json = file_get_contents('php://input');
|
||||
$in = json_decode($raw_json, true);
|
||||
$in = $_POST; ///json_decode($raw_json, true);
|
||||
$out=[];
|
||||
//exit();
|
||||
$out["login_result"] = $this->APIcall('POST', $this->wrenchAdminApiServer(). 'auth',$in);
|
||||
var_dump( $out );
|
||||
return view('admin/index', $out);
|
||||
|
||||
$out = $this->APIcall('POST', $this->wrenchAdminApiServer(). 'auth',$in);
|
||||
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'];
|
||||
|
||||
return view('admin/index', $out);
|
||||
}
|
||||
|
||||
return view('promo_admin_home', $out);
|
||||
}
|
||||
|
||||
public function AuthPromoDash(){
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
namespace App\Controllers;
|
||||
use CodeIgniter\HTTP\RequestInterface;
|
||||
use CodeIgniter\HTTP\Request;
|
||||
|
||||
class PromoAdmin extends BaseController
|
||||
{
|
||||
protected $request;
|
||||
|
||||
// public function __construct(RequestInterface $request)
|
||||
// {
|
||||
// $this->request = $request;
|
||||
// }
|
||||
|
||||
public function index(): string
|
||||
{
|
||||
return view('welcome_message');
|
||||
}
|
||||
|
||||
|
||||
public function AuthPromoDash(){
|
||||
$out=[];
|
||||
//exit();
|
||||
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';
|
||||
|
||||
$out=[];
|
||||
//exit();
|
||||
$out["add_result"] = $this->APIcall('POST', $this->wrenchAdminApiServer(). 'list',$data);
|
||||
//var_dump( $data );
|
||||
|
||||
echo "Ameye Olu Test 0000 ";
|
||||
}
|
||||
//$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');
|
||||
|
||||
}
|
||||
+20
-101
@@ -78,8 +78,8 @@
|
||||
<div class="bg-gradient px-4 py-3">
|
||||
<div class="d-flex align-items-center justify-content-between">
|
||||
<div class="mr-1">
|
||||
<h4 class="text-white mb-0">Alice Williams</h4>
|
||||
<small class="text-white">Henry@example.com</small>
|
||||
<h4 class="text-white mb-0"><?=$_SESSION['firstname']?> <?=$_SESSION['lastname']?></h4>
|
||||
<small class="text-white"><?=$_SESSION['email']?></small>
|
||||
</div>
|
||||
<a href="/promoadmin" class="text-white font-20 tooltip-wrapper" data-toggle="tooltip"
|
||||
data-placement="top" title="" data-original-title="Logout"> <i
|
||||
@@ -139,7 +139,7 @@
|
||||
</a>
|
||||
<ul aria-expanded="false">
|
||||
<li> <a href='/promodash'>Home</a> </li>
|
||||
<li> <a href='/promodash'>My List</a> </li>
|
||||
<li> <a href='/promolist'>My List</a> </li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
@@ -291,20 +291,15 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xxl-6 m-b-30">
|
||||
<div class="card card-statistics h-100 mb-0">
|
||||
<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="#!" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
Export
|
||||
<a class="p-2 export-btn" href="/promolist" aria-haspopup="true" aria-expanded="false">
|
||||
Go to my list
|
||||
</a>
|
||||
<div class="dropdown-menu custom-dropdown dropdown-menu-right p-4">
|
||||
<h6 class="mb-1">Action</h6>
|
||||
<a class="dropdown-item" href="#!"><i class="fa-fw fa fa-file-pdf-o pr-2"></i>Export to PDF</a>
|
||||
<a class="dropdown-item" href="#!"><i class="fa-fw fa fa-file-excel-o pr-2"></i>Export to CSV</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
@@ -313,10 +308,10 @@
|
||||
<thead>
|
||||
<tr>
|
||||
<th>No.</th>
|
||||
<th>User Name</th>
|
||||
<th>Position</th>
|
||||
<th>Department</th>
|
||||
<th>Location</th>
|
||||
<th>Email</th>
|
||||
<th>Firstname</th>
|
||||
<th>Lastname</th>
|
||||
<th>Action</th>
|
||||
<th>Status</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -324,108 +319,32 @@
|
||||
<tr>
|
||||
<td>#00001</td>
|
||||
<td>
|
||||
<p>Brian Joedro</p>
|
||||
<p>james@bond.com</p>
|
||||
</td>
|
||||
<td>Sale associate</td>
|
||||
<td>Marketing</td>
|
||||
<td>Firstname</td>
|
||||
<td>Lastname</td>
|
||||
<td>
|
||||
Los Angeles
|
||||
Initial Task
|
||||
</td>
|
||||
<td>
|
||||
<label class="badge badge-success-inverse mb-0">Applied</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>#00002</td>
|
||||
<td>
|
||||
<p>Smithdro</p>
|
||||
</td>
|
||||
<td>Product designer</td>
|
||||
<td>Graphics</td>
|
||||
<td>
|
||||
Menlo Park, CA
|
||||
</td>
|
||||
<td>
|
||||
<label class="badge badge-warning-inverse mb-0">Pending</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>#00003</td>
|
||||
<td>
|
||||
<p>Adrian Demiandro</p>
|
||||
</td>
|
||||
<td>Python engineer</td>
|
||||
<td>Development</td>
|
||||
<td>
|
||||
Dallas
|
||||
</td>
|
||||
<td>
|
||||
<label class="badge badge-danger-inverse mb-0">Cancelled</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>#00004</td>
|
||||
<td>
|
||||
<p>Sandradro Garett</p>
|
||||
</td>
|
||||
<td>Account executive</td>
|
||||
<td>Account</td>
|
||||
<td>
|
||||
New york
|
||||
</td>
|
||||
<td>
|
||||
<label class="badge badge-info-inverse mb-0">On Hold</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>#00005</td>
|
||||
<td>
|
||||
<p>Garydro</p>
|
||||
</td>
|
||||
<td>Front-end developer</td>
|
||||
<td>Developer</td>
|
||||
<td>
|
||||
Los Angeles
|
||||
</td>
|
||||
<td>
|
||||
<label class="badge badge-success-inverse mb-0">Applied</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>#00003</td>
|
||||
<td>
|
||||
<p>Demiandro</p>
|
||||
</td>
|
||||
<td>Python engineer</td>
|
||||
<td>Development</td>
|
||||
<td>
|
||||
Dallas
|
||||
</td>
|
||||
<td>
|
||||
<label class="badge badge-danger-inverse mb-0">Cancelled</label>
|
||||
<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="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">
|
||||
<a class="p-2 export-btn" href="#!" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
Export
|
||||
</a>
|
||||
<div class="dropdown-menu custom-dropdown dropdown-menu-right p-4">
|
||||
<!-- <h6 class="mb-1">Action</h6>-->
|
||||
<!-- <a class="dropdown-item" href="#!"><i class="fa-fw fa fa-file-pdf-o pr-2"></i>Export to PDF</a>-->
|
||||
<!-- <a class="dropdown-item" href="#!"><i class="fa-fw fa fa-file-excel-o pr-2"></i>Export to CSV</a>-->
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
@@ -564,7 +483,7 @@
|
||||
var firstname = document.getElementById('firstname').value;
|
||||
var lastname = document.getElementById('lastname').value;
|
||||
|
||||
alert (email + firstname + lastname );
|
||||
// alert (email + firstname + lastname );
|
||||
|
||||
if (email ==='' || firstname==='' || lastname==='' ){
|
||||
return;
|
||||
@@ -573,7 +492,7 @@
|
||||
$('#result_box').html('Processing...');
|
||||
$('#action_button').prop('disabled', true);
|
||||
$.ajax({
|
||||
url: "/addRefMember?proc=TRANSDETAIL&email="+email
|
||||
url: "/addRefMember?proc=TRANSDETAIL&email="+email+"&firstname="+firstname+"&lastname="+lastname
|
||||
}).done(function (data) {
|
||||
$('#result_box').html(data);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user