@extends('layouts.user') @section('title', 'Site Details') @section('content')
@if($site->logo) @else {{ substr($site->name, 0, 1) }} @endif

{{ $site->name }}

Site Profile
{{ $site->city }}, {{ $site->zip_code }} Code: {{ $site->site_id }} Rate: ${{ number_format($site->rate, 2) }}/hr
@can('edit site') Edit Site @endcan
Status
{{ $site->active ? 'Active' : 'Inactive' }}
Account Type
{{ $site->account_type }}
Site ID
{{ $site->site_id }}
Back to List

Site Information

Address

{{ $site->address_line_1 }}

{{ $site->city }}, {{ $site->zip_code }}

{{ $site->state->name ?? '' }}, {{ $site->country->name ?? '' }}

Geographic Coordinates

Lat
{{ $site->latitude }}
Long
{{ $site->longitude }}

Contact Person

Name

{{ $site->contact_first_name }} {{ $site->contact_last_name }}

{{ $site->contact_job_role }}

Phone Number

{{ $site->contact_phone_main }}

Email Address

{{ $site->contact_email }}

Quick Statistics

@php // Total Guards: Unique employees who have ever been scheduled for this site $totalGuards = \Illuminate\Support\Facades\DB::table('employee_schedule') ->join('schedules', 'employee_schedule.schedule_id', '=', 'schedules.id') ->where('schedules.site_id', $site->id) ->distinct('employee_schedule.employee_id') ->count('employee_schedule.employee_id'); // Active Duty: Guards currently checked in (active status) for today's shifts at this site $activeDuty = \Illuminate\Support\Facades\DB::table('employee_schedule') ->join('schedules', 'employee_schedule.schedule_id', '=', 'schedules.id') ->where('schedules.site_id', $site->id) ->where('schedules.status', 'active') ->whereDate('schedules.schedule_date', now()) ->count(); $percentage = $totalGuards > 0 ? ($activeDuty / $totalGuards) * 100 : 0; @endphp
Total Guards {{ $totalGuards }}
Active Duty {{ $activeDuty }}

Rate & Billing

Hourly Rate
${{ number_format($site->rate, 2) }}
Standard Billing Rate
@can('view schedules')
Cycle:
@can('edit schedule') @endcan @can('edit schedule') @endcan
@csrf
@can('create schedule') New Schedule @endcan
Loading schedules...
No upcoming schedules found for this site.
Date Time Employee Status

Templates

@can('edit schedule') @endcan
No templates yet.
No Master Template set up.
@can('edit schedule') @endcan
Select a template from the left to view.

Cycle Duration:

Add Shift (Day )

Roll Out Schedule

Defaults to currently selected template only.
@endcan
@can('view schedules') @endcan

Banned Employees

@if($site->bannedEmployees->isEmpty())
No employees are currently banned from this site.
@else
@foreach($site->bannedEmployees as $employee)
@if($employee->profile_picture) @else {{ substr($employee->first_name, 0, 1) }}{{ substr($employee->last_name, 0, 1) }} @endif

{{ $employee->first_name }} {{ $employee->last_name }}

{{ $employee->employee_id }}

Reason

"{{ $employee->pivot->reason ?? 'No reason provided' }}"

Banned Since {{ \Carbon\Carbon::parse($employee->pivot->banned_at)->format('M d, Y') }}
@can('edit site')
@csrf @method('DELETE')
@endcan
@endforeach
@endif

Recent Incidents at {{ $site->name }}

View All
@php $recentIncidents = \Illuminate\Support\Facades\DB::table('incidents') ->join('schedules', 'incidents.schedule_id', '=', 'schedules.id') ->join('employees', 'incidents.employee_id', '=', 'employees.id') ->where('schedules.site_id', $site->id) ->orderBy('incidents.created_at', 'desc') ->limit(5) ->select('incidents.*', 'employees.first_name', 'employees.last_name') ->get(); @endphp @forelse($recentIncidents as $idx => $inc) @empty @endforelse
Date Subject Employee Action
{{ \Carbon\Carbon::parse($inc->created_at)->format('M d, Y') }} {{ $inc->subject }} {{ $inc->first_name }} {{ $inc->last_name }} Details
No recent incidents recorded.

Checkpoints

No checkpoints created yet.
Name Checkpoint Type Monitoring Checkpoint ID Scan Action Actions

Tour Routes

No tour routes created yet.
Description Assigned To Recurrence Duration Actions

Configure patrol path and schedule

@endsection