@extends('admin.layouts.header')

@section('title', 'dashboard')


@section('content')
<div class="content-wrapper">
            <!-- Content -->

            <div class="container-xxl flex-grow-1 container-p-y">
              <h4 class="fw-bold py-3 mb-4"><span class="text-muted fw-light">Dashboard /</span> Contacts</h4>

              <div class="row">
                 <div class="col-xl-12 col-lg-12">
				 
						<div class="card shadow mb-4">
                               <div class="card-header py-3">
                                    
									<div class="table-title mb-4">
                <div class="row">
                    <div class="col-sm-5">
                        <h4>User Contact</h4>
                    </div>
                    <div class="col-sm-7 text-end">
                        {{-- <a href="#" class="btn btn-secondary"><i class="fas fa-plus"></i> <span>Add New User</span></a> --}}
                    </div>
                </div>
            </div>
                                </div>
                                <!-- Card Body -->
                                <div class="card-body">
                                    <div class=" pb-2 table-responsive">
									<table class="user-list table table-striped table-hover">
                <thead>
                    <tr>
                        <th>#</th>
                        <th>Name</th>	
                        <th>Company name</th>					
                        <th>Email</th>
                        <th>Phone</th>
                        <th>Address</th>
                        <th>Pincode</th>
                        <th>State</th>
                        <th>City</th>
                        <th>Massege</th>
                        <th>Action</th>
                    </tr>
                </thead>
                <tbody>
                 @if(!empty($contact_list))
                 @foreach($contact_list as $key => $contact)
                        <tr>
                            <td>{{ $key+1 }}</td>
                            <td>{{ $contact->name }}</td>
                            <td>{{ $contact->company_name }}</td>
                            <td>{{ $contact->email }}</td>
                            <td>{{ $contact->phone }}</td>
                            <td>{{ $contact->address }}</td>
                            <td>{{ $contact->pincode }}</td>
                            <td>{{ $contact->state }}</td>
                            <td>{{ $contact->city }}</td>                      
                            <td>{{ $contact->massage }}</td> 
                            <form action="{{ route('contact.destroy',$contact->id) }}" method="post" enctype="multipart/form-data">  
                              @csrf
                              @method('delete')
                            <td> <button type="submit" class="btn btn-danger sm-3" onclick="return confirm('Are you sure you want to delete this item?');"> <i class="fa fa-trash"></i></button></td>                  
                             </form>                  
                        
                        </tr>
                 @endforeach
                 @endif
                    
                </tbody>
            </table>
			
                            </div>
                        </div>
                        <!-- Area -->
                       

                       
                    </div>
					
					
</div>
              </div>
            </div>
            <!-- / Content -->

            <!-- Footer -->
            <footer class="content-footer footer bg-footer-theme">
              <div class="container-xxl d-flex flex-wrap justify-content-between py-2 flex-md-row flex-column">
                <div class="mb-2 mb-md-0">
                  © 2022
                </div>
                
              </div>
            </footer>
            <!-- / Footer -->
          </div>
@endsection