@extends('layouts.app')
@section('title','Category')
@section('pages')


<!--breadcrumb-->
<div class="page-breadcrumb d-flex align-items-center mb-3 px-3 px-md-0">
    <div class="breadcrumb-title pe-3"><i class="bi bi-list"></i>Library Category</div>
    <div class="ps-3">
        <nav aria-label="breadcrumb">
            <ol class="breadcrumb mb-0 p-0">

                <li class="breadcrumb-item active" aria-current="page">Add New Category</li>
            </ol>
        </nav>
    </div>
    <div class="ms-auto">
        <div class="btn-group">
            <a href="{{route('genres.index')}}" class="btn btn-outline-secondary"><i class="bx bx-arrow-back ms-0 me-1"></i>Back</a>
        </div>
    </div>
</div>
<!--end breadcrumb-->


<div class="row auto">
  <div class="col-xl-12 mx-auto">
    <div class="shadow-none radius-5 min-height">
      <div class="">
        <div class="">
          <form class="g-3 row auto-width" action="{{route('genres.store')}}" class="ajaxformfileupload" method="POST" enctype='multipart/form-data'>
            <!-- For validation comment on -->
            @csrf
            <div class="col-md-6 col-sm-12">
              <div class="card">
                <div class="card-body">
                  <div class="g-3 row">
                    <h5 class="mb-0">Category</h5>
                    <hr class="mb-0">
                    <div class="col-md-12">
                     <label for="name" class="form-label">Category Name <span class="text-danger"><b>*</b></span></label>
                     <input type="text" class="form-control" name="name" id="name" placeholder="Category(Genres)" required="">
                     @if ($errors->has('name'))
                     <span class="text-danger">{{ $errors->first('name') }}</span>
                     @endif
                   </div>
                    <div class="col-md-12">
                     <label for="name" class="form-label">Category Code <span class="text-danger"><b>*</b></span></label>
                     <input type="text" class="form-control" name="code" id="code" placeholder="Category(Code)" required="">
                     @if ($errors->has('code'))
                     <span class="text-danger">{{ $errors->first('name') }}</span>
                     @endif
                   </div>

                   <div class="col-md-12">
                    <label for="name" class="form-label">Description</label>
                    <textarea name="description" id="description" class="form-control" placeholder="Description"></textarea>
                    @if ($errors->has('description'))
                    <span class="text-danger">{{ $errors->first('description') }}</span>
                    @endif
                  </div>
                  <div class="col-12" align="center">
                  <div class="d-grid gap-2 with-50">
                <button class="btn btn-primary"  type="submit"><i class="bx bx-save"></i> Save Data</button>
                </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
          <div class="col-md-6 col-sm-12">
            <div class="card">
              <div class="card-body">
                <div class="g-3 row">
                  <h5 class="mb-0">Category Images</h5>
                  <hr class="mb-0">
                  <div class="col-md-12">
                    <label for="name" class="form-label">Cover Small Image (Size 200 KB)</label>
                    <input type="file" class="form-control" name="cover_image_small" id="name" placeholder="Name">
                    @if ($errors->has('cover_image_small'))
                    <span class="text-danger">{{ $errors->first('cover_image_small') }}</span>
                    @endif
                  </div>
                  <div class="col-md-12">
                    <label for="name" class="form-label">Cover Large Image (Size 200 KB)</label>
                    <input type="file" class="form-control" name="cover_image_large" id="name" placeholder="Name">
                    @if ($errors->has('cover_image_large'))
                    <span class="text-danger">{{ $errors->first('cover_image_large') }}</span>
                    @endif
                  </div>
                  <div class="col-md-6">
                    <div class="form-check form-switch form-switch-lg">
                      <input class="btn-lg form-check-input" type="checkbox" id="flexSwitchCheckDefault" name="isfeatured"  >
                      Is Featured
                    </div>
                  </div>
                  <div class="col-md-6">

                    <div class="form-check form-switch form-switch-lg">
                      <input class="btn-lg form-check-input" type="checkbox" id="flexSwitchCheckDefault" name="website_view" >
                      Website View
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </form>
      </div>
    </div>
  </div>

</div>
</div>
<!--end row-->
@endsection
