@extends('layout.app')

@section('content')
    <div class="card">
        <div class="card-body">
            <a href="{{ route('pons.create') }}" type="button" class="btn btn-primary float-right">
                Add New PON
            </a>
        </div>

        <div class="card-body">
            <div class="table-responsive">
                <table id="dataTablea" class="table">
                    <thead class="bg-gray-50">
                        <tr>
                            <th>ID</th>
                            <th>Name</th>
                            <th>Type</th>
                            <th>Remarks</th>
                            <th>Action</th>
                        </tr>
                    </thead>
                    <tbody class="bg-white divide-y divide-gray-200">
                        @foreach ($pons as $pon)
                            <tr>
                                <td>{{ $pon->id }}</td>
                                <td>{{ $pon->name }}</td>
                                <td>{{ $pon->type }}</td>
                                <td>{{ $pon->remarks }}</td>
                                <td>
                                    <a href="{{ route('pons.edit', $pon->id) }}" class="btn btn-sm btn-primary">
                                        Edit
                                    </a>
                                    {{-- <form action="{{ route('pons.destroy', $pon->id) }}" method="POST"
                                        style="display:inline-block"
                                        onsubmit="return confirm('Are you sure you want to delete this PON info?');">
                                        @csrf
                                        @method('DELETE')
                                        <button type="submit" class="btn btn-sm btn-danger">
                                            Delete
                                        </button>
                                    </form> --}}
                                </td>
                            </tr>
                        @endforeach
                    </tbody>
                </table>
            </div>

            <div class="mt-3">
                {{ $pons->links() }}
            </div>
        </div>
    </div>
@endsection

