<?php
if ($this->session->userdata("username") == null || empty($this->session->userdata("username"))) {
  redirect(base_url() . "Login");
}
?>
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <!-- Tell the browser to be responsive to screen width -->
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta name="description" content="">
  <meta name="author" content="">
  <!-- Favicon icon -->
  <link rel="icon" type="image/png" sizes="16x16" href="<?php echo base_url(); ?>desain/assets/images/polije.png">
  <?php if ($this->uri->segment(1) !== "LaporanKonsumsi") { ?>
    <title>SIM Bayi Stunting</title>
  <?php } else { ?>
    <title>Laporan Riwayat Konsumsi Pengguna</title>
  <?php } ?>
  <!-- This page CSS -->
  <!-- chartist CSS -->
  <link href="<?php echo base_url() ?>desain/assets/node_modules/morrisjs/morris.css" rel="stylesheet">

  <!-- Custom CSS -->
  <link href="<?php echo base_url() ?>desain/dist/css/style.css" rel="stylesheet">
  <!-- Custom CSS -->
  <link href="<?php echo base_url() ?>desain/dist/css/style2.css" rel="stylesheet">
  <!-- Dashboard 1 Page CSS -->
  <link href="<?php echo base_url() ?>desain/dist/css/pages/dashboard1.css" rel="stylesheet">
  <link href="<?php echo base_url(); ?>desain/MyCSS.css" rel="stylesheet">
  <link href="<?php echo base_url(); ?>desain/assets/node_modules/icheck/skins/all.css" rel="stylesheet">
  <link href="<?php echo base_url(); ?>desain/dist/css/pages/form-icheck.css" rel="stylesheet">
  <link href="<?php echo base_url(); ?>desain/dist/css/pages/file-upload.css" rel="stylesheet">
  <link href="<?php echo base_url(); ?>desain/dist/css/main.css" rel="stylesheet">
  <!-- autocomplate -->
  <link href="https://cdnjs.cloudflare.com/ajax/libs/easy-autocomplete/1.3.5/easy-autocomplete.min.css" rel="stylesheet">
  <link href="https://cdnjs.cloudflare.com/ajax/libs/easy-autocomplete/1.3.5/easy-autocomplete.themes.min.css" rel="stylesheet">

  <link href="<?php echo base_url(); ?>desain/assets/node_modules/bootstrap-select/bootstrap-select.min.css" rel="stylesheet" />
  <link href="<?php echo base_url(); ?>desain/assets/node_modules/multiselect/css/multi-select.css" rel="stylesheet" type="text/css" />
  <link href="<?php echo base_url(); ?>desain/assets/node_modules/bootstrap-tagsinput/dist/bootstrap-tagsinput.css" rel="stylesheet" />
  <link href="<?php echo base_url(); ?>desain/assets/node_modules/bootstrap-touchspin/dist/jquery.bootstrap-touchspin.min.css" rel="stylesheet" />
  <!-- steps -->
  <link href="<?php echo base_url(); ?>desain/assets/node_modules/wizard/steps.css" rel="stylesheet">
  <link type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/themes/south-street/jquery-ui.css" rel="stylesheet">
  <!-- flot chart -->
  <link href="<?php echo base_url(); ?>desain/dist/css/pages/float-chart.css" rel="stylesheet">
  <link href="<?php echo base_url(); ?>desain/dist/css/pages/other-pages.css" rel="stylesheet">

  <link href="<?php echo base_url(); ?>desain/assets/node_modules/select2/dist/css/select2.min.css" rel="stylesheet" type="text/css" />
  <link href="<?php echo base_url(); ?>desain/assets/node_modules/clockpicker/dist/jquery-clockpicker.min.css" rel="stylesheet">
  <link href="<?php echo base_url(); ?>desain/assets/node_modules/bootstrap-datepicker/bootstrap-datepicker.min.css" rel="stylesheet" type="text/css" />
  <link href="<?php echo base_url(); ?>desain/dist/css/style.min.css" rel="stylesheet">
  <link href="<?php echo base_url() ?>desain/assets/node_modules/bootstrap-material-datetimepicker/css/bootstrap-material-datetimepicker.css" rel="stylesheet">
  <link rel="stylesheet" href="<?php echo base_url() ?>desain/assets/node_modules/dropify/dist/css/dropify.min.css">
  <link href="<?php echo base_url() ?>desain/dist/css/pages/tab-page.css" rel="stylesheet">
  <!--Toaster Popup message CSS -->
  <link href="<?php echo base_url() ?>desain/assets/node_modules/toast-master/css/jquery.toast.css" rel="stylesheet">
  <script src="<?php echo base_url(); ?>desain/assets/node_modules/jquery/jquery-3.2.1.min.js"></script>

  <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
  <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
  <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
    <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
