<x-app-layout>
    @include('admin.include.sidebar')

    <!-- Page Content  -->
    <div class="wrapper">
        <!-- Sidebar  -->


        <!-- Page Content  -->
        <div id="content" style="padding: 20px 0;">
            <!-- <button class="btn btn-danger mb-4" > <a href='{{route("setting.create")}}'>Create New Settings</a> </button> -->
            <div class="navbar-expand-lg navbar-light bg-light">
                <table id="example" class="table table-striped table-bordered dark" style="width:100%">
                    <thead>
                        <tr>
                            <th>ID</th>
                            <th>Min. Days</th>
                            <th>Min. Licence</th>
                            <th>Card Payment</th>
                            <th>Cash Payment</th>
                            <th>iOS Version</th>
                            <th>Android Version</th>
                            <th>Action</th>
                        </tr>
                    </thead>
                    <tbody>
                        @foreach ($coupon as $item)
                        <tr>
                            <td>{{$item->id}}</td>
                            <td>{{$item->minday}}</td>
                            <td>{{$item->min_lic_yr}}</td>
                            <td>
                                {{$item->cardpay == 1 ? 'Yes' : 'No'}}
                            </td>
                            <td>
                                {{$item->cashpay == 1 ? 'Yes' : 'No'}}
                            </td>
                            <td>{{$item->iosversion}}</td>
                            <td>{{$item->andversion}}</td>
                            <td class="action">
                                    <a class="btn btn-info" href="{{route('setting.edit',$item->id)}}"><i class="fas fa-edit"></i></a>
                                <form action="{{ route('setting.destroy', $item->id) }}" method="POST" style="display: contents;">
                                    @csrf
                                    @method('delete')
                                    <button type="submit" class="btn btn-danger" onclick="return condelete()"><i class="fas fa-trash"></i></button>
                                </form>
                            </td>
                        </tr>
                        @endforeach
                    </tbody>
                </table>
            </div>


        </div>
    </div>

    <script type="text/javascript">
        function condelete() {
            var message = confirm("Do you really want to delete");
            if (message == true) {
                return true;
            } else {
                return false;
            }
        }
        bootbox.confirm("Are you sure?", function(result) {
            Example.show("Confirm result: " + result);
        });
    </script>
</x-app-layout>
