@isset($cancelbooking_list)
    @foreach($cancelbooking_list as $rows)
    @php($booking = $rows->booking)

        <tr>
            <td>{{$loop->iteration}}</td>

            <td>{{$booking->ms}}</td>

            <td>{{ucfirst($booking->user->name)}}</td>

            <td>{{$booking->user->cnic}}</td>

            <td>{{$booking->user->contact}}</td>
            <td>{{EF::showPlotFormat($booking->plot)}} </td>

            <td>
                @if($rows->status == "Approve") 
                <span class="badge badge-success">{{EF::getstatus($rows->status)}}</span>

                @elseif($rows->status == "Pending") 
                <span class="badge badge-primary">{{EF::getstatus($rows->status)}}</span>

                @else
                <span class="badge badge-warning"> {{$rows->status}}</span>

                @endif
            </td>
            
            <td>{{$booking->branch->name}}</td>
            
            <td>{{EF::dateFormat($rows->created_at)}}</td>

            <td class="text-center"> 
                <div class="item-action dropdown">
            <a href="javascript:void(0)" data-toggle="dropdown" class="icon"><i class="fa fa-list-ul"></i></a>
            <div class="dropdown-menu dropdown-menu-right">
                
                    @if(Auth::user()->hasAnyPermission(['All','View Cancel Form']))
                <a  href="{{route('document.cancelbooking',['id' => Crypt::encrypt($booking->id)])}}"  class="dropdown-item"><i class="dropdown-icon fa fa-file "></i>Cancel Document</a>
                @endif

                    @if(Auth::user()->hasAnyPermission(['All','Cancel Booking Details']))
                <a  href="{{route('bookingcancel.details',['id' => Crypt::encrypt($booking->id)])}}" content="View Details" class="dropdown-item"><i class="dropdown-icon fa fa-eye "></i> View Details</a>
                @endif

                @if(Auth::user()->hasAnyPermission(['All','Cancel Booking Ledger']))
                    <a onclick="showCancelBookingLedger(event,'{{Crypt::encrypt($booking->id)}}');" href="javascript:void(0)" class="dropdown-item"><i class="dropdown-icon fa fa-money"></i>Cancel Booking Ledger</a>
                    @endif  
                    
                    @if(Auth::user()->hasAnyPermission(['All']))  
                        @if($rows->status == 'Pending')
                        <a  href="{{route('approvecancelbooking',['id' => Crypt::encrypt($booking->id)])}}"  class="dropdown-item "><i class="dropdown-icon fas fa-check "></i>Approve</a>
                        @endif

                    @endif

                    @if(Auth::user()->hasAnyPermission(['All','Remove Cancel Booking']) && $rows->isVerifyCancelBooking($rows->id)['status'] == true)
                        <a  href="{{route('removecancelbooking',['id' => Crypt::encrypt($rows->id)])}}"  class="dropdown-item  cls_delete" content="remove cancel booking"><i class="dropdown-icon fas fa-trash "></i>Remove Cancel</a>

                    @endif
                
            </td>
        </tr>

    @endforeach
@endisset   
    
