@extends('layouts.app')

@section('title', $report->report_title)

@section('css')
@include('vetClinic::partials._mobile_responsive')
@endsection

@section('content')
<section class="content-header">
    <h1>
        <i class="fas fa-file-medical"></i> {{ $report->report_title }}
        @php $colors = ['lab'=>'info','xray'=>'primary','ultrasound'=>'warning','ecg'=>'success','other'=>'default']; @endphp
        <span class="label label-{{ $colors[$report->report_type] ?? 'default' }}" style="font-size:13px;">
            {{ ucfirst($report->report_type) }}
        </span>
    </h1>
    <ol class="breadcrumb">
        <li><a href="{{ route('vc.medical-reports.index') }}">@lang('vetClinic::lang.medical_reports')</a></li>
        <li class="active">{{ $report->report_title }}</li>
    </ol>
</section>

<section class="content">
    <div class="row">
        <div class="col-md-4">
            @component('components.widget', ['class' => 'box-primary', 'title' => 'Report Info'])
                <dl class="dl-horizontal" style="margin:0;font-size:13px;">
                    <dt>Pet</dt>
                    <dd><a href="{{ route('vc.pets.show', $report->pet_id) }}">{{ optional($report->pet)->petname }}</a>
                        <small class="text-muted">({{ optional($report->pet)->species }})</small>
                    </dd>
                    <dt>Owner</dt>
                    <dd>{{ optional($report->owner)->name }}<br>
                        <small>{{ optional($report->owner)->mobile }}</small>
                    </dd>
                    <dt>Doctor</dt>
                    <dd>{{ optional($report->doctor)->name ?? '—' }}</dd>
                    <dt>Type</dt>
                    <dd><span class="label label-{{ $colors[$report->report_type] ?? 'default' }}">{{ ucfirst($report->report_type) }}</span></dd>
                    <dt>Date</dt>
                    <dd>{{ $report->created_at->format('d M Y') }}</dd>
                    @if($report->appointment_id)
                    <dt>Appointment</dt>
                    <dd><a href="{{ route('vc.appointments.show', $report->appointment_id) }}">View</a></dd>
                    @endif
                </dl>
                <hr>
                <div class="btn-group btn-group-sm" style="width:100%;">
                    @can('vet_clinic.manage_reports')
                    <a href="{{ route('vc.medical-reports.edit', $report->id) }}" class="btn btn-default">
                        <i class="fa fa-edit"></i> Edit
                    </a>
                    @endcan
                    <button onclick="window.print()" class="btn btn-info">
                        <i class="fa fa-print"></i> @lang('vetClinic::lang.print')
                    </button>
                </div>
            @endcomponent
        </div>

        <div class="col-md-8">
            @component('components.widget', ['class' => 'box-default', 'title' => 'Findings & Results'])
                @if($report->findings)
                    <pre style="font-family:inherit;white-space:pre-wrap;background:none;border:none;padding:0;">{{ $report->findings }}</pre>
                @else
                    <p class="text-muted">No findings recorded.</p>
                @endif
            @endcomponent
        </div>
    </div>
</section>
@endsection