</head>

<body class="skin-blue fixed-layout">
  <!-- ============================================================== -->
  <!-- Preloader - style you can find in spinners.css -->
  <!-- ============================================================== -->
  <!-- <div class="preloader">
        <div class="loader">
            <div class="loader__figure"></div>
            <p class="loader__label">Elite admin</p>
        </div>
    </div> -->
  <!-- ============================================================== -->
  <!-- Main wrapper - style you can find in pages.scss -->
  <!-- ============================================================== -->
  <div id="main-wrapper">
    <!-- ============================================================== -->
    <!-- Topbar header - style you can find in pages.scss -->
    <!-- ============================================================== -->
    <header class="topbar" style="background-color: #6495ED;">
      <nav class="navbar top-navbar navbar-expand-md navbar-dark">
        <!-- ============================================================== -->
        <!-- Logo -->
        <!-- ============================================================== -->
        <div class="navbar-header">
          <a class="navbar-brand" href="<?php echo base_url() . "Index" ?>">
            <!-- Logo icon --><b>
              <!--You can put here icon as well // <i class="wi wi-sunset"></i> //-->
              <!-- Dark Logo icon -->
              <!-- <img src="<?php echo base_url(); ?>desain/assets/images/polije.png" alt="homepage" class="dark-logo" /> -->
              <!-- Light Logo icon -->
              <!-- <img src="<?php echo base_url(); ?>desain/assets/images/polije.png" alt="homepage" class="light-logo"
                style="height:50px; width:50px;" /> -->
            </b>
            <!--End Logo icon -->
            <span class="hidden-xs"><span class="font-bold">SIM Bayi Stunting</span></span>
          </a>
        </div>
        <!-- ============================================================== -->
        <!-- End Logo -->
        <!-- ============================================================== -->
        <div class="navbar-collapse">
          <!-- ============================================================== -->
          <!-- toggle and nav items -->
          <!-- ============================================================== -->
          <ul class="navbar-nav mr-auto">
            <!-- This is  -->
            <li class="nav-item"> <a class="nav-link nav-toggler d-block d-sm-none waves-effect waves-dark" href="javascript:void(0)"><i class="ti-menu"></i></a> </li>
            <li class="nav-item"> <a class="nav-link sidebartoggler d-none d-lg-block d-md-block waves-effect waves-dark" href="javascript:void(0)"><i class="icon-menu"></i></a> </li>
            <!-- ============================================================== -->
            <!-- Search -->
            <!-- ============================================================== -->
            <!-- <li class="nav-item">
                            <form class="app-search d-none d-md-block d-lg-block">
                                <input type="text" class="form-control" placeholder="Search & enter">
                            </form>
                        </li> -->
          </ul>
          <!-- ============================================================== -->
          <!-- User profile and search -->
          <!-- ============================================================== -->
          <ul class="navbar-nav my-lg-0">
            <!-- ============================================================== -->
            <!-- Comment -->
            <!-- ============================================================== -->
            <!-- ============================================================== -->
            <!-- End Comment -->
            <!-- ============================================================== -->
            <!-- ============================================================== -->
            <!-- Messages -->
            <!-- ============================================================== -->
            <!-- ============================================================== -->
            <!-- End Messages -->
            <!-- ============================================================== -->
            <!-- ============================================================== -->
            <!-- mega menu -->
            <!-- ============================================================== -->
            <!-- ============================================================== -->
            <!-- End mega menu -->
            <!-- ============================================================== -->
            <!-- ============================================================== -->
            <!-- User Profile -->
            <!-- ============================================================== -->
            <li class="nav-item dropdown u-pro">
              <a class="nav-link dropdown-toggle waves-effect waves-dark profile-pic" href="" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><img src="<?php echo base_url(); ?>desain/assets/user.png" alt="user" class=""> <span class="hidden-md-down"><?php echo $this->session->userdata("username") ?>
                  &nbsp;<i class="fa fa-angle-down"></i></span> </a>
              <div class="dropdown-menu dropdown-menu-right animated flipInY">
                <a href="<?php echo base_url(); ?>Login/logout" class="dropdown-item"><i class="fa fa-power-off"></i>
                  Keluar</a>
                <!-- text-->
              </div>
            </li>
            <!-- ============================================================== -->
            <!-- End User Profile -->
            <!-- ============================================================== -->
          </ul>
        </div>
      </nav>
    </header>
    <!-- ============================================================== -->
    <!-- End Topbar header -->
    <!-- ============================================================== -->
    <!-- ============================================================== -->
    <!-- Left Sidebar - style you can find in sidebar.scss  -->
    <!-- ============================================================== -->
    <aside class="left-sidebar">
      <!-- Sidebar scroll-->
      <div class="scroll-sidebar">
        <!-- Sidebar navigation-->
        <nav class="sidebar-nav">
          <ul id="sidebarnav">
            <?php $this->load->view('menu') ?>
          </ul>
        </nav>
        <!-- End Sidebar navigation -->
      </div>
      <!-- End Sidebar scroll-->
    </aside>
    <!-- ============================================================== -->
    <!-- End Left Sidebar - style you can find in sidebar.scss  -->
    <!-- ============================================================== -->
    <!-- ============================================================== -->
    <!-- Page wrapper  -->
    <!-- ============================================================== -->
    <div class="page-wrapper">
      <!-- ============================================================== -->
      <!-- Container fluid  -->
      <!-- ============================================================== -->
      <div class="container-fluid">
        <!-- ============================================================== -->
        <!-- Bread crumb and right sidebar toggle -->
        <!-- ============================================================== -->
        <div class="row page-titles">
          <div class="col-md-5 align-self-center">
            <h4 class="text-themecolor">Halaman
              <?php echo @$this->uri->segment(1); ?>
            </h4>
          </div>
          <div class="col-md-7 align-self-center text-right">
            <div class="d-flex justify-content-end align-items-center">
              <ol class="breadcrumb">
                <li class="breadcrumb-item">
                  <a href="<?php echo base_url() . @$this->uri->segment(1); ?>">
                    <?php echo @$this->uri->segment(1); ?>
                  </a>
                </li>
                <?php if ($this->uri->segment(2) !== null) : ?>
                  <li class="breadcrumb-item active">
                    <?php echo @$this->uri->segment(2); ?>
                  </li>
                <?php endif; ?>
              </ol>
            </div>
          </div>
        </div>
        <?php $this->load->view($body); ?>
        <!-- ============================================================== -->
        <!-- End Bread crumb and right sidebar toggle -->
        <!-- ============================================================== -->

      </div>
      <!-- ============================================================== -->
      <!-- End Container fluid  -->
      <!-- ============================================================== -->
    </div>
    <!-- ============================================================== -->
    <!-- End Page wrapper  -->
    <!-- ============================================================== -->
    <!-- ============================================================== -->
    <!-- footer -->
    <!-- ============================================================== -->
    <footer class="footer">
      © 2024 JTI POLIJE Manajemen Informatika 2021
    </footer>
    <?= $this->session->flashdata('notif'); ?>

    <!-- ============================================================== -->
    <!-- End footer -->
    <!-- ============================================================== -->
  </div>
  <!-- ============================================================== -->
  <!-- End Wrapper -->
  <!-- ============================================================== -->
  <!-- ============================================================== -->
  <!-- All Jquery -->
  <!-- ============================================================== -->
  <script src="<?php echo base_url(); ?>desain/assets/node_modules/popper/popper.min.js"></script>
  <script src="<?php echo base_url(); ?>desain/assets/node_modules/bootstrap/dist/js/bootstrap.min.js"></script>
  <!-- slimscrollbar scrollbar JavaScript -->
  <script src="<?php echo base_url(); ?>desain/dist/js/perfect-scrollbar.jquery.min.js"></script>
  <!--Wave Effects -->
  <script src="<?php echo base_url(); ?>desain/dist/js/waves.js"></script>
  <!--Menu sidebar -->
  <script src="<?php echo base_url(); ?>desain/dist/js/sidebarmenu.js"></script>
  <!--Custom JavaScript -->
  <script src="<?php echo base_url(); ?>desain/dist/js/custom.min.js"></script>
  <!-- ============================================================== -->
  <!-- This page plugins -->
  <!-- ============================================================== -->
  <!--morris JavaScript -->
  <script src="<?php echo base_url(); ?>desain/assets/node_modules/raphael/raphael-min.js"></script>
  <script src="<?php echo base_url(); ?>desain/assets/node_modules/morrisjs/morris.min.js"></script>
  <script src="<?php echo base_url(); ?>desain/assets/node_modules/jquery-sparkline/jquery.sparkline.min.js"></script>
  <!-- Popup message jquery -->
  <script src="<?php echo base_url(); ?>desain/assets/node_modules/toast-master/js/jquery.toast.js"></script>
  <!-- jQuery peity -->
  <script src="<?php echo base_url(); ?>desain/assets/node_modules/peity/jquery.peity.min.js"></script>
  <script src="<?php echo base_url(); ?>desain/assets/node_modules/peity/jquery.peity.init.js"></script>
  <!-- <script src="<?php echo base_url(); ?>desain/dist/js/dashboard1.js"></script> -->
  <!--stickey kit -->
  <script src="<?php echo base_url(); ?>desain/assets/node_modules/sticky-kit-master/dist/sticky-kit.min.js"></script>
  <script src="<?php echo base_url(); ?>desain/assets/node_modules/sparkline/jquery.sparkline.min.js"></script>
  <!-- This is data table -->
  <script src="<?php echo base_url(); ?>desain/assets/node_modules/datatables/jquery.dataTables.min.js"></script>
  <!-- icheck -->
  <script src="<?php echo base_url(); ?>desain/assets/node_modules/icheck/icheck.min.js"></script>
  <script src="<?php echo base_url(); ?>desain/assets/node_modules/icheck/icheck.init.js"></script>
  <script src="<?php echo base_url(); ?>desain/dist/js/pages/jasny-bootstrap.js"></script>
  <!-- start - This is for export functionality only -->
  <script src="https://cdn.datatables.net/buttons/1.2.2/js/dataTables.buttons.min.js"></script>
  <script src="https://cdn.datatables.net/buttons/1.2.2/js/buttons.flash.min.js"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/2.5.0/jszip.min.js"></script>
  <script src="https://cdn.rawgit.com/bpampuch/pdfmake/0.1.18/build/pdfmake.min.js"></script>
  <script src="https://cdn.rawgit.com/bpampuch/pdfmake/0.1.18/build/vfs_fonts.js"></script>
  <script src="https://cdn.datatables.net/buttons/1.2.2/js/buttons.html5.min.js"></script>
  <script src="https://cdn.datatables.net/buttons/1.2.2/js/buttons.print.min.js"></script>
  <!-- select2 -->
  <script src="<?php echo base_url(); ?>desain/assets/node_modules/select2/dist/js/select2.full.min.js" type="text/javascript"></script>
  <!-- <script src="<?php echo base_url(); ?>desain/dist/js/custom.min.js"></script> -->
  <script src="<?php echo base_url(); ?>desain/dist/js/pages/mask.js"></script>
  <!-- Editable -->
  <script type="text/javascript" src="<?php echo base_url(); ?>desain/assets/node_modules/x-editable/dist/bootstrap3-editable/js/bootstrap-editable.js"></script>

  <!-- end - This is for export functionality only -->
  <script src="<?php echo base_url(); ?>desain/assets/node_modules/switchery/dist/switchery.min.js"></script>
  <script src="<?php echo base_url(); ?>desain/assets/node_modules/select2/dist/js/select2.full.min.js" type="text/javascript"></script>
  <script src="<?php echo base_url(); ?>desain/assets/node_modules/bootstrap-select/bootstrap-select.min.js" type="text/javascript"></script>
  <script src="<?php echo base_url(); ?>desain/assets/node_modules/bootstrap-tagsinput/dist/bootstrap-tagsinput.min.js"></script>
  <script src="<?php echo base_url(); ?>desain/assets/node_modules/bootstrap-touchspin/dist/jquery.bootstrap-touchspin.js" type="text/javascript"></script>
  <script type="text/javascript" src="<?php echo base_url(); ?>desain/assets/node_modules/multiselect/js/jquery.multi-select.js"></script>
  <!-- Chart JS -->
  <script src="<?php echo base_url(); ?>desain/assets/node_modules/echarts/echarts-all.js"></script>
  <script src="<?php echo base_url(); ?>desain/assets/node_modules/echarts/echarts-init.js"></script>
  <!-- Sweet-Alert  -->
  <script src="<?php echo base_url() ?>desain/assets/node_modules/sweetalert/sweetalert.min.js"></script>
  <script src="<?php echo base_url() ?>desain/dist/js/sweet.js"></script>
  <script src="<?php echo base_url() ?>desain/dist/js/main.js"></script>
  <!-- autocomplate -->
  <script src="https://cdnjs.cloudflare.com/ajax/libs/easy-autocomplete/1.3.5/jquery.easy-autocomplete.min.js"></script>
  <script src="<?php echo base_url() ?>desain/dist/js/autocomplate-init.js"></script>
  <!-- steps -->
  <script src="<?php echo base_url() ?>desain/assets/node_modules/wizard/jquery.steps.min.js"></script>
  <script src="<?php echo base_url() ?>desain/assets/node_modules/wizard/jquery.validate.min.js"></script>
  <script src="<?php echo base_url() ?>desain/assets/node_modules/wizard/steps.js"></script>
  <!-- Tour Bootstrap -->
  <script src="<?php echo base_url() ?>desain/dist/js/custom.min.js"></script>
  <script src="<?php echo base_url() ?>desain/assets/node_modules/toast-master/js/jquery.toast.js"></script>

  <script>
    $(document).ready(function() {
      // Data Picker Initialization
      $('.datepicker').pickadate();
      // Material Select Initialization
      $('.mdb-select').material_select();
      $(document).on("click", ".hapus-disable", function() {
        $("#Hapus_disable").modal("toggle");
      })
      $(document).on("click", ".hapus-aktif", function() {
        $("#Hapus_aktif").modal("toggle");
      })
      $('#optgroup').multiSelect({
        selectableOptgroup: true
      });
      $('#public-methods').multiSelect();
      $(".tanggal").datepicker({
        format: 'dd/mm/yyyy',
        formatSubmit: 'yyyy-mm-dd',
        showButtonPanel: true,
      });
      $('.tanggalku').pickadate({
        // Escape any “rule” characters with an exclamation mark (!).
        format: 'dd-mm-yyyy',
        formatSubmit: 'yyyy-mm-dd',
      })

      // select2
      $(document).on("click", ".to-top", function() {
        $('html, body').animate({
          scrollTop: 0
        }, 500);
      })
      $(document).on("click", ".to-top-modal", function() {
        $('.modal').animate({
          scrollTop: 0
        }, 'slow');
      })
      $('.select2').select2();
    });
  </script>
  <script type="text/javascript">
    $('document').ready(function() {
      var notif = $("#tot_notif").val();
      $(".jumlah_notif_apotek").text(notif);
      $(document).on('click', ".id_checkbox", function(e) {
        $("#jumlah_pilih").html($("input.id_checkbox:checked").length);
        if ($("input.id_checkbox:checked").length == 0) {
          $(".btn_hapus").addClass("btn-outline-white");
          $(".btn_hapus").removeClass("btn-outline-danger");
          $(".btn_hapus").addClass("hapus-disable");
          $(".btn_hapus").removeClass("hapus-aktif");
          $(".select-all").prop("checked", false);

        } else {
          $(".btn_hapus").removeClass("btn-outline-white");
          $(".btn_hapus").addClass("btn-outline-danger");
          $(".btn_hapus").addClass("hapus-aktif");
          $(".btn_hapus").removeClass("hapus-disable");
        }
      });
      $(document).on('click', ".select-all", function(e) {
        // alert('djahjhd');
        var th = $(this);
        if ($("input.id_checkbox:checked").length == 0) {
          $("input.id_checkbox").prop("checked", true);
          $(".btn_hapus").removeClass("btn-outline-white");
          $(".btn_hapus").addClass("btn-outline-danger");
          $(".btn_hapus").addClass("hapus-aktif");
          $(".btn_hapus").removeClass("hapus-disable");
        } else {
          $("input.id_checkbox").prop("checked", false);
          $(".btn_hapus").addClass("btn-outline-white");
          $(".btn_hapus").removeClass("btn-outline-danger");
          $(".btn_hapus").addClass("hapus-disable");
          $(".btn_hapus").removeClass("hapus-aktif");
          if ($(th).prop("checked") == true) {
            $(th).prop("checked", false);
          }
        }
        $("#jumlah_pilih").html($("input.id_checkbox:checked").length);

      });
      $(document).on("blur", '.in_max', function() {
        var nilai = parseInt($(this).val());
        if (nilai > 6) {
          $(this).val(6);
        } else if (nilai < 0) {
          $(this).val(1);
        }
      })



    });
  </script>
  <script src="https://js.pusher.com/4.3/pusher.min.js"></script>

  <!-- ============================================================== -->
  <!-- Plugins form-picker -->
  <!-- ============================================================== -->
  <!-- Plugin JavaScript -->
  <script src="<?php echo base_url(); ?>desain/assets/node_modules/moment/moment.js"></script>
  <script src="<?php echo base_url(); ?>desain/assets/node_modules/bootstrap-material-datetimepicker/js/bootstrap-material-datetimepicker.js"></script>
  <!-- Clock Plugin JavaScript -->
  <script src="<?php echo base_url(); ?>desain/assets/node_modules/clockpicker/dist/jquery-clockpicker.min.js"></script>
  <!-- Color Picker Plugin JavaScript -->
  <script src="<?php echo base_url(); ?>desain/assets/node_modules/jquery-asColorPicker-master/libs/jquery-asColor.js"></script>
  <script src="<?php echo base_url(); ?>desain/assets/node_modules/jquery-asColorPicker-master/libs/jquery-asGradient.js"></script>
  <script src="<?php echo base_url(); ?>desain/assets/node_modules/jquery-asColorPicker-master/dist/jquery-asColorPicker.min.js"></script>
  <!-- Date Picker Plugin JavaScript -->
  <script src="<?php echo base_url(); ?>desain/assets/node_modules/bootstrap-datepicker/bootstrap-datepicker.min.js"></script>
  <!-- Date range Plugin JavaScript -->
  <script src="<?php echo base_url(); ?>desain/assets/node_modules/timepicker/bootstrap-timepicker.min.js"></script>
  <script src="<?php echo base_url(); ?>desain/assets/node_modules/bootstrap-daterangepicker/daterangepicker.js"></script>

  <!-- Flot Charts JavaScript -->
  <script src="<?php echo base_url(); ?>desain/assets/node_modules/flot/excanvas.js"></script>
  <script src="<?php echo base_url(); ?>desain/assets/node_modules/flot/jquery.flot.js"></script>
  <script src="<?php echo base_url(); ?>desain/assets/node_modules/flot/jquery.flot.pie.js"></script>
  <script src="<?php echo base_url(); ?>desain/assets/node_modules/flot/jquery.flot.time.js"></script>
  <script src="<?php echo base_url(); ?>desain/assets/node_modules/flot/jquery.flot.stack.js"></script>
  <script src="<?php echo base_url(); ?>desain/assets/node_modules/flot/jquery.flot.crosshair.js"></script>
  <script src="<?php echo base_url(); ?>desain/assets/node_modules/flot.tooltip/js/jquery.flot.tooltip.min.js"></script>
  <script src="<?php echo base_url(); ?>desain/dist/js/pages/flot-data.js"></script>
  <script src="<?php echo base_url(); ?>desain/dist/js/custom.min.js"></script>
  <script>
    // MAterial Date picker    
    $('#mdate').bootstrapMaterialDatePicker({
      weekStart: 0,
      time: false
    });
    $('#timepicker').bootstrapMaterialDatePicker({
      format: 'HH:mm',
      time: true,
      date: false
    });
    $('#timepicker2').bootstrapMaterialDatePicker({
      format: 'HH:mm',
      time: true,
      date: false
    });
    $('#date-format').bootstrapMaterialDatePicker({
      format: 'dddd DD MMMM YYYY - HH:mm'
    });

    $('#min-date').bootstrapMaterialDatePicker({
      format: 'DD/MM/YYYY HH:mm',
      minDate: new Date()
    });
    // Clock pickers
    $('#single-input').clockpicker({
      placement: 'bottom',
      align: 'left',
      autoclose: true,
      'default': 'now'
    });
    $('.clockpicker').clockpicker({
      donetext: 'Done',
    }).find('input').change(function() {
      console.log(this.value);
    });
    $('#check-minutes').click(function(e) {
      // Have to stop propagation here
      e.stopPropagation();
      input.clockpicker('show').clockpicker('toggleView', 'minutes');
    });
    if (/mobile/i.test(navigator.userAgent)) {
      $('input').prop('readOnly', true);
    }
    // Colorpicker
    $(".colorpicker").asColorPicker();
    $(".complex-colorpicker").asColorPicker({
      mode: 'complex'
    });
    $(".gradient-colorpicker").asColorPicker({
      mode: 'gradient'
    });
    // Date Picker
    jQuery('.mydatepicker, #datepicker').datepicker();
    jQuery('#datepicker-autoclose').datepicker({
      autoclose: true,
      todayHighlight: true
    });
    jQuery('#date-range').datepicker({
      toggleActive: true
    });
    jQuery('#datepicker-inline').datepicker({
      todayHighlight: true
    });
    // Daterange picker
    $('.input-daterange-datepicker').daterangepicker({
      buttonClasses: ['btn', 'btn-sm'],
      applyClass: 'btn-danger',
      cancelClass: 'btn-inverse'
    });
    $('.input-daterange-timepicker').daterangepicker({
      timePicker: true,
      format: 'MM/DD/YYYY h:mm A',
      timePickerIncrement: 30,
      timePicker12Hour: true,
      timePickerSeconds: false,
      buttonClasses: ['btn', 'btn-sm'],
      applyClass: 'btn-danger',
      cancelClass: 'btn-inverse'
    });
    $('.input-limit-datepicker').daterangepicker({
      format: 'MM/DD/YYYY',
      minDate: '06/01/2015',
      maxDate: '06/30/2015',
      buttonClasses: ['btn', 'btn-sm'],
      applyClass: 'btn-danger',
      cancelClass: 'btn-inverse',
      dateLimit: {
        days: 6
      }
    });
  </script>
  <!-- jQuery file upload -->
  <script src="<?php echo base_url() ?>desain/assets/node_modules/dropify/dist/js/dropify.min.js"></script>
  <script>
    $(document).ready(function() {
      // Basic
      $('.dropify').dropify();

      // Translated
      $('.dropify-fr').dropify({
        messages: {
          default: 'Glissez-déposez un fichier ici ou cliquez',
          replace: 'Glissez-déposez un fichier ou cliquez pour remplacer',
          remove: 'Supprimer',
          error: 'Désolé, le fichier trop volumineux'
        }
      });

      // Used events
      var drEvent = $('#input-file-events').dropify();

      drEvent.on('dropify.beforeClear', function(event, element) {
        return confirm("Do you really want to delete \"" + element.file.name + "\" ?");
      });

      drEvent.on('dropify.afterClear', function(event, element) {
        alert('File deleted');
      });

      drEvent.on('dropify.errors', function(event, element) {
        console.log('Has Errors');
      });

      var drDestroy = $('#input-file-to-destroy').dropify();
      drDestroy = drDestroy.data('dropify')
      $('#toggleDropify').on('click', function(e) {
        e.preventDefault();
        if (drDestroy.isDropified()) {
          drDestroy.destroy();
        } else {
          drDestroy.init();
        }
      })
    });
  </script>
  <!-- This is data table -->
  <script src="<?php echo base_url() ?>desain/assets/node_modules/datatables/jquery.dataTables.min.js"></script>
  <!-- <script src="https://cdn.datatables.net/v/dt/dt-2.0.8/rg-1.5.0/sb-1.7.1/datatables.min.js"></script> -->
  <script src="https://cdn.rawgit.com/ashl1/datatables-rowsgroup/v1.0.0/dataTables.rowsGroup.js"></script>


  <script>
    $(document).ready(function() {
      $('#myTable').DataTable();
      $('#myTable2').DataTable();
      $('#myTable3').DataTable();
      $(document).ready(function() {
        var table = $('#example').DataTable({
          "columnDefs": [{
            "visible": false,
            "targets": 2
          }],
          "order": [
            [2, 'asc']
          ],
          "displayLength": 25,
          "drawCallback": function(settings) {
            var api = this.api();
            var rows = api.rows({
              page: 'current'
            }).nodes();
            var last = null;
            api.column(2, {
              page: 'current'
            }).data().each(function(group, i) {
              if (last !== group) {
                $(rows).eq(i).before('<tr class="group"><td colspan="5">' + group + '</td></tr>');
                last = group;
              }
            });
          }
        });
        // Order by the grouping
        $('#example tbody').on('click', 'tr.group', function() {
          var currentOrder = table.order()[0];
          if (currentOrder[0] === 2 && currentOrder[1] === 'asc') {
            table.order([2, 'desc']).draw();
          } else {
            table.order([2, 'asc']).draw();
          }
        });
      });

    });
  </script>

</body>

</html>