|
|
@ -18,6 +18,11 @@ class PresenceController extends Controller |
|
|
|
$this->validate($request, [ |
|
|
|
$this->validate($request, [ |
|
|
|
'user_id' => 'required' |
|
|
|
'user_id' => 'required' |
|
|
|
]); |
|
|
|
]); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// $test = $this->getLoc($request->clock_in_lat, $request->clock_in_lng)->display_name; |
|
|
|
|
|
|
|
// // display_name |
|
|
|
|
|
|
|
// return response()->json(["data"=>$test,'code'=>400], 400); |
|
|
|
|
|
|
|
|
|
|
|
$checkLocation = $this->checkLocation($request); |
|
|
|
$checkLocation = $this->checkLocation($request); |
|
|
|
$statusBoundary = false; |
|
|
|
$statusBoundary = false; |
|
|
@ -28,8 +33,8 @@ class PresenceController extends Controller |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if($request->type=="out"){ |
|
|
|
if($request->type=="out"){ |
|
|
|
// $clock_out_loc get data from api.nominatim url serach address payload (lat lot); |
|
|
|
|
|
|
|
$clock_out_loc = "-"; |
|
|
|
$clock_out_loc = $this->getLoc($request->clock_out_lat, $request->clock_out_lng)->display_name; |
|
|
|
$dataUpdate = array( |
|
|
|
$dataUpdate = array( |
|
|
|
"clock_out"=>$request->clock_time, |
|
|
|
"clock_out"=>$request->clock_time, |
|
|
|
"clock_out_lat" => $request->clock_out_lat, |
|
|
|
"clock_out_lat" => $request->clock_out_lat, |
|
|
@ -67,10 +72,8 @@ class PresenceController extends Controller |
|
|
|
die(); |
|
|
|
die(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$onlyDate = date_format($date,"Y-m-d"); |
|
|
|
$onlyDate = date_format($date,"Y-m-d"); |
|
|
|
|
|
|
|
$clock_in_loc = $this->getLoc($request->clock_in_lat, $request->clock_in_lng)->display_name; |
|
|
|
// $clock_in_loc get data from api.nominatim url serach address payload (lat lot); |
|
|
|
|
|
|
|
$clock_in_loc = "-"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$dataAdd = array( |
|
|
|
$dataAdd = array( |
|
|
|
'user_id'=> $request->user_id, |
|
|
|
'user_id'=> $request->user_id, |
|
|
@ -276,8 +279,8 @@ class PresenceController extends Controller |
|
|
|
$finalData = []; |
|
|
|
$finalData = []; |
|
|
|
|
|
|
|
|
|
|
|
foreach($dataGet as $data){ |
|
|
|
foreach($dataGet as $data){ |
|
|
|
$responseIn = $this.getLoc($clock_in_lat, $clock_in_lng); |
|
|
|
// $responseIn = $this->getLoc($clock_in_lat, $clock_in_lng); |
|
|
|
$responseOut = $this.getLoc($clock_in_lat, $clock_in_lng); |
|
|
|
// $responseOut = $this->getLoc($clock_in_lat, $clock_in_lng); |
|
|
|
$data->clock_in_loc = $responseIn->json()["display_name"]; |
|
|
|
$data->clock_in_loc = $responseIn->json()["display_name"]; |
|
|
|
$data->clock_out_loc = $responseOut->json()["display_name"]; |
|
|
|
$data->clock_out_loc = $responseOut->json()["display_name"]; |
|
|
|
} |
|
|
|
} |
|
|
|