Current File : /home/tradevaly/new.tradevaly.com.bd/resources/views/backend/pages/featureProduct/cindex.blade.php
@extends('backend.ayaan.master')

@section('title') Featured Products @endsection
@section('css')
    <!-- DataTables -->
    <link href="{{ asset('/assets/libs/datatables/datatables.min.css') }}" rel="stylesheet" type="text/css" />
@endsection
@section('content')

    @component('components.breadcrumb')
        @slot('li_1') Dashboards @endslot
        @slot('title') Featured Products @endslot
    @endcomponent

  <div class="row">
    <div class="col-md-6">
      <div class="col-12">
            <div class="card">
                <div class="card-body">
                    <div class="row mb-2">
                        <div class="col-sm-4">Featured Products</div>
                       
                    </div>

                    <div class="table-responsive">
            <table class="table">
              <thead>
                <tr>
                  <th class="text-center">#</th>
                  <th>{{translate("Product Name")}}</th>
                  <th class="text-right">{{translate("Actions")}}</th>
                </tr>
              </thead>
              <tbody>
                @php
                   $i = 0;
                @endphp
                @foreach ($pros as $product)
                <tr>
                  <?php $i++; ?>
                  <td class="text-center">{{$i}}</td>
                  <td>{{$product->product->title}}</td>
                  <td class="td-actions text-right">
                    <a href="{{url('b2b/feature_product/delete',$product->id)}}" name="about" class="btn btn-danger confirmDelete" title="Delete" style="color: #fff">
                      <i class="material-icons">close</i>
                    </a>
                  </td>
                </tr>
                @endforeach
              </tbody>
            </table>
          </div>
                  </div>  
                </div>
            </div>
        </div>
    <div class="col-md-6">
       <div class="card">
                <div class="card-body">

                    <h4 class="card-title">Add Featured</h4>
                    <p class="card-title-desc">Fill all information below</p>
          <form action="{{url('b2b/feature_product/add')}}" method="POST">@csrf
            <div class="row">
              <div class="col-sm-12">
                                <div class="mb-3">
                                    <label for="metadescription">{{translate('Select Products')}}</label>
                <select class="form-control select2"  name="product_id">
                    <option disabled selected>Single Option</option>
                    @foreach ($categories as $p)
                    <option value="{{$p->id}}">{{$p->name}}</option>
                    @endforeach
                 </select>
              </div>
            </div>
            <div class="d-flex flex-wrap gap-2">
                            <button type="submit" class="btn btn-primary waves-effect waves-light">Save Changes</button>
                            <button type="submit" class="btn btn-secondary waves-effect waves-light">Cancel</button>
                        </div>
                    </form>

                </div>
            </div> 
        
    </div>
  </div>
@endsection
@section('script')
    <!-- Required datatable js -->
    <script src="{{ asset('/assets/libs/datatables/datatables.min.js') }}"></script>
    <script src="{{ asset('/assets/libs/jszip/jszip.min.js') }}"></script>
    <script src="{{ asset('/assets/libs/pdfmake/pdfmake.min.js') }}"></script>
    <!-- Datatable init js -->
     <script src="{{ asset('/assets/libs/select2/select2.min.js') }}"></script>

   
    <!-- init js -->
    <script src="{{ asset('/assets/js/pages/ecommerce-select2.init.js') }}"></script>
    <script type="text/javascript">
  $(function () {
    
    
    
    
    $(document).ready(function () {
 
  var table = $('.table').DataTable({
    lengthChange: false,
    processing: true,
  });
  table.buttons().container().appendTo('#datatable-buttons_wrapper .col-md-6:eq(0)');
  $(".dataTables_length select").addClass('form-select form-select-sm');
});
});
</script>
@endsection