@extends('backend.layouts.master')
@section('title','E-SHOP || Add Lead')
@section('main-content')

<div class="card">
    <h5 class="card-header">Add Leads</h5>
    <div class="card-body">
      <form method="post" action="{{route('leads.store')}}">
        {{csrf_field()}}

        <div class="form-group">
          <label for="name" class="col-form-label">Name <span class="text-danger">*</span></label>
          <input id="name" type="text" name="name" placeholder="Enter name"  value="{{old('name')}}" class="form-control">
          @error('name')
          <span class="text-danger">{{$message}}</span>
          @enderror
        </div>

        <div class="form-group">
          <label for="email" class="col-form-label">Email <span class="text-danger">*</span></label>
          <input id="email" type="text" name="email" placeholder="Enter email"  value="{{old('email')}}" class="form-control">
          @error('email')
          <span class="text-danger">{{$message}}</span>
          @enderror
        </div>

        <div class="form-group">
          <label for="phone" class="col-form-label">Phone <span class="text-danger">*</span></label>
          <input id="phone" type="text" name="phone" placeholder="Enter phone"  value="{{old('phone')}}" class="form-control">
          @error('phone')
          <span class="text-danger">{{$message}}</span>
          @enderror
        </div>

        <div class="form-group">
          <label for="ip" class="col-form-label">IP Address</label>
          <input id="ip" type="text" name="ip" placeholder="Enter ip"  value="{{old('ip')}}" class="form-control">
          @error('ip')
          <span class="text-danger">{{$message}}</span>
          @enderror
        </div>

        <div class="form-group">
          <label for="city" class="col-form-label">City</label>
          <input id="city" type="text" name="city" placeholder="Enter city"  value="{{old('city')}}" class="form-control">
          @error('city')
          <span class="text-danger">{{$message}}</span>
          @enderror
        </div>

        <div class="form-group">
          <label for="region" class="col-form-label">Region</label>
          <input id="region" type="text" name="region" placeholder="Enter region"  value="{{old('region')}}" class="form-control">
          @error('region')
          <span class="text-danger">{{$message}}</span>
          @enderror
        </div>

        <div class="form-group">
          <label for="country" class="col-form-label">Country</label>
          <input id="country" type="text" name="country" placeholder="Enter country"  value="{{old('country')}}" class="form-control">
          @error('country')
          <span class="text-danger">{{$message}}</span>
          @enderror
        </div>

        <div class="form-group mb-3">
          <button type="reset" class="btn btn-warning">Reset</button>
           <button class="btn btn-success" type="submit">Submit</button>
        </div>
      </form>
    </div>
</div>

@endsection

@push('styles')
<link rel="stylesheet" href="{{asset('backend/summernote/summernote.min.css')}}">
@endpush
@push('scripts')
<script src="/vendor/laravel-filemanager/js/stand-alone-button.js"></script>
<script src="{{asset('backend/summernote/summernote.min.js')}}"></script>
<script>
    $('#logo').filemanager('image');
</script>
<script>
  var row = 0;
  function addRow() {
      html = '<tr id="faqs-row' + row + '">';
      html += '<td><input type="text" name="services[]" class="form-control" /></td>';
      html += '<td><input type="text" name="prices[]" class="form-control" /></td>';
      html += '<td class="mt-10"><button class="badge badge-danger" onclick="$(\'#faqs-row' + row + '\').remove();"><i class="fa fa-trash"></i> Delete</button></td>';
      html += '</tr>';

    $('#faqs tbody').append(html);
    row++;
  }
</script>
@endpush