
    @isset($booking_list)
    @foreach($booking_list as $rows)
     @php(
                        $pass_data = array(
                            'id'                       => Crypt::encrypt($rows->id),
                            'reg_date'                 => EF::dateFormat(($rows->created_at)),

                          )
                      )

    <tr  @if($rows->is_block == 1) style = "background-color:pink;" @endif  >
      <td>{{$loop->iteration}}</td>

      <td>{{$rows->ms}}</td>
      <td>{{$rows->file_number}}</td>


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


      <td>{{EF::showPlotFormat($rows->plot)}} </td>


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



      <td>{{$rows->branch->name}}</td>

      @php($booking_salesperson = $commission->getBookingSalesPerson($rows->id))
      
      <td >
      
        @foreach($booking_salesperson as $row)
          @if($row->user->type == "Employee")
        <span class="badge badge-primary"> {{strtoupper($row->user->name)}}</span>
         @endif

        @endforeach
       
      </td>

      <td>{{EF::dateFormat($rows->created_at)}}</td>
        @if(Auth::user()->hasAnyPermission(['All','Tag Booking']))
      <td>

        <span style ="margin-right :4px;" onClick = "markTags(event,this,'{{Crypt::encrypt($rows->id)}}','{{$rows->is_hotitem}}','{{Crypt::encrypt('is_hotitem')}}')">
          @if($rows->is_hotitem == 0)
          <img src= " {{asset('assets/images/icons/staroutline.png')}}" data-toggle="tooltip" data-placement="top" title="Mark Hot"/>
          
          @elseif($rows->is_hotitem == 1)
          <img src= "{{asset('assets/images/icons/starfilled.png')}}" data-toggle="tooltip" data-placement="top" title="Unmark Hot"/>

          
        @endif</span>
       
         <span style ="margin-right :4px;"  onClick = "markTags(event,this,'{{Crypt::encrypt($rows->id)}}','{{$rows->is_block}}','{{Crypt::encrypt('is_block')}}')">
          @if($rows->is_block == 0)
          <img src= " {{asset('assets/images/icons/blockoutline.png')}}" data-toggle="tooltip" data-placement="top" title="Block"/>
          @else
          <img src= " {{asset('assets/images/icons/blockfilled.png')}}" data-toggle="tooltip" data-placement="top" title="Unblock"/>
          @endif
        </span>
         <span  onClick = "markTags(event,this,'{{Crypt::encrypt($rows->id)}}','{{$rows->is_resale}}','{{Crypt::encrypt('is_resale')}}')">
          @if($rows->is_resale == 0)
           <img width = "18px;" src= " {{asset('assets/images/icons/saleoutline.png')}}" data-toggle="tooltip" data-placement="top" title="Mark Resale"/>
          @else
           <img  width = "18px;" src= " {{asset('assets/images/icons/salefilled.png')}}" data-toggle="tooltip" data-placement="top" title="Unmark Resale"/>
          @endif
        </span>
      </td>
      @endif

      <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','Booking Details']))
         <a  href="{{route('booking.details',['id' => Crypt::encrypt($rows->id)])}}" content="View Details" class="dropdown-item"><i class="dropdown-icon fa fa-eye "></i> View Details</a>
         @endif

          @if(Auth::user()->hasAnyPermission(['All','Approve Booking']))
         @if($rows->status == "Unapprove")
         <a  onclick="update(event,'{{json_encode($pass_data)}}','form_approve_booking','md_approve_booking')" href="javascript:void(0)" class="dropdown-item"><i class="dropdown-icon fa fa-check"></i>Approve </a>
         @endif
         @endif
         @if(Auth::user()->hasAnyPermission(['All','Delete Booking']))

         <a  href="{{route('booking.trash',['id' => Crypt::encrypt($rows->id)])}}"  class="dropdown-item cls_delete" content="delete"><i class="dropdown-icon fa fa-trash "></i> Delete </a>
         @endif
         

         @if($rows->status == "Approve")
          @if(Auth::user()->hasAnyPermission(['All','Cancel Booking Request']))

         <a  href="{{route('showcancelbooking',['id' => Crypt::encrypt($rows->id)])}}"  class="dropdown-item "><i class="dropdown-icon fas fa-times "></i> Cancel </a>
         @endif
          @if(Auth::user()->hasAnyPermission(['All','Transfer Booking Request']))

         <a  href="{{route('booking.transfer',['id' => Crypt::encrypt($rows->id)])}}" content="Transfer" class="dropdown-item"><i class="dropdown-icon fa fa-eye "></i>Transfer</a>
         @endif
         @endif

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

           @if(Auth::user()->hasAnyPermission(['All','View Document']))
            <a onclick="showDocument(event,'{{Crypt::encrypt($rows->id)}}');" href="javascript:void(0)" class="dropdown-item"><i class="dropdown-icon fa fa-file"></i> Documents</a>
         @endif
       </div>
     </div>

   </td>
 </tr>

 @endforeach
 @endisset   
