Files
digifi-mware/app/Controllers/Employers.php
T
CHIEFSOFT\ameye 9eaf8d5c58 employer uid
2024-06-13 16:29:17 -04:00

63 lines
1.9 KiB
PHP

<?php
namespace App\Controllers;
class Employers extends BaseController
{
public function verifyEmployer()
{
$data = $this->request->getPost();
if ($data['application_uid'] != '') {
$findEmp ="SELECT uid AS application_uid, * from applications WHERE status =2 AND uid = '".trim($data['application_uid'])."'";
log_message('error', "findEmp---=>" . $findEmp);
$query = $this->db->query($findEmp);
$row = $query->getResult('array');
$employer_uid = $row[0]['employer_uid'];
if ($row[0]['uid']!='' ){
$checkData = $this->APIcall("POST", "http://10.10.10.48:6332/api/verify/employer", json_encode($row));
}
$udata = [
'employer_uid' => $employer_uid
];
$addedData = $this->insert_db('employer_checks',$udata);
//$addedData =[];
if( $addedData["uid"] ==''){
$response = [
'message' => 'Failure',
'call_return' => '100',
'token' => '',
'verify_data' => $checkData
];
return $this->fail($response, 500);
}
$response = [
'message' => 'Verification text sent to employer',
'call_return' => '100',
'verification_id' => $addedData["uid"],
'status' => $checkData["res"]["status"],
'verify_data' => $checkData["res"]["data"]
];
return $this->respond($response, 200);
} else {
$response = [
'message' => 'Failure',
'call_return' => '100',
'token' => ''
];
return $this->fail($response, 409);
}
//return json_encode( $response );
}
}