@php
$defaultLogo = storage_path('app/public/logo/logo1.png');
$companyLogoName = $job_data->company_title_image ?? null;
$companyLogoAbs = $companyLogoName
? storage_path('app/public/' . ltrim($companyLogoName, '/'))
: null;
$fallbackLogoPath = ($companyLogoAbs && file_exists($companyLogoAbs)) ? $companyLogoAbs : $defaultLogo;
$natraxLogoAbs = storage_path('app/public/logo/natrax.png');
$natraxLogoPath = (file_exists($natraxLogoAbs)) ? $natraxLogoAbs : $fallbackLogoPath;
@endphp
@php
$baseDate = $job_data->installation_date ?? $job_data->date ?? null;
$validUpto = $baseDate ? \Carbon\Carbon::parse($baseDate)->addYear()->format('d-m-Y') : '-';
$issuingDate = $baseDate ? \Carbon\Carbon::parse($baseDate)->format('d-m-Y') : '-';
$certificateNo = $job_data->certificate_no ?? ('SPDTH' . str_pad($job_data->id ?? '000000', 6, '0', STR_PAD_LEFT));
$toStorageAbs = static function (?string $storedPath): ?string {
if (!$storedPath) {
return null;
}
$p = ltrim((string) $storedPath, '/');
if (str_starts_with($p, 'storage/')) {
$p = substr($p, strlen('storage/'));
}
if (str_starts_with($p, 'public/')) {
$p = substr($p, strlen('public/'));
}
return storage_path('app/public/' . $p);
};
$imgToDataUri = static function (?string $absPath): ?string {
if (!$absPath || !is_file($absPath) || !is_readable($absPath)) {
return null;
}
$finfo = finfo_open(FILEINFO_MIME_TYPE);
$mime = $finfo ? finfo_file($finfo, $absPath) : null;
if ($finfo) {
finfo_close($finfo);
}
if (!is_string($mime) || !str_starts_with($mime, 'image/')) {
return null;
}
$data = base64_encode(file_get_contents($absPath));
return "data:{$mime};base64,{$data}";
};
$deviceImageAbs = $toStorageAbs($job_data->device_image ?? null);
$deviceImageDataUri = $imgToDataUri($deviceImageAbs);
$vehicleImageAbs = $toStorageAbs($job_data->vehicle_image ?? null);
$vehicleImageDataUri = $imgToDataUri($vehicleImageAbs);
$rcImageAbs = $toStorageAbs($job_data->rc_image ?? null);
$rcImageDataUri = $imgToDataUri($rcImageAbs);
$capturedImageAbs = $toStorageAbs($job_data->captured_image ?? null);
$capturedImageDataUri = $imgToDataUri($capturedImageAbs);
@endphp
|
To,
The RTO/SRTO
@if($rto->rto_name)
@php
$words = explode(' ', $rto->rto_name);
$rtoName = count($words) > 1 ? implode(' ', array_slice($words, 1)) : $rto->rto_name;
@endphp
{{ $rtoName }}
@else
NIL
@endif
|
|
| VEHICLE OWNER DETAILS |
| Registration No |
{{ $job_data->vehicle_no ?? '-' }} |
| Name |
{{ $job_data->customer_name ?? '-' }} |
| Registration Date |
{{ $job_data->registration_date ?? '-' }} |
| Mobile No |
{{ $job_data->customer_mobile ?? $job_data->mobile ?? '-' }} |
| Address |
{{ $job_data->address ?? '-' }} {{ $job_data->location ?? '-' }} |
|
| VEHICLE DETAILS |
| Chassis No |
{{ $job_data->chassis_no ?? '-' }} |
| Engine No |
{{ $job_data->engine_no ?? '-' }} |
| Vehicle Make |
{{ $job_data->vehicle_make ?? '-' }} |
| Vehicle Model |
{{ $job_data->vehicle_model ?? '-' }} |
|
| VEHICLE DEVICE DETAILS |
| Monitor Serial No |
{{ $job_data->device_serial_no ?? '-' }} |
| Camera 01 |
{{ $job_data->camera ?? '-' }} |
| Camera 02 |
{{ $job_data->camera_2 ?? '-' }} |
| Camera 03 |
{{ $job_data->camera_3 ?? '-' }} |
| Camera 04 |
{{ $job_data->camera_4 ?? '-' }} |
PRODUCT IMAGES
@if(isset($job_data->vehicle_image) && $job_data->vehicle_image)
@if($vehicleImageDataUri)
@else
Vehicle Image
@endif
|
@else
@endif
Vehicle Image
|
@if(isset($job_data->device_image) && $job_data->device_image)
@if($deviceImageDataUri)
@else
Camera Image
@endif
|
@else
@endif
Camera Image
|
@if(isset($job_data->rc_image) && $job_data->rc_image)
@if($rcImageDataUri)
@else
RC Image
@endif
|
@else
@endif
RC Image
|
@if(isset($job_data->captured_image) && $job_data->captured_image)
@if($capturedImageDataUri)
@else
Captured Image
@endif
|
@else
@endif
Captured Image
|
@php
$airotrackLogoAbs = storage_path('app/public/logo/airotrack.png');
$airotrackLogoPath = is_file($airotrackLogoAbs) ? $airotrackLogoAbs : null;
@endphp