@extends(ucfirst(activeGuard()).'.'.layout())

@section('pagetitle', __('trans.countries'))
@section('content')

<table class="table dataTable  data-table" >
    <thead>
        <tr>
            <th>#</th>
            @if(hasPermission('show_regions'))
            <th>@lang('trans.regions')</th>
            @endif
            <th>@lang('trans.title_ar')</th>
            <th>@lang('trans.title_en')</th>
            <th>@lang('trans.free_delivery')</th>
            <th>@lang('trans.image')</th>
            @if(hasPermission('edit_countries'))
            <th>@lang('trans.status')</th>
            <th></th>
            @endif
        </tr>
    </thead>
    <tbody>
        @foreach ($Countries as $Model)
        <tr>
            <td>{{ $loop->iteration }}</td>
            @if(hasPermission('show_regions'))
            <td><a  href="{{ route(activeGuard().'.countries.show', $Model) }}">@lang('trans.regions')</a></td>
            @endif
            <td>{{ $Model->title_ar }}</td>
            <td>{{ $Model->title_en }}</td>
            <td>{{ $Model->free_delivery }}</td>
            <td><img src="{{ asset($Model->image) }}" style="max-width: 80px"></td>
            @if(hasPermission('edit_countries'))
                <td>
                    <input class="toggle" type="checkbox" onclick="toggleswitch({{ $Model->id }},'countries')" @if ($Model->status) checked @endif>
                </td>
                <td>
                    <a href="{{ route(activeGuard().'.countries.edit', $Model) }}"><i class="fa-solid fa-pen-to-square"></i></a>
                </td>
            @endif
        </tr>
        @endforeach
    </tbody>
</table>

@endsection
