@extends('layout.master')
@section('content')
@php
$userType = \App\Helpers\Helpers::getUserRole()->type_id ?? [];
$userAccess = \App\Helpers\Helpers::getUserAccess() ?? [];
$access = $userAccess['accesses'] ?? [];
$current_url = Request::path();
if ($current_url != '/') {
$urlParts = explode('/', $current_url);
$current_url = $urlParts[0];
}
$tab_names = [
1 => 'Overview',
2 => 'Estate Details',
3 => 'Residents',
4 => 'Visitors',
5 => 'Staffs',
];
@endphp
@if (!empty($estate_details) && !empty($tab))
-
Overview
-
Estate
Details
{{-- @if (!empty($userType) && ($userType == 1 || $userType == 3 || ($userType == 2 && (!empty($access['estate.staffs']) && in_array(2, $access['estate.staffs']))))) --}}
-
Residents
{{-- @endif --}}
-
Visitors
@if (
!empty($userType) &&
($userType == 1 ||
($userType == 2 && (!empty($access['estate.staffs']) && in_array(2, $access['estate.staffs'])))))
-
Staffs
@endif
@if (!empty($tab) && $tab == 1)
Residents
{{ $residents_count ?? 0 }}
Visitors Today
{{ $visitors_count ?? 0 }}
Alerts
{{ $alerts_count ?? 0 }}
{{--
--}}
@if (!empty($vehicle_entry_image) && !empty($vehicle_entry_image->public_url))
@else
@endif
Entrance
@if (!empty($vehicle_exit_image) && !empty($vehicle_exit_image->public_url))
@else
@endif
Exit
{{--
--}}
{{--
Entrance
Exit
--}}
Vehicle Entry Information(Last 24 Hrs)
Entry Date/Time |
Vehicle License |
Name |
Mobile |
Visiting Unit |
License Plate Image |
Exit Date/Time |
Vehicle License |
Name |
Mobile |
Visiting Unit |
License Plate Image
|
@elseif (!empty($tab) && $tab == 2)
{{ $estate_details->name ?? '-' }}
{{ $estate_details->address_line_one ?? '' }}
{{ $estate_details->address_line_two ?? '' }}
{{ $estate_details->contact_number ?? '-' }}
{{ $estate_details->email ?? '-' }}
@elseif (!empty($tab) && $tab == 3)
{{-- @php
$view = !empty($userType)
? ($userType == 1 ||
($userType == 2 &&
(!empty($access['estate.residences']) && in_array(2, $access['estate.residences'])))
? ''
: 'hide')
: 'hide';
$edit = !empty($userType)
? ($userType == 1 ||
($userType == 2 &&
(!empty($access['estate.residences']) && in_array(3, $access['estate.residences'])))
? ''
: 'hide')
: 'hide';
$delete = !empty($userType)
? ($userType == 1 ||
($userType == 2 &&
(!empty($access['estate.residences']) && in_array(4, $access['estate.residences'])))
? ''
: 'hide')
: 'hide';
@endphp --}}
@php
$view = !empty($userType)
? ($userType == 2 &&
(empty($access['estate.residences']) || !in_array(2, $access['estate.residences']))
? 'hide'
: '')
: 'hide';
$edit = !empty($userType)
? ($userType == 4 ||
($userType == 2 &&
(empty($access['estate.residences']) || !in_array(3, $access['estate.residences'])))
? 'hide'
: '')
: 'hide';
$delete = !empty($userType)
? ($userType == 4 ||
($userType == 2 &&
(empty($access['estate.residences']) || !in_array(4, $access['estate.residences'])))
? 'hide'
: '')
: 'hide';
@endphp
@include('residences.table')
@elseif (!empty($tab) && $tab == 4)
{{-- @php
$view = !empty($userType)
? ($userType == 1 ||
($userType == 2 &&
(!empty($access['estate.visitors']) && in_array(2, $access['estate.visitors'])))
? ''
: 'hide')
: 'hide';
$edit = !empty($userType)
? ($userType == 1 ||
($userType == 2 &&
(!empty($access['estate.visitors']) && in_array(3, $access['estate.visitors'])))
? ''
: 'hide')
: 'hide';
$delete = !empty($userType)
? ($userType == 1 ||
($userType == 2 &&
(!empty($access['estate.visitors']) && in_array(4, $access['estate.visitors'])))
? ''
: 'hide')
: 'hide';
@endphp --}}
@php
$view = !empty($userType)
? ($userType == 2 &&
(empty($access['estate.visitors']) || !in_array(2, $access['estate.visitors']))
? 'hide'
: '')
: 'hide';
$edit = !empty($userType)
? ($userType == 2 &&
(empty($access['estate.visitors']) || !in_array(3, $access['estate.visitors']))
? 'hide'
: '')
: 'hide';
$delete = !empty($userType)
? ($userType == 2 &&
(empty($access['estate.visitors']) || !in_array(4, $access['estate.visitors']))
? 'hide'
: '')
: 'hide';
@endphp
@include('visitors.table')
@elseif (!empty($tab) && $tab == 5)
Sl No.
|
Name |
Role |
Email |
Phone |
Status |
Actions |
@if (!empty($staffs_list) && count($staffs_list) > 0)
@foreach ($staffs_list as $staff)
{{ str_pad($loop->index + 1, 3, '0', STR_PAD_LEFT) }}
|
{{ $staff->full_name }} |
{{ !empty($staff->user_role) ? $staff->user_role : (!empty($staff->user_type) ? $staff->user_type : '-') }}
|
{{ $staff->email ?? '-' }} |
{{ $staff->contact_number ?? '-' }} |
{{ $staff->is_blocked == 1 ? 'Inactive' : 'Active' }}
|
|
@endforeach
{{-- @else
No records found
|
--}}
@endif
@endif
@else