<?php $__env->startSection('admincontent'); ?>
<!-- Content Header (Page header) -->
<div class="content-header">
    <div class="container-fluid">
      <div class="row mb-2">
        <div class="col-sm-6">
          <h1 class="m-0">Client</h1>
        </div><!-- /.col -->
        <div class="col-sm-6">
          <ol class="breadcrumb float-sm-right">
            <li class="breadcrumb-item"><a href="<?php echo e(url('/')); ?>">Home</a></li>
            <li class="breadcrumb-item">Master</li>
            <li class="breadcrumb-item active">Client</li>
          </ol>
        </div><!-- /.col -->
      </div><!-- /.row -->
    </div><!-- /.container-fluid -->
  </div>
  <!-- /.content-header -->

  <!-- Main content -->
  <section class="content">
    <?php if(Session::has('success')): ?>
    <div class="alert alert-success alert-dismissible fade show" role="alert">
        <?php echo e(Session::get('success')); ?>

        <?php
            Session::forget('success');
        ?>
        <button type="button" class="close" data-dismiss="alert"
            aria-label="Close">
            <span aria-hidden="true">&times;</span>
        </button>
    </div>
    <?php endif; ?>
    <div class="container-fluid">
      <!-- Small boxes (Stat box) -->
      
      <!-- /.row -->
      <!-- Main row -->
      <div class="row">
        <!-- Left col -->
        <section class="col-lg-12 connectedSortable">
          <!-- Custom tabs (Charts with tabs)-->
          <div class="card">
            <div class="card-header">
              
              <div class="card-tools">
                <ul class="nav nav-pills ml-auto">
                  
                  <li class="nav-item">
                    
                    <a href="<?php echo e(url('client/create')); ?>" class="btn btn-primary float-right"><i class="fas fa-plus"></i> Add</a>
                  </li>
                </ul>
              </div>
            </div><!-- /.card-header -->
            <div class="card-body">
                <?php echo e($dataTable->table(['class' => 'table table-bordered table-hover table-striped w-100'])); ?>

            </div><!-- /.card-body -->
          </div>
          <!-- /.card -->
        </section>
      </div>
      <!-- /.row (main row) -->
    </div><!-- /.container-fluid -->
  </section>
  <script>
    $(document).on("click", ".delete", function(){
        var id = $(this).data('id');
        // alert(id);
        Swal.fire({
            title: "Are you sure?",
            text: "You won't be able to revert this!",
            icon: "warning",
            showCancelButton: true,
            confirmButtonColor: "#3085d6",
            cancelButtonColor: "#d33",
            confirmButtonText: "Yes, delete it!"
        }).then((result) => {
            if (result.isConfirmed) {
                $.ajax({
                    url:'<?php echo e(route("client/delete")); ?>',
                    method:'POST',
                    dataType:"json",
                    data: {
                        "_token": "<?php echo e(csrf_token()); ?>",
                        id:id,
                    },
                    success:function(data){
                        window.location.reload();
                    }
                })
                // delete success
                Swal.fire({
                title: "Deleted!",
                text: "Your file has been deleted.",
                icon: "success"
                });
            }
            // if (result) {

            // }else{
            //     swal("Your imaginary file is safe!");
            // }
        });
    });
</script>
<?php $__env->stopSection(); ?>
<?php echo e($dataTable->scripts(attributes: ['type' => 'module'])); ?>



<?php echo $__env->make('layouts.master', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/annapurn/public_html/triphunter.annapurnadhamagro.com/resources/views/master/client/index.blade.php ENDPATH**/ ?>