@include('admin/include/header')
<!-- Main Content -->
<div class="main-content">
    <section class="section">
      <div class="section-header">
        <h1>Category</h1>
        <div class="section-header-breadcrumb">
          <div class="breadcrumb-item active"><a href="{{ url('admin/') }}">Dashboard</a></div>
          <div class="breadcrumb-item"><a href="javascript:void (0)">Category</a></div>
          <div class="breadcrumb-item">Add Category</div>
        </div>
      </div>

      <div class="section-body">
        <div class="row">
          <div class="col-12 col-md-12 col-lg-12">
            <div class="card">
              <form id="addCategory">
                <div class="card-header">
                  <h4>Add Category</h4>
                </div>
                <div class="card-body">
                  <div class="form-group">
                    <label>Category Code</label>
                    <input type="text" name="code" class="form-control" />
                  </div>
                  <div class="form-group">
                    <label>Category Title</label>
                    <input type="text" name="title" 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>

      <div class="section-body">
        <div class="row">
          <div class="col-12 col-md-12 col-lg-12">
            <div class="card">
              <form id="addSubCategory">
                <div class="card-header">
                  <h4>Add Sub Category</h4>
                </div>
                <div class="card-body">
                  <div class="form-group">
                    <label>Sub Category Title</label>
                    <input type="text" name="title" class="form-control" />
                  </div>
                  <input type="hidden" name="code" id="code">
                  <div class="form-group">
                    <label>Category Parent</label>
                    <select id="parent" name="parent" class="form-control select2">
                        <option value="">Select Parent</option>
                        @foreach ($data as $parent)
                        <option data-attr="{{$parent->code}}" value={{ $parent->id }}>{{ $parent->title }}</option>
                        @endforeach
                      </select>
                  </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>

@include('admin/include/footer')
