|
|
|
@ -135,14 +135,24 @@ class PresenceController extends Controller
|
|
|
|
|
$checkLocation = $this->checkLocation($request); |
|
|
|
|
$statusBoundary = false; |
|
|
|
|
$date = date_create($request->time); |
|
|
|
|
$statusRestriction = HumanResource::select('status_boundary')->where('id', $request->user_id)->first(); |
|
|
|
|
// assign and in boundary |
|
|
|
|
if(count($checkLocation) > 0 && $checkLocation[0]['boundary']){ |
|
|
|
|
if (count($checkLocation) > 0 && $statusRestriction->status_boundary == true) |
|
|
|
|
{ |
|
|
|
|
if ($checkLocation[0]['boundary'] == true) |
|
|
|
|
{ |
|
|
|
|
$statusBoundary = true; |
|
|
|
|
} else { |
|
|
|
|
$statusBoundary = false; |
|
|
|
|
} |
|
|
|
|
$statusRestriction = HumanResource::select('status_boundary')->where('id', $request->user_id)->first(); |
|
|
|
|
if (!$statusRestriction->status_boundary) { |
|
|
|
|
} |
|
|
|
|
// assign and not in boundary or in boundary |
|
|
|
|
else { |
|
|
|
|
if ($checkLocation[0]['boundary'] == true || $checkLocation[0]['boundary'] == false) |
|
|
|
|
{ |
|
|
|
|
$statusBoundary = true; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
// not assign |
|
|
|
|
if(!$checkLocation[0]['status_assign'] && $checkLocation[0]['boundary'] == false && $statusBoundary == false){ |
|
|
|
|
$data=array( |
|
|
|
|