Mobile Food Establishment Inspection Report
| Establishment Type: Permanent |
Date:
{{ isset($inspection_data->inspection_date) ? date(config('site.dateFormat'), strtotime($inspection_data->inspection_date)) : '' }}
|
Risk Category:
{{ $inspection_data->permit ? $inspection_data->permit->risk_factor : '' }}
|
| Establishment:
{{ $inspection_data->permit ? $inspection_data->permit->est_name : '' }} |
)) }}) |
Time In:
{{ isset($inspection_data->time_in) ? date(config('site.time24Format'), strtotime($inspection_data->time_in)) : '' }}
|
| Address:
{{ $inspection_data->permit ? $inspection_data->permit->est_mailing_address : '' }} |
Time Out:
{{ isset($inspection_data->time_out) ? date(config('site.time24Format'), strtotime($inspection_data->time_out)) : '' }}
|
| Town/City:
{{ $inspection_data->permit ? $inspection_data->permit->est_mailing_city : '' }} |
LHD: Montgomery County |
| Permit Holder:
{{ $inspection_data->permit ? $inspection_data->permit->owner_name : '' }} |
Purpose of Inspection: {{ $inspection_data->purpose ? $inspection_data->purpose->name : '' }}
|
@php
$count1 = 0;
$dbstatus = '';
$in = '';
$out = '';
$no = '';
$na = '';
$cos = '';
$r = '';
$path = '';
$forcedItems = [15]; // <-- items that should always go to right column with section name
@endphp
@foreach ($food_sections as $q)
@php
$count = 0;
$total_count = 0;
$left_col = [];
$right_col = [];
// count total
foreach ($q->subsection()->orderBy('id', 'ASC')->get() as $p) {
$total_count++;
foreach ($p->items as $i) {
$total_count++;
}
}
foreach ($q->subsection()->orderBy('id', 'ASC')->get() as $p) {
$count++;
// check if this subsection has a forced item
$hasForcedItem = $p->items()->whereIn('id', $forcedItems)->exists();
// only add section name if not a forced section
if (!$hasForcedItem) {
if ($count <= floor($total_count / 2)) {
$left_col[] = ['item_id' => null, 'name' => $p->name, 'status' => ''];
} else {
$right_col[] = ['item_id' => null, 'name' => $p->name, 'status' => ''];
}
}
foreach ($p->items()->orderBy('id', 'ASC')->get() as $i) {
$count1++;
$dbstatus = $inspection_data->details()->where('item_id', $i->id);
$dbstatus = $dbstatus->count() > 0 ? $dbstatus->first() : null;
$in = $dbstatus ? $dbstatus->in : null;
$out = $dbstatus ? $dbstatus->out : null;
$no = $dbstatus ? $dbstatus->no : null;
$na = $dbstatus ? $dbstatus->na : null;
$cos = $dbstatus ? $dbstatus->cos : null;
$r = $dbstatus ? $dbstatus->r : null;
$image = $inspection_data->details->where('item_id', $i->id)->first();
$path = $image
? public_path('storage/image/food_inspection/snapshots/'.$inspection_data->id.'/'.$image->image)
: null;
// force items into right col with section name
if (in_array($i->id, $forcedItems)) {
// add section name only to right
$right_col[] = ['item_id' => null, 'name' => $p->name, 'status' => ''];
$right_col[] = [
'serial_number' => $i->serial_no,
'item_id' => $i->id,
'name' => $i->name,
'is_in' => $i->is_in,
'is_out' => $i->is_out,
'is_no' => $i->is_no,
'is_na' => $i->is_na,
'in' => $in,
'out' => $out,
'no' => $no,
'na' => $na,
'cos' => $cos,
'r' => $r,
'image' => $path,
];
} elseif ($count <= floor($total_count / 2)) {
$left_col[] = [
'serial_number' => $i->serial_no,
'item_id' => $i->id,
'name' => $i->name,
'is_in' => $i->is_in,
'is_out' => $i->is_out,
'is_no' => $i->is_no,
'is_na' => $i->is_na,
'in' => $in,
'out' => $out,
'no' => $no,
'na' => $na,
'cos' => $cos,
'r' => $r,
'image' => $path,
];
} else {
$right_col[] = [
'serial_number' => $i->serial_no,
'item_id' => $i->id,
'name' => $i->name,
'is_in' => $i->is_in,
'is_out' => $i->is_out,
'is_no' => $i->is_no,
'is_na' => $i->is_na,
'in' => $in,
'out' => $out,
'no' => $no,
'na' => $na,
'cos' => $cos,
'r' => $r,
'image' => $path,
];
}
$count++;
}
}
$count = 0;
@endphp
|
IN = in compliance OUT = out of compliance N/O = not observed N/A =
not applicable COS = corrected on site during inspection R = repeat violation V = verified
|
|
{{ $q->name }}
|
|
Compliance Status
|
IN |
OUT |
NA |
NO |
COS |
R |
V |
|
Compliance Status
|
IN |
OUT |
NA |
NO |
COS |
R |
V |
@for ($i = 0; $i < max(count($left_col), count($right_col)); $i++)
@php
$d = $left_col[$i] ?? null;
$r = $right_col[$i] ?? null;
@endphp
{{-- LEFT --}}
@if (!$d || !isset($d['item_id']))
@if (!empty($d['name']))
|
{{ $d['name'] ?? '' }}
|
@else
|
@endif
@else
{{ $d['item_id'] }}
|
{{ $d['name'] }} |
@if (boolval($d['in'])) @endif
|
@if (boolval($d['out'])) @endif
|
@if (boolval($d['na'])) @endif
|
@if (boolval($d['no'])) @endif
|
@if (boolval($d['cos'])) @endif |
@if (boolval($d['r'])) @endif |
@php
$conditions = [];
if ($inspection_data->foodcodeDetails) {
$conditions = collect($inspection_data->foodcodeDetails)
->where('inspection_id', $inspection_data->id)
->where('item_id', $d['item_id'] ?? null)
->pluck('condition')->unique()->toArray();
}
@endphp
{{ implode(', ', $conditions) }}
|
@endif
|
{{-- RIGHT --}}
@if (!$r || !isset($r['item_id']))
{{ $r['name'] ?? '' }}
|
@else
@if ($r['item_id'] != 57) {{ $r['item_id'] }} @endif
|
{{ $r['name'] }} |
@if (boolval($r['in'])) @endif
|
@if (boolval($r['out'])) @endif
|
@if (boolval($r['na'])) @endif
|
@if (boolval($r['no'])) @endif
|
@if (boolval($r['cos'])) @endif |
@if (boolval($r['r'])) @endif |
@php
$conditions = [];
if ($inspection_data->foodcodeDetails) {
$conditions = collect($inspection_data->foodcodeDetails)
->where('inspection_id', $inspection_data->id)
->where('item_id', $r['item_id'] ?? null)
->pluck('condition')->unique()->toArray();
}
@endphp
{{ implode(', ', $conditions) }}
|
@endif
@endfor
@endforeach
Person in Charge (Signature):
@if ($inspection_data->receivedSignature)
@endif
|
Date:
{{ isset($inspection_data->receivedSignatureDate) ? date(config('site.dateFormat'), strtotime($inspection_data->receivedSignatureDate)) : '' }}
|
Person in Charge: {{ $inspection_data->receivedBy }} |
{{-- Title:
Person In Charge/ Owner | --}}
Inspected by:
@if ($inspection_data->inspectedSignature)
@endif
|
Date:
{{ isset($inspection_data->inspectedSignatureDate) ? date(config('site.dateFormat'), strtotime($inspection_data->inspectedSignatureDate)) : '' }}
|
Print: {{ $inspection_data->inspectedBy }}
|
|
Violations documented |
Date corrections due |
# |
| Priority Item Violations
|
{{ isset($inspection_data->priority_item_due_date) ? date(config('site.dateFormat'), strtotime($inspection_data->priority_item_due_date)) : '' }}
|
{{ $inspection_data->foodcodeDetails ? $inspection_data->foodcodeDetails->where('condition', 'P')->count() : 0 }}
|
| Priority Foundation Item
Violations |
{{ isset($inspection_data->priority_foundation_due_date) ? date(config('site.dateFormat'), strtotime($inspection_data->priority_foundation_due_date)) : '' }}
|
{{ $inspection_data->foodcodeDetails ? $inspection_data->foodcodeDetails->where('condition', 'PF')->count() : 0 }}
|
| Core Item Violations |
{{ isset($inspection_data->core_item_due_date) ? date(config('site.dateFormat'), strtotime($inspection_data->core_item_due_date)) : '' }}
|
{{ $inspection_data->foodcodeDetails ? $inspection_data->foodcodeDetails->where('condition', 'C')->count() : 0 }}
|
| Risk
Factor/Public Health Intervention Violations |
{{ $inspection_data->details ? $inspection_data->details->where('item_id', '<=', 29)->where('out', 1)->count() : 0 }}
|
| Repeat Risk
Factor/Public Health Intervention Violations |
{{ $inspection_data->details ? $inspection_data->details->where('r', 1)->count() : 0 }} |
| Good Retail
Practices Violations |
{{ $inspection_data->details ? $inspection_data->details->where('item_id', '>', 29)->where('out', 1)->count() : 0 }}
|
| Appeal: The owner or operator of a food establishment aggrieved by this order to correct any inspection violation identified by the food inspector or to hold, destroy, ordispose of unsafe food, may appeal such order to the Director of Health, not later than forty-eight hours after issuance of such order. |
Mobile Food Establishment Inspection Report
| LHD: Montgomery County |
Inspection Report Continuation Sheet |
Date: {{ isset($inspection_data->inspection_date) ? date(config('site.dateFormat'), strtotime($inspection_data->inspection_date)) : '' }} |
| Establishment: {{ $inspection_data->permit ? $inspection_data->permit->est_name : '' }} |
Address: {{ $inspection_data->permit ? $inspection_data->permit->est_mailing_address : '' }} |
Town: {{ $inspection_data->permit ? $inspection_data->permit->est_mailing_city : '' }} |
| TEMPERATURE OBSERVATIONS |
| SL No. |
Item |
Location |
Temp |
@foreach ($inspection_data->temperature as $key => $temp)
| {{ $loop->iteration }} |
{{ $temp->item }} |
{{ $temp->location }} |
{{ $temp->temp }} |
@endforeach
| Observation and Corrective Action |
| Item No. |
OBSERVATIONS AND
CORRECTIVE ACTIONS |
@foreach ($inspection_data->foodcodeDetails as $details)
@if ($details->code_id)
|
{{ $details->item_id . ' ' . ($details->condition ? ' - ' . $details->condition : '') }}
|
{{ $details->comment }} -
{{ $details->foodCodeDetails ? $details->foodCodeDetails->code : '' }} -
{{ $details->foodCodeDetails ? $details->foodCodeDetails->description : '' }} |
@endif
@endforeach
{{--