diff --git a/app/Config/Routes.php b/app/Config/Routes.php index a989445..52b08d4 100644 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -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'); diff --git a/app/Controllers/Auth.php b/app/Controllers/Auth.php index 8e411d5..4c9be91 100644 --- a/app/Controllers/Auth.php +++ b/app/Controllers/Auth.php @@ -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'); } diff --git a/app/Controllers/BaseController.php b/app/Controllers/BaseController.php index 39547d3..ae3decd 100644 --- a/app/Controllers/BaseController.php +++ b/app/Controllers/BaseController.php @@ -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) { diff --git a/app/Controllers/PromoAdmin.php b/app/Controllers/PromoAdmin.php index c94a2ac..b2eb9bd 100644 --- a/app/Controllers/PromoAdmin.php +++ b/app/Controllers/PromoAdmin.php @@ -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 ); diff --git a/app/Views/admin/index.php b/app/Views/admin/index.php index 73185cf..7cb8a97 100644 --- a/app/Views/admin/index.php +++ b/app/Views/admin/index.php @@ -61,7 +61,7 @@
-

0

+

Pending Users
@@ -72,7 +72,7 @@
-

0

+

New Users
@@ -83,8 +83,8 @@
-

0

- Deleted Users +

+ Total Users
@@ -94,7 +94,7 @@
-

0

+

Active Users
diff --git a/app/Views/admin/mylist.php b/app/Views/admin/mylist.php new file mode 100644 index 0000000..dc2d1c4 --- /dev/null +++ b/app/Views/admin/mylist.php @@ -0,0 +1,205 @@ +extend('layouts/adminpage') ?> + +section('content') ?> + +
+ +
+ +
+
+ +
+
+

My Promotions Dash

+
+
+ +
+
+ +
+
+ + + +
+
+
+
+
+

Recent Contacts

+
+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + +
No.EmailFirstnameLastnameActionStatus
#00001 +

james@bond.com

+
FirstnameLastname + Initial Task + + +
+
+
+
+
+
+
+
+
+

Recent Actions

+
+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ user-7 +
+
+

Senior front-end developer + Montreal, Canada

+
+

Over 1 month ago + Full–time

+
+ 45 Days left +
+
+ user-7 +
+
+

Sales associate + London, UK

+
+

Over 2 month ago + Part–time

+
+ 80 Days left +
+
+ user-7 +
+
+

Product designer + Delhi, India

+
+

Over 6 month ago + Part–time

+
+ 50 Days left +
+
+ user-7 +
+
+

Python engineer + Tokyo, Japan

+
+

Over 10 month ago + Full–time

+
+ 20 Days left +
+
+ user-7 +
+
+

Account executive + Menlo Park, CA

+
+

Over 4 month ago + Casual

+
+ 10 Days left +
+
+
+
+
+ +
+ +
+ +
+ +endSection() ?> + +