@extends('Admin.layouts.master')

@section('content')
@php
  $currentPage = 'manage-customer';
@endphp

<div class="layout-px-spacing">
            <div class="middle-content container-xxl p-0">
                <div class="row layout-top-spacing ">
                    <div class="top-tabel">
                        <div class="row">
                            <div class="col-md-4">
                                <!-- <h6 class="card-title">Archive patient list</h6> -->
                                <a class="d-flex align-items-center justify-content-center pl-2" href="{{url('/manage-customer')}}">
                                    <img class="back-btn" src="{{ asset('public/assets/img/left-arrow.svg')}}">
                                    <h6 class="card-title p-0">Archive Manage Customers</h6>
                                </a>
                            </div>

                        </div>
                    </div>
                    <div class="col-xl-12 col-lg-12 col-sm-12  layout-spacing">
                        <div class="widget-content widget-content-area br-8 position-btn" style="overflow: scroll;">
                            <table id="zero-config" class="table dt-table-hover" style="width:100%">
                                <thead class="text-center">
                                    <tr>
                                        <th class="text-start">Sr no</th>
                                        <th class="text-start">Full Name</th>
                                        <th class="text-start">User ID</th>
                                        <th class="text-start">Email Id</th>
                                        <th class="text-start">Date of birth</th>
                                        <th class="text-start">Phone Number</th>
                                        {{-- <th class="text-start">Location</th> --}}
                                        <th>Action</th>
                                    </tr>
                                </thead>
                                <tbody class="text-center">
                                    @foreach ($customers as $customer)
                                    <tr>
                                        <td class="text-start">{{$loop->iteration }}</td>
                                        <td class="text-start">{{$customer->first_name }}</td>
                                        <td class="text-start">{{$customer->id }}</td>
                                        <td class="text-start">{{$customer->email_address }}</td>
                                        <td class="text-start">{{$customer->date_of_birth }}</td>
                                        <td class="text-start">{{$customer->phone_number }}</td>
                                        {{-- <td class="text-start">New York</td> --}}
                                        <td class="view-transcation">
                                            <a class="cust_unarchive_btn" data-id="{{$customer->id}}" href="" data-toggle="modal" data-target="#restore-modal">
                                                <img src="{{ asset('public/assets/img/restore.svg')}}" />
                                                <span>Restore</span>
                                            </a>
                                        </td>
                                    </tr>
                                    @endforeach
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
</div>
<div class="modal fade" id="restore-modal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"
    aria-hidden="true">
    <div class="modal-dialog modal-dialog-centered" role="document">
        <div class="modal-content">

            <div class="modal-body">
                <div class="modal-header">
                    <button type="button pointer" class="btn-close" data-dismiss="modal" aria-label="Close">
                        x
                    </button>
                </div>
                <input type="hidden" id="unarchive_id" name="unarchive_customer_id">
                <p class="modal-text restore-modal-heading">Are you sure you want to<br>Unarchive?</p>
                <div class="modal-btn d-flex ">
                    <a class="extra-btn pointer" data-dismiss="modal">No</a>
                    <a class="download-btn-custom customer_unarchive" href="">Yes, Unarchive</a>
                </div>

            </div>
        </div>
    </div>
</div>

@endsection


@section('section_script')
<script src="{{ asset('public/assets/js/admin/manage_customer/main.js')}}"></script>
<script>
    $(document).ready(function () {
        $('<button><a class="extra-btn width-max-content" href="{{ route('manage.customer') }}">View List</a></button>').insertBefore("#zero-config_filter label");
    });
</script>
@endsection
