
@if($logs->count() > 0)
{{-- @dd(config('GET.admin_time_format_seconds')); --}}
    @foreach ($logs as $index => $log)
        <tr>
            <td>{{ $index + 1 }}</td>
            @if($logType != 'area-selection')
                <td>{{ $log->created_at? \Carbon\Carbon::parse($log->created_at)->format(config('GET.admin_date_format')):"" }}</td>           
                @if($logType != 'member-activity')
                <td>{{ $log->created_at? \Carbon\Carbon::parse($log->created_at)->format(config('GET.admin_time_format_seconds')):"" }}</td>
                @endif
            @endif
            @if($logType == 'pause-unpause')            
                <td>{{ $log->member ? $log->member->account_number : "-" }}</td>
                <td class="text-center">{{ $log->member ? $log->member->company_name : "-" }}</td>
                <td class="text-center">{{ $log->action == 1 ? "Pause":"Unpause" }}</td>
                <td class="text-center">{{ $log->performed_by == 1 ? "Admin": $log->performedby?->company_name }}</td>
                
                @elseif($logType == 'suspend-unsuspend')
                <td>{{ $log->member ? $log->member->account_number : "-" }}</td>
                <td class="text-center">{{ $log->member ? $log->member->company_name : "-" }}</td>
                <td class="text-center">{{ $log->action == 1 ? "Suspend":"Unsuspend" }}</td>  
                <td class="text-center">{{ $log->performedBy?->name ?? '-' }}</td>
            @elseif($logType == 'area-selection')
                <td>{{ $log->date? \Carbon\Carbon::parse($log->date)->format(config('GET.admin_date_format')):"" }}</td>
                <td>{{ $log->time? \Carbon\Carbon::parse($log->time)->addHour()->format(config('GET.admin_time_format_seconds')):"" }}</td>
                <td>{{ $log->member ? $log->member->account_number : "-" }}</td>
                <td class="text-center">{{ $log->member ? $log->member->company_name : "-" }}</td>
                <td class="text-center">{{ $log->area_selected ?? '-' }}</td>
                <td class="text-center">{{ $log->area_deselected ?? '-' }}</td>
                <td class="text-center">{{ $log->current_selection ?? '-' }}</td>
                <td>{{ $log->area_total ?? '-' }}</td>
                <td>{{ $log->performed_by!=null ? $log->performed_by == $log->member_id ? $log->member?->company_name:$log->admin?->name: '-' }}</td>
                
            @elseif($logType == 'password-change')
                <td>{{ $log->member ? $log->member->account_number : "-" }}</td>
                <td class="text-center">{{ $log->member ? $log->member->company_name : "-" }}</td>
            @elseif($logType == 'golden-member')
                <td>{{ $log->member ? $log->member->account_number : "-" }}</td>
                <td class="text-center">{{ $log->member ? $log->member->company_name : "-" }}</td>
                <td class="text-center">{{ $log->action == 1 ? 'PDF':'Standard' }}</td>
            @elseif($logType == 'lead-limitation')
                <td>{{ $log->member ? $log->member->account_number : "-" }}</td>
                <td class="text-center">{{ $log->member ? $log->member->company_name : "-" }}</td>
                <td>{{ $log->lead ?? '-' }}</td>
                <td class="text-center">{{ $log->performed_by == 1 ? "Admin": $log->performedby?->company_name }}</td>
            @elseif($logType == 'nature-change')            
            <td>{{ $log->member ? $log->member->account_number : "-" }}</td>
            <td class="text-center">{{ $log->member ? $log->member->company_name : "-" }}</td>
            <td class="text-center">
                @if($log->action == 1)
                    Open
                @elseif($log->action == 2)
                    Close
                @else
                    Temp
                @endif
            </td>
            <td class="text-center">{{ $log->performed_by == 1 ? "Admin": $log->member?->company_name }}</td>
            @elseif($logType == 'member-activity')
            <td>{{ $log->created_at ?  \Carbon\Carbon::parse($log->created_at)->format(config('GET.admin_time_format_seconds')):"" }}</td>
            <td>{{ $log->member ? $log->member->account_number : "-" }}</td>
            <td class="text-center">{{ $log->member ? $log->member->company_name : "-" }}</td>
            <td class="text-center">
                @if($log->action == 1)
                    Login
                @else
                    Logout
                @endif
            </td>
            @endif

        </tr>
    @endforeach
    <tr>
     <td colspan="10" class="text-center" id="pagination-container">
        {{ $logs->links() }}
        {{-- Pagination will be injected via AJAX --}}
    </td>
</tr>
@else
    <tr>
        <td colspan="10" class="text-center">No records found</td>
    </tr>
@endif
