@extends('master')

@section('content')
      <!-- partial -->
      <div class="main-panel">
        <div class="content-wrapper">
          <div class="row">
            <div class="col-md-12 grid-margin">
              <div class="row">
                <div class="col-12 col-xl-8 mb-4 mb-xl-0">
                  <h3 class="font-weight-bold">Settings</h3>
                  <h6 class="font-weight-normal mb-0"></h6>
                </div>
                <div align="right" class="col-12 col-xl-4 justify-content-end">
                    
                </div>
              </div>
            </div>
          </div>

          

          <div class="row">
          <div class="col-md-12 grid-margin stretch-card">
              <div class="card">
                <div class="card-body">
                  <p class="card-title mb-0">Site Settings</p>
                  <div class="table-responsive">
                    <table class="table table-striped table-borderless">
                      <thead>
                        <tr>
                        <th>Website Name</th>
                        <th>Logo</th>
                        <th>Favicon</th>
                          <th>Email</th>
                          <th>Phone</th>
                          <th>Address</th>
                          <th>Actions</th>
                        </tr>  
                      </thead>
                      <tbody>
                        @if(count($site) > 0)
                          @foreach($site as $vel)
                            
                        <tr>
                        <td>{{$vel->name}} </td>
                        <td><img src="{{url('/')}}/{{$vel->image}}" style="height:50px;width:50px;"></td>
                        <td><img src="{{url('/')}}/{{$vel->fav}}" style="height:50px;width:50px;"></td>
                        <td>{{$vel->email}}</td>
                        <td>{{$vel->phone}}</td>
                        <td>{{$vel->address}}</td>
                        <td class="font-weight-medium">
                            <a href="#edit{{$vel->id}}" data-toggle="modal" class="btn btn-primary rounded"> Update </a>
                            </td>
                        </tr>
                        @endforeach
                        @else
                        <tr><td colspan="8"> No Site Settings record </td></tr>
                      @endif
                      </tbody>
                    </table>
                  </div>
                </div>
              </div>
            </div>
          </div>
          
        @if(count($site)>0)
            @foreach($site as $vol)
            <div class="modal" tabindex="-1" role="dialog" id="edit{{$vol->id}}">
                    <div class="modal-dialog modal-md" role="document">
                      <div class="modal-content" style="background-image:url('{{url('/')}}/images/carousel/banner_4.jpg');background-repeat:no-repeat;background-size:cover;">
                        <div class="modal-header">
                          <h4 class="modal-title text-white">Update Setings</h4>
                          <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                            <span aria-hidden="true">&times;</span>
                          </button>
                        </div>
                        <div class="modal-body">
                          <form method="post" action="{{route('site.update')}}" enctype="multipart/form-data">
                              @csrf
                              <div class="form-group">
                                  Company Name:<br>
                                <input type="text" class="form-control form-control-lg" name="name" value="{{$vol->name}}" id="exampleInputEmail1" placeholder="Website Name">
                              </div>
                              <div class="form-group">
                                  Email Address:<br>
                                <input type="email" class="form-control form-control-lg" name="email" value="{{$vol->email}}" id="exampleInputEmail1" placeholder="Email Address">
                              </div>
                              <div class="form-group">
                                  Phone Number:<br>
                                <input type="tel" class="form-control form-control-lg" value="{{$vol->phone}}" name="phone" id="exampleInputEmail1" placeholder="Phone Number">
                              </div>
                              <div class="form-group">
                                  Address:<br>
                                <input type="text" class="form-control form-control-lg" name="address" value="{{$vol->address}}" id="exampleInputEmail1" placeholder="Address">
                              </div>
                             
                              <div class="form-group">
                                  Site Favicon:<br>
                                <input type="file" class="form-control form-control-lg" name="fav" id="exampleInputEmail1" placeholder="Username">
                              </div>
                              <div class="form-group">
                                  Site Logo:<br>
                                <input type="file" class="form-control form-control-lg" name="image" id="exampleInputEmail1" placeholder="Username">
                              </div>
                              <input type="hidden" name="sid" value="{{$vol->id}}">
                        </div>
                        <div class="modal-footer">
                          <button type="submit" class="btn btn-primary">Update</button>
                          <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
                        </div>
                        </form>
                      </div>
                    </div>
                  </div>
                @endforeach
                @endif

                  
                
        <!-- content-wrapper ends -->
        <!-- partial:partials/_footer.html -->
@stop