<!DOCTYPE html>

<!-- =========================================================
* Sneat - Bootstrap 5 HTML Admin Template - Pro | v1.0.0
==============================================================

* Product Page: https://themeselection.com/products/sneat-bootstrap-html-admin-template/
* Created by: ThemeSelection
* License: You must have a valid license purchased in order to legally use the theme for your project.
* Copyright ThemeSelection (https://themeselection.com)

=========================================================
 -->
<!-- beautify ignore:start -->
<html
  lang="en"
  class="light-style layout-menu-fixed"
  dir="ltr"
  data-theme="theme-default"
  data-assets-path="<?= base_url() ?>assets/"
  data-template="vertical-menu-template-free"
>
  <head>
    <meta charset="utf-8" />
    <meta
      name="viewport"
      content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0"
    />

    <title>Dashboard</title>

    <meta name="description" content="" />

    <!-- Favicon -->
    <link rel="icon" type="image/x-icon" href="<?= base_url() ?>assets/images/ic-ldu.png" />

    <!-- Fonts -->
    <link rel="preconnect" href="https://fonts.googleapis.com" />
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
    <link
      href="https://fonts.googleapis.com/css2?family=Public+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500;1,600;1,700&display=swap"
      rel="stylesheet"
    />

    <!-- Icons. Uncomment required icon fonts -->
    <link rel="stylesheet" href="<?= base_url() ?>assets/vendor/fonts/boxicons.css" />

    <!-- Core CSS -->
    <link rel="stylesheet" href="<?= base_url() ?>assets/vendor/css/core.css" class="template-customizer-core-css" />
    <link rel="stylesheet" href="<?= base_url() ?>assets/vendor/css/theme-default.css" class="template-customizer-theme-css" />
    <link rel="stylesheet" href="<?= base_url() ?>assets/css/demo.css" />

    <!-- Vendors CSS -->
    <link rel="stylesheet" href="<?= base_url() ?>assets/vendor/libs/perfect-scrollbar/perfect-scrollbar.css" />

    <link rel="stylesheet" href="<?= base_url() ?>assets/vendor/libs/apex-charts/apex-charts.css" />

    <!-- Page CSS -->

    <!-- Helpers -->
    <script src="<?= base_url() ?>assets/vendor/js/helpers.js"></script>

    <!-- jQuery dulu -->
    <script src="<?= base_url() ?>assets/vendor/libs/jquery/jquery.js"></script>

    <!-- Baru Select2 -->
    <link href="<?= base_url(); ?>assets/libs/select2/select2.min.css" rel="stylesheet" />
    <script src="<?= base_url(); ?>assets/libs/select2/select2.min.js"></script>


<!-- 
    <link rel="stylesheet" href="<?= base_url() ?>assets/libs/iziToast/iziToast.min.js" />

    <script src="<?= base_url() ?>assets/libs/iziToast/iziToast.min.js"></script> -->


    <!-- Coba versi 1.4.0 jika menggunakan versi lain -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/izitoast/1.4.0/css/iziToast.min.css">
    <script src="https://cdnjs.cloudflare.com/ajax/libs/izitoast/1.4.0/js/iziToast.min.js"></script>



    <!--! Template customizer & Theme config files MUST be included after core stylesheets and helpers.js in the <head> section -->
    <!--? Config:  Mandatory theme config file contain global vars & default theme options, Set your preferred theme option in this file.  -->
    <script src="<?= base_url() ?>assets/js/config.js"></script>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.2/css/all.min.css" integrity="sha512-Evv84Mr4kqVGRNSgIGL/F/aIDqQb7xQ2vcrdIwxfjThSH8CSR7PBEakCr51Ck+w+/U6swU2Im1vVX0SVk9ABhg==" crossorigin="anonymous" referrerpolicy="no-referrer" />
    <link href="<?= base_url(); ?>assets/libs/datatables-bs5/datatables.min.css" rel="stylesheet" type="text/css" />

    <script src="<?= base_url() ?>assets/vendor/libs/jquery/jquery.js"></script>

    <script src="<?= base_url(); ?>assets/libs/jquery.number/jquery.number.min.js"></script>
    


    
    <!-- Core JS -->
    <!-- build:js assets/vendor/js/core.js -->

  </head>

  <style type="text/css">
    
    .loader {
      width: 5px;
      aspect-ratio: 1;
      border-radius: 50%;
      animation: l5 1s infinite linear alternate;
    }
    @keyframes l5 {
        0%  {box-shadow: 20px 0 #738394, -20px 0 #0002;background: #738394 }
        33% {box-shadow: 20px 0 #738394, -20px 0 #0002;background: #0002}
        66% {box-shadow: 20px 0 #0002,-20px 0 #738394; background: #0002}
        100%{box-shadow: 20px 0 #0002,-20px 0 #738394; background: #738394 }
    }

  </style>

  
    
    <script type="text/javascript">
      const baseUrl = '<?= base_url() ?>'


        //custom
        $(document).delegate(".datatable-delete", "click", function () {
          var url = $(this).attr("data-link");
          var id = $(this).attr("data-id");
          Swal.fire({
            title: "Hapus Data?",
            text: "Data yang dihapus tidak dapat dikembalikan lagi!",
            icon: "question",
            showCancelButton: !0,
            confirmButtonColor: "#f14e4e",
            cancelButtonText: "Batal",
            confirmButtonText: "Ya, Hapus sekarang!",
            customClass: {
                container: 'sweetalert-container',
                popup: 'sweetalert-popup'
            }
          }).then((result) => {
            if (result.isConfirmed) {
              $.ajax({
                url: url,
                type: "POST",
                dataType: "json",
                data: {
                  id: id,
                },
                success: function (data_result) {
                  
                  if (data_result.code == 200) {
                    if (data_result.success) {
                      iziToast.show({
                        title: "Berhasil",
                        message: "Data berhasil dihapus!",
                        color: "green",
                        position: "topRight", // bottomRight, bottomLeft, topRight, topLeft, topCenter, bottomCenter, center
                      });
                      $("#datatable").DataTable().ajax.reload(null, false);
                    } else {
                      iziToast.show({
                        title: "Gagal",
                        message: data_result.message,
                        color: "red",
                        position: "topCenter",
                      });
                    }
                  } else {
                    iziToast.show({
                      title: "Terjadi Kesalahan",
                      message: "Silahkan coba lagi.",
                      color: "red",
                      position: "topCenter",
                    });
                  }
                },
              });
            } else if (result.dismiss === Swal.DismissReason.cancel) {
              // swalWithBootstrapButtons.fire(
              //   'Cancelled',
              //   'Your imaginary file is safe :)',
              //   'error'
              // )
            }
          });
        });

  

    </script>


  <body>
    <!-- Layout wrapper -->
    <div class="layout-wrapper layout-content-navbar">
      <div class="layout-container">
        <!-- Menu -->


        <!-- Layout container -->
        <div class="w-100">
          <!-- Navbar -->


          <!-- Content wrapper -->
          <div class="content-wrapper">
            <!-- Content -->


