     <script src="https://cdn.datatables.net/1.11.0/js/jquery.dataTables.min.js"></script>
     <script src="https://cdn.datatables.net/1.11.0/js/dataTables.bootstrap5.min.js"></script>
     <script src="<?php echo THEME_BASEURL; ?>assets/vendor/moment.min.js"></script>
     <script src="<?php echo THEME_BASEURL; ?>assets/vendor/daterangepicker.js"></script>
     <script type="text/javascript">
        $(document).ready(function()
        {
            $("#datatable").DataTable({
                    
            });

            var toastTrigger = document.getElementById('liveToastBtn')
            var toastLiveExample = document.getElementById('liveToast')
            if (toastTrigger) {
              toastTrigger.addEventListener('click', function () {
                var toast = new bootstrap.Toast(toastLiveExample)

                toast.show()
              })
            }
            var toastTrigger = document.querySelectorAll('[data-bs-autohide="true"]');
            toastTrigger.forEach(function(e){
              var toast = new bootstrap.Toast(e)
              toast.show()
            })

            $('#new-tanggalkegiatan').daterangepicker({
                singleDatePicker: true,
                showDropdowns: true,
                minYear: 2010,
                maxYear: parseInt(moment().format('YYYY'),10),
                locale: {
                  format: 'YYYY-MM-DD'
                }
              });

            $('#edit-tanggalkegiatan').daterangepicker({
                singleDatePicker: true,
                showDropdowns: true,
                minYear: 2010,
                maxYear: parseInt(moment().format('YYYY'),10),
                locale: {
                  format: 'YYYY-MM-DD'
                }
              });
        });

        $(window).on("load", function () {
            <?php if(isset($_GET['stat'])){ ?>
            setTimeout(
              function() 
              {
                $("#liveToastBtn").click();
              }, 2000);
            <?php } ?>


        });

        function toDisplayImg(name,url){
           $('#display-img').attr('src','');
           $('#displayimageLabel').html('Foto Lokasi ' + name);
           $('#display-img').attr('src',url);
        }

        function todetail(id){
            $.get('<?php echo BASEURL; ?>data/data.php?data=dokkegiatanDetail&id=' + id, function( data ) { 
                $('#edit-id').val(id);
                $('#edit-namakegiatan').val(data.nama_kegiatan);
                $('#edit-tipekegiatan').val(data.kategori_kegiatan).change();
                $('#edit-tanggalkegiatan').val(data.waktu);
                //$('#edit-fotokegiatan').val(data.file_kegiatan);
                $('#edit-catatankegiatan').val(data.catatan);
            },'json'); 
        } 
     </script>