From 01398f05b8eb87fa3e0264cde32dc92ed14ca0d8 Mon Sep 17 00:00:00 2001 From: "CHIEFSOFT\\ameye" Date: Sat, 16 Nov 2024 14:17:46 -0500 Subject: [PATCH] fix page --- app/Config/Routes.php | 3 + app/Controllers/Auth.php | 14 ++ app/Controllers/BaseController.php | 9 +- app/Views/admin/index.php | 317 +++++------------------------ 4 files changed, 79 insertions(+), 264 deletions(-) diff --git a/app/Config/Routes.php b/app/Config/Routes.php index 5600332..1b92dd3 100644 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -10,6 +10,9 @@ 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('/(:any)/(:any)', 'Home::promoIndex/$1/$2'); $routes->get('/member', 'Home::member'); \ No newline at end of file diff --git a/app/Controllers/Auth.php b/app/Controllers/Auth.php index 3874b3b..c425b27 100644 --- a/app/Controllers/Auth.php +++ b/app/Controllers/Auth.php @@ -17,8 +17,22 @@ class Auth extends BaseController } public function AuthPromoLogin(){ + $raw_json = file_get_contents('php://input'); + $in = 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); + } + + public function AuthPromoDash(){ $out=[]; //exit(); return view('admin/index', $out); } +//$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 5442971..39547d3 100644 --- a/app/Controllers/BaseController.php +++ b/app/Controllers/BaseController.php @@ -54,6 +54,12 @@ abstract class BaseController extends Controller // Preload any models, libraries, etc, here. // E.g.: $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'; + } } public function APIcall($method, $url, $data) { @@ -125,7 +131,4 @@ abstract class BaseController extends Controller return API_ENDPOINT."/en/promoadmin/api/v1/"; } } -//$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/Views/admin/index.php b/app/Views/admin/index.php index 3257115..a97ecef 100644 --- a/app/Views/admin/index.php +++ b/app/Views/admin/index.php @@ -184,232 +184,27 @@ @@ -533,7 +328,7 @@
-

Job Seekers/Providers

+

Activity Stats

@@ -606,31 +401,31 @@

Site Visitors

-
-
-

154,65

- Total visit -
-
-
-
-

4,251

- Applicants -
-
-

6,578

- Interviews -
-
-

2,654

- Forwards -
-
-
-
-
-
-
+ + + + + + + + + + + + + + + + + + + + + + + +--> +