$title = 'Manage Vendor'
@include('admin.include.header')

<!-- Main Content -->
<div class="main-content">
  <section class="section">
    <div class="section-body">
      <div class="row">
        <div class="col-12 col-md-6 col-lg-6">
          <div class="card">
            <div class="row">
              <div class="col-12 col-md-6 col-lg-6">
                <div class="card">
                  <div class="card-header">
                    <h4>Manage Vendors</h4>
                  </div>
                  <div class="card-body">
                    <table class="table">
                      <thead>
                        <tr>
                          <th scope="col">#</th>
                          <th scope="col">Name</th>
                          <th scope="col">Mobile</th>
                          <th scope="col">Email</th>
                          <th scope="col">Address</th>
                          <th scope="col">State</th>
                          <th scope="col">City</th>
                          <th scope="col">Edit</th>
                        </tr>
                      </thead>
                      <tbody>
                        @foreach($data as $vendor)
                        <tr>
                          <th scope="row">{{$vendor->id}}</th>
                          <td>{{$vendor->name}}</td>
                          <td>{{$vendor->mobile}}</td>
                          <td>{{$vendor->email}}</td>
                          <td>{{$vendor->address}}</td>
                          <td>{{$vendor->state}}</td>
                          <td>{{$vendor->city}}</td>
                          <td><button class="editVendor" name="edit" value="edit" data-toggle="modal" data-data="{{$vendor}}" data-target="#modall">Edit</button></td>
                        </tr>
                        @endforeach
                      </tbody>
                    </table>
                  </div>
                </div>

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

        </div>

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

</div>
</div>
<div class="modal fade" tabindex="-1" role="dialog" id="modall">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-body">
        <form id="managevendor">
          @csrf
          <input type="hidden" id="id" name="id" class="form-control" required="">
          <div class="card-body">
            <div class="form-group">
              <label>Name</label>
              <input type="text" id="name" name="name" class="form-control" required="">
            </div>
            <div class="form-group">
              <label>Email</label>
              <input type="email" id="email" name="email" class="form-control" required="">
            </div>
            <div class="form-group">
              <label>Mobile</label>
              <input type="text" id="mobile" name="mobile" class="form-control">
            </div>
            <div class="form-group">
              <label>Address</label>
              <input type="text" id="address" name="address" class="form-control">
            </div>
            <div class="form-group">
              <label>State</label>
              <input type="text" id="state" name="state"  class="form-control">
            </div>
            <div class="form-group">
              <label>City</label>
              <input type="text" id="city" name="city" class="form-control">
            </div>

          </div>
          <button type="submit" class="btn btn-primary">Submit</button>
        </form>
      </div>
    </div>
  </div>
</div>

@include('admin.include.footer')