$title = 'SubAdmin'
  @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">
                  <form id="vendors">
                    @csrf
                    <div class="card-header">
                      <h4>Add Vendors</h4>
                    </div>
                    
                    <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>Password</label>
                        <input type="password" id="password" name="password" class="form-control" required="">
                      </div>
                      <div class="form-group">
                        <label>Address</label>
                        <textarea id="address" name="address" class="form-control"></textarea>
                      </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>
                    <div class="card-footer text-right">
                      <button type="submit" class="btn btn-primary">Submit</button>
                    </div>
                  </form>
                </div>
                
              </div>
              
            </div>
          </div>
        </section>
      </div>
      
    </div>
  </div>

  @include('admin.include.footer')
  <script>
    $(document).ready(function() {
      $('#vendors').on('submit', function(e) {
        e.preventDefault();
        axios.post('http://localhost/ecommerce/admin/create_vendors', new FormData(this))
          .then((res) => { 
            if (res.data){
              document.getElementById("vendors").reset();
              show_Toaster('Vendor Created Successfully','success');
            }
            else {
                show_Toaster('Operation failed','fail');
            }
          });
      });
    });
  </script>
</body>

</html>
