diff --git a/app/Config/Routes.php b/app/Config/Routes.php index e64d9709..c9360bc9 100644 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -195,7 +195,10 @@ $routes->cli('processjob', 'JobWorker::processJob'); -$routes->get("/api", "RestAuthenticationController::index"); +// $routes->get("/api", "RestAuthenticationController::index"); +$routes->post("/api/verifyEmployeeNumber", "RestAuthenticationController::verifyEmployeeWithMobileNumber"); +$routes->post("/api/getVerifiedUserData", "RestAuthenticationController::getVerifiedUserData"); + $routes->group("/api", ["filter" => "authJWT"], function($routes){ $routes->post("logined", "RestAuthenticationController::logined"); $routes->post("getId", "RestAuthenticationController::getUserIdFromToken"); diff --git a/app/Controllers/RestAuthenticationController.php b/app/Controllers/RestAuthenticationController.php index 97170242..e56cffb7 100644 --- a/app/Controllers/RestAuthenticationController.php +++ b/app/Controllers/RestAuthenticationController.php @@ -14,6 +14,8 @@ use CodeIgniter\API\ResponseTrait; +use App\Models\EmployeeModel; + use Firebase\JWT\JWT; // require_once('../vendor/autoload.php'); @@ -25,11 +27,15 @@ class RestAuthenticationController extends AdminController use ResponseTrait; protected $myLogger; + protected $employeeModel; + public function __construct() { // set_session_context('Client'); $this->myLogger = \Config\Services::mylogger(); + + $this->employeeModel = new EmployeeModel(); } @@ -50,6 +56,48 @@ class RestAuthenticationController extends AdminController } + public function verifyEmployeeWithMobileNumber() + { + try { + $mobile_number = $this->request->getJSON()->mobile_number; + + $employeeData = $this->employeeModel->where('mobile', $mobile_number)->first(); + if ($employeeData) { + $result = ['user_verification' => true]; + return ['status' => 'success','code' => 200,'data' => $result]; + } else { + $result = ['user_verification' => false]; + return ['status' => 'failed','code' => 404,'data' => $result]; + } + } catch (\Throwable $th) { + return ['status' => 'failed','code' => 505,'data' => $th]; + } + } + + + public function getVerifiedUserData() + { + try { + $mobile_number = $this->request->getJSON()->mobile_number; + + $employeeData = $this->employeeModel->where('mobile', $mobile_number)->first(); + if ($employeeData) { + $result = JWTToken::encode($employeeData); + return ['status' => 'success','code' => 200,'data' => $result]; + } else { + return ['status' => 'failed','code' => 404,'data' => "No data"]; + } + } catch (\Throwable $th) { + return ['status' => 'failed','code' => 500,'data' => $th]; + } + } + + + + public function employeeLogout() + { + + } public function getUserIdFromToken() { diff --git a/app/Helpers/JWTToken.php b/app/Helpers/JWTToken.php index 582bde39..dcee4d0d 100644 --- a/app/Helpers/JWTToken.php +++ b/app/Helpers/JWTToken.php @@ -32,7 +32,8 @@ class JWTToken try{ $token = JWT::encode($request_data ,$secret_Key,'HS512'); - return ['status' => true,'token' => $token]; + return $token; + // return ['status' => true,'token' => $token]; } catch (Exception $e) { return ['status' => false,'message' => $e->getMessage()]; diff --git a/app/Views/client_policy.php b/app/Views/client_policy.php index 0ec043ae..083132e3 100644 --- a/app/Views/client_policy.php +++ b/app/Views/client_policy.php @@ -644,31 +644,31 @@ }; function convertNumberToWords(number) { - if (number === 0) { - return numberWords[number]; - } + if (number === 0) { + return numberWords[number]; + } - let word = ''; + let word = ''; - if (number >= 10000000) { - word += convertNumberToWords(Math.floor(number / 10000000)) + " Crore "; - number %= 10000000; - } + if (number >= 10000000) { + word += convertNumberToWords(Math.floor(number / 10000000)) + " Crore "; + number %= 10000000; + } - if (number >= 100000) { - word += convertNumberToWords(Math.floor(number / 100000)) + " Lakh "; - number %= 100000; - } + if (number >= 100000) { + word += convertNumberToWords(Math.floor(number / 100000)) + " Lakh "; + number %= 100000; + } - if (number >= 1000) { - word += convertNumberToWords(Math.floor(number / 1000)) + " Thousand "; - number %= 1000; - } + if (number >= 1000) { + word += convertNumberToWords(Math.floor(number / 1000)) + " Thousand "; + number %= 1000; + } - if (number >= 100) { - word += convertNumberToWords(Math.floor(number / 100)) + " Hundred "; - number %= 100; - } + if (number >= 100) { + word += convertNumberToWords(Math.floor(number / 100)) + " Hundred "; + number %= 100; + } if (number > 0) { if (word !== '') { @@ -680,8 +680,12 @@ word += numberWords[Math.floor(number / 10) * 10] + " " + numberWords[number % 10]; } } + return word.trim(); + } - return word; + function convertCommaNumberToWords(input) { + const number = parseInt(input.replace(/,/g, ''), 10); + return convertNumberToWords(number); } function onlyNumbers(event){ @@ -690,4 +694,13 @@ if(charcode>= 48 && charcode <= 57)return true; return false; } + + + function formatNumber(input) { + var value = input.value.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","); + input.value = value; + } + + + \ No newline at end of file diff --git a/app/Views/policy_gmc_terms.php b/app/Views/policy_gmc_terms.php index 5dbd1893..3294e809 100644 --- a/app/Views/policy_gmc_terms.php +++ b/app/Views/policy_gmc_terms.php @@ -13,7 +13,7 @@ .radiobuttondiv{ margin-left: 32px; } - .form-control-client-policy-master{ + .{ width:62% !important; margin-left: 30px; margin-top: 3px @@ -49,10 +49,10 @@ display:none; } .jodit-container{ - width: 821px !important; - margin-top: 3px; - margin-bottom: 3px; - margin-left: 30px; + /* width: 821px !important; */ + /* margin-top: 3px; */ + /* margin-bottom: 3px; */ + /* margin-left: 30px; */ /* height: 0px !important; */ /* min-height: 100px !important; */ } @@ -65,7 +65,7 @@ .jodit-wysiwyg{ margin-bottom: 162px; } - .form-control-client-policy-masters{ + .s{ margin-left: 30px; width: 689px; } @@ -85,117 +85,169 @@
-
-
- - +
+
+
+
+ +
+
+
+
+
+
+
-
+
+
+ +
+
+ Yes + No +
+
+
+
+
+ Self + Spouse + Child 1 + Child 2 + Child 3 + Child 4 +
+
+ Parent 1 + Parent 2 + Parent-In-Law 1 + Parent-In-Law 2 +
+
+
-
-
-
-
- Yes - No -
-
-
- Self - Spouse - Child 1 - Child 2 - Child 3 - Child 4 -
-
- Parent 1 - Parent 2 - Parent-In-Law 1 - Parent-In-Law 2 -
-
-
- + +