
<div id="print_div">
    <div class="pathology-bill">
<div class="row">
<div class="col-2" style="width: 20%">
    <p>Date : {!! formatedDate(date('Y-m-d')) !!}</p>
</div>
<div class="col-7" style="text-align: center;">
    <p style="color:#0b5ed7;font-size:18px;margin-bottom: -4px !important"><b>{!! $company->name ?? '' !!}</b></p>
    <p style="font-size: 14px;"><b>OPD STATEMENT</b></p>
    <p style="padding-bottom: 5px;font-size: 11px;"><b><span style="color: #698aff;">{!! $bookingType??'' !!}</span> List</b>
    <b>From <span style="color:#698aff;" id="">{{$fromDate?formatedDate($fromDate):formatedDate(date('Y-m-d H:i:s'))}}</span> TO <span style="color:#698aff;" id="">{{$toDate?formatedDate($toDate):formatedDate(date('Y-m-d H:i:s')) }}</span>
            Of Doctor <span id="" style="color:#698aff;">{{$doctorName??''}}</span>
            Shift <span id="" style="color:#698aff;">{{$shiftName??''}}</span>
            
        </b></p>
</div>
<div class="col-2" style="text-align: right; width:20%">
    <p>Time : {!! formatedTime(date('H:i:s')) !!}</p>
</div>
</div>

<div>
    <table class="table table-borderless report-container">
        <tbody class="report-content">
            <tr>
                <td class="report-content-cell">
                    <div class="row">
                        <div class="col-12">

                            <table class="table table-bordered-print w-100 table-only-header-full-width mb-1" id="quotation_products">
                                <thead>
                                    <tr class="text-uppercase">
                                        <th class="thbutton">Sl No</th>
                                        <th style="text-align: left;">Booking</th>
                                        <th style="text-align: left;">Patient Info.</th>
                                        <th style="text-align: left;">Doctor Info.</th>
                                        <th style="text-align: left;">Appointment</th>
                                        <!-- <th style="text-align: left;">Type</th> -->
                                        <th style="text-align: right;">Total</th>
                                        <th style="text-align: right;">Received</th>
                                        <th style="text-align: right;">Due</th>
                                        <th style="text-align: left;">Source</th>
                                        <th style="text-align: left;">Status</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    @php $i=1;@endphp
                                    @if(count($data)>0)
                                    @foreach($data as $key=> $list)
                                    <tr>
                                        <td class="text-center">{{$key+1}}</td>
                                        <td style="text-align: left;">@php $booking_date_time = \Illuminate\Support\Carbon::parse($list->booking_date_time); @endphp
                                            <b>{{$list->booking_no}}</b>
                                            <br>
                                            {{$booking_date_time->format('d-m-Y') ?? ''}}<br>
                                            {{$booking_date_time->format('h:i A') ?? '' }}
                                        </td>
                                        <td style="text-align: left;">
                                            <b>{{$list->patient_title ?? ''}}
                                            {{$list->patient ?? ''}}</b><br>
                                            {{$list->patient_genders ?? ''}}{{ isset($list->patient_date_of_birth) && isset($list->patient_genders) ? ', ' : '' }} {{ isset($list->patient_date_of_birth) ? age($list->patient_date_of_birth) . ' Year`s' : '' }}
                                            <br>
                                            {{ isset($list->patient_phone_no) ?'Ph:'. $list->patient_phone_no:''}}
                                        </td>
                                        <td style="text-align: left;">
                                            <b>{{$list->doctor_title ?? ''}}
                                            {{$list->doctor ?? ''}}</b>
                                            <br>
                                            Shift- {!! $list->appointment_shift??'' !!}
                                        </td>
                                        <td style="text-align: left;">@php $appointment_date_time = \Illuminate\Support\Carbon::parse($list->appointment_date_time); @endphp
                                            {{$appointment_date_time->format('d-m-Y') ?? ''}}<br>
                                            {{$appointment_date_time->format('h:i A') ?? '' }}<br>
                                            <b>#SL.NO. {{$list->appointment_serial_no ?? ''}}</b>
                                        </td>
                                        {{--<td style="text-align: left;">
                                            {{'Consultantion'}}
                                        </td>--}}
                                        <td style="text-align: right;">{{ convertDecimelPoint($list->total_billing) ?? ''}}</td>
                                        <td style="text-align: right;">{{ convertDecimelPoint($list->amount_recieved) ?? ''}}</td>
                                        <td style="text-align: right;">{{ convertDecimelPoint($list->due_balance_amount) ?? ''}}</td>
                                        <td style="text-align: left;">
                                            {{'Walk In'}}
                                        </td>
                                        <td style="text-align: left;">
                                        @if($list->appointment_status=="Done")
                                            <b>Confirm</b>
                                        @else
                                        Pending
                                        @endif
                                        </td>
                                    </tr>
                                    @php $i++; @endphp
                                    @endforeach
                                    @else
                                    <tr>
                                    <td colspan="10" class="text-center">No Data Found</td>
                                    </tr>
                                    @endif

                                </tbody>
                            </table>
                        </div>
                    </div>
                </td>
            </tr>
        </tbody>
    </table>
</div>
</div>
</div>
@if(count($data)>0)
<div class="row">
<div class="col-md-6" style="text-align: right;">
    <button id="btn_print" type="button" class="btn btn-primary btn-lg"><i class="bi bi-printer text-white"></i> Print Statement </button>
</div>

<div class="col-md-6" style="text-align: left;">
    <a href="javascript:;" class="btn btn-outline-primary export-statement"><i class="bi bi-download"></i> Export</a>
</div>
</div>
@endif
