<!DOCTYPE html>
<html>

@include('includes.head')


<body class="hold-transition skin-blue fixed sidebar-mini">
    <!-- Site wrapper -->
    <div class="wrapper">

        @include('includes.header')
        <!-- =============================================== -->

        <!-- Left side column. contains the sidebar -->
        @include('includes.side-nav')

        <!-- =============================================== -->

        <!-- Content Wrapper. Contains page content -->
        <div class="content-wrapper">
            <!-- Content Header (Page header) -->
            <section class="content-header">
                <h1>
                    Enquery
                    <small>Manage Enquery</small>
                </h1>
                <ol class="breadcrumb">
                    <li><a href="#"><i class="fa fa-dashboard"></i> Home</a></li>
                    <li><a href="#">Enquery</a></li>
                    <li class="active">Enquery</li>
                </ol>
            </section>

            <!-- Main content -->
            <section class="content">
                @include('includes.messages')
                <!-- Default box -->
                <div class="box box-primary">
                    <div class="box-header with-border">
                        <h3 class="box-title">Enquery Management</h3>


                    </div>
                    <div class="row">
                        <div class="col-md-12">
                            <div class="box-body">
                                <table id="example2" class="table table-bordered table-hover">
                                    <thead>
                                        <tr>
                                            <th>Sl No</th>
                                            <th>Name</th>
                                            <th>Email</th>
                                            <th>Phone</th>
                                            <th>Subject</th>
                                            <th>Message</th>
                                            <th style="width: 200px">Action</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        @foreach($enquery as $enquery)
                                            <tr>
                                                <td>{{ $loop->iteration }}</td>
                                                <td>{{ $enquery->name }}</td>
                                                <td>{{ $enquery->email ??'' }}</td>
                                                <td>{{ $enquery->phone_number ??'' }}</td>
                                                <td>{{ $enquery->subject ??'' }}</td>

                                                <td>{{ $enquery->message ??'' }}</td>




                                                <td>


                                                    <a href="#" class="btn btn-danger btn-sm" onclick="confirmDelete('{{ route('enquery.delete', $enquery->id) }}')">Delete</a>

                                                    <script>
                                                        function confirmDelete(url) {
                                                            if (confirm('Are you sure you want to delete this doctor?')) {
                                                                window.location.href = url;
                                                            }
                                                        }
                                                    </script>
                                                </td>
                                            </tr>
                                        @endforeach

                                    </tbody>
                                </table>

                            </div>
                            <!-- /.box-body -->
                            <div class="box-footer">
                                {{ $enquery->links() }}
                            </div>

                        </div>

                    </div>

                </div>
                <!-- /.box -->

            </section>
            <!-- /.content -->
        </div>
        <!-- /.content-wrapper -->

        @include('includes.footer')

    </div>
    <!-- ./wrapper -->

    @include('includes.scripts')
</body>

</html>
