{{-- @extends('layouts.app')
@section('content')
<div class="app-content-header">
    <!--begin::Container-->
    <div class="container-fluid">
      <!--begin::Row-->
      <div class="row">
        <div class="col-sm-6"><h3 class="mb-0">Bolts-MS-M</h3></div>
        <div class="col-sm-6">
          <ol class="breadcrumb float-sm-end">
            <li class="breadcrumb-item"><a href="#">Home</a></li>
            <li class="breadcrumb-item active" aria-current="page">Bolts-MS-M</li>
          </ol>
        </div>
      </div>
      <!--end::Row-->
    </div>
    <!--end::Container-->
  </div>
  <!--end::App Content Header-->
  <!--begin::App Content-->
  <div class="app-content">
    <!--begin::Container-->
    <div class="container-fluid">
      <!--begin::Row-->
      <div class="row">
        <div class="col-md-12">
          <div class="card card-primary card-outline mb-4">
            <div class="card-header">

                <div class="row">
                    <div class="col-lg-11"></div>
                    <div class="col-lg-1"><a href="{{ route('admin/bolts/msm/create') }}" class="btn btn-info btn-sm">Create</a></div>
                </div>
            </div>
            <!-- /.card-header -->
            <div class="card-body">
              {{ $dataTable->table(['class' => 'table table-bordered table-hover table-striped w-100']) }}
            </div>
            <!-- /.card-body -->
          </div>
        </div>
      </div>
      <!--end::Row-->
    </div>
    <!--end::Container-->
</div>
<script>
    $(document).on("click", ".delete", function(){
       var id = $(this).data('id');
       swal({
           title: "Are you sure?",
           text: "Once deleted, you will not be able to recover this imaginary file!",
           icon: "warning",
           buttons: true,
           dangerMode: true,
       })
       .then((willDelete) => {
           if (willDelete) {
               $.ajax({
                   url:'{{ route("admin/bolts/msm/delete") }}',
                   method:'POST',
                   dataType:"json",
                   data: {
                       "_token": "{{ csrf_token() }}",
                       id:id,
                   },
                   success:function(response){
                        if(response.success == false){
                            swal({
                                title: "This 'LPO' cannot be deleted right now?",
                                text: "Its invoice is attached first delete it then 'LPO' will be removed!",
                                icon: "warning",
                                button: "ok",
                            });
                            // console.log(response.success, 'data');
                        }else{
                            window.location.reload();
                        }
                   }
               })
           } else {
               swal("Your imaginary file is safe!");
           }
       });
   });
</script>
@endsection
{{ $dataTable->scripts(attributes: ['type' => 'module']) }} --}}


@extends('layouts.app')
@section('content')
<!--breadcrumb-->
<div class="page-breadcrumb d-none d-sm-flex align-items-center mb-3">
    {{-- <div class="breadcrumb-title pe-3">Components</div> --}}
    <div class="ps-3">
        <nav aria-label="breadcrumb">
            <ol class="breadcrumb mb-0 p-0">
                <li class="breadcrumb-item"><a href="javascript:;">
                    {{-- <i class="bx bx-home-alt"></i> --}}
                </a>
                </li>
                <li class="breadcrumb-item active" aria-current="page">Bolts-MS-M</li>
            </ol>
        </nav>
    </div>
</div>
@if (Session::has('success'))
<div class="alert alert-success border-0 bg-grd-success alert-dismissible fade show">
    <div class="d-flex align-items-center">
        <div class="font-35 text-white"><span class="material-icons-outlined fs-2">check_circle</span>
        </div>
        <div class="ms-3">
            <h6 class="mb-0 text-white">Success Alerts</h6>
            <div class="text-white">
                {{ Session::get('success') }}
                @php
                    Session::forget('success');
                @endphp —check it out!</div>
        </div>
    </div>
    <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</div>
@endif
<!--end breadcrumb-->
<div class="card">
    <div class="card-header">
        <div class="row">
            <div class="col-lg-10"></div>
            <div class="col-lg-2">
                <a href="{{ route('admin/bolts/msm/create') }}" class="btn btn-grd btn-grd-branding px-5 btn-sm"> Create</a>
            </div>
        </div>
    </div>
    <div class="card-body">
        <div class="table-responsive">
            {{ $dataTable->table(['class' => 'table table-striped table-bordered w-100']) }}
        </div>
    </div>
</div>
@endsection
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script>
    $(document).on("click", ".delete", function(){
       var id = $(this).data('id');
       swal({
           title: "Are you sure?",
           text: "Once deleted, you will not be able to recover this imaginary file!",
           icon: "warning",
           buttons: true,
           dangerMode: true,
       })
       .then((willDelete) => {
           if (willDelete) {
               $.ajax({
                   url:'{{ route("admin/bolts/msm/delete") }}',
                   method:'POST',
                   dataType:"json",
                   data: {
                       "_token": "{{ csrf_token() }}",
                       id:id,
                   },
                   success:function(response){
                        if(response.success == false){
                            swal({
                                title: "This 'LPO' cannot be deleted right now?",
                                text: "Its invoice is attached first delete it then 'LPO' will be removed!",
                                icon: "warning",
                                button: "ok",
                            });
                            // console.log(response.success, 'data');
                        }else{
                            window.location.reload();
                        }
                   }
               })
           } else {
               swal("Your imaginary file is safe!");
           }
       });
   });
</script>
{{ $dataTable->scripts(attributes: ['type' => 'module']) }}
