<div class="content-footer"> Copyright
        &copy; <?php echo date('Y'); ?>. <?php echo $atr['footer'] ?>. All Rights Reserved.
      </div><!-- content-footer -->
    </div><!-- content -->
<script src="assets/admin/lib/jquery/jquery.min.js"></script>
    <script src="assets/admin/lib/bootstrap/js/bootstrap.bundle.min.js"></script>
    <script src="assets/admin/lib/feather-icons/feather.min.js"></script>
    <script src="assets/admin/lib/perfect-scrollbar/perfect-scrollbar.min.js"></script>
    <script src="assets/admin/lib/prismjs/prism.js"></script>
    <script src="assets/admin/lib/datatables.net/js/jquery.dataTables.min.js"></script>
    <script src="assets/admin/lib/datatables.net-dt/js/dataTables.dataTables.min.js"></script>
    <script src="assets/admin/lib/datatables.net-responsive/js/dataTables.responsive.min.js"></script>
    <script src="assets/admin/lib/datatables.net-responsive-dt/js/responsive.dataTables.min.js"></script>
    <script src="assets/admin/lib/select2/js/select2.min.js"></script>
    <script src="assets/admin/lib/jquery.flot/jquery.flot.js"></script>
    <script src="assets/admin/lib/jquery.flot/jquery.flot.stack.js"></script>
    <script src="assets/admin/lib/jquery.flot/jquery.flot.resize.js"></script>
    <script src="assets/admin/lib/js-cookie/js.cookie.js"></script>

    <script src="assets/admin/js/cassie.js"></script>
    <script src="assets/admin/js/flot.sampledata.js"></script>
    <script>
	$(document).ready( function () {
		    $('#myTable').DataTable();
		} );
	</script>
	<script>
	    function goBack() {
	        window.history.back();
	    }
	</script>
	<script>
      $(function(){
        'use strict'

        $('#example1').DataTable({
          responsive: true,
          language: {
            searchPlaceholder: 'Search...',
            sSearch: '',
            lengthMenu: '_MENU_ items/page',
          }
        });

        $('#example2').DataTable({
          responsive: true,
          language: {
            searchPlaceholder: 'Search...',
            sSearch: '',
            lengthMenu: '_MENU_ items/page',
          }
        });

        // Select2
        $('.dataTables_length select').select2({ minimumResultsForSearch: Infinity });

      });
    </script>
    <script src="https://cdn.jsdelivr.net/npm/summernote@0.8.18/dist/summernote-lite.min.js"></script>
    <script>
    $(document).ready(function(){
        $('#summernote').summernote({
            height:"700px",
            callbacks:{
                onImageUpload:function(image){
                    uploadImage(image[0])
                },
                onMediaDelete:function(target){
                    deleteImage(target[0].src)
                }
            }
        });
        function uploadImage(image){
            var data=new FormData();
            data.append("image",image);
            data.append('<?php echo $this->security->get_csrf_token_name(); ?>', '<?php echo $this->security->get_csrf_hash(); ?>');
            $.ajax({
                url:"admin/upload_image",
                cache:false,
                contentType:false,
                processData:false,
                data:data,
                type:"POST",success:function(url){
                    $('#summernote').summernote("insertImage",url)
                },
                error:function(data){
                    console.log(data)
                }
            }
            )
        }
        function deleteImage(src){
            var csrfToken = getCookie('<?php echo $this->config->item('csrf_cookie_name'); ?>');
            $.ajax({
                data: {
                    src: src,
                    '<?php echo $this->config->item('csrf_token_name'); ?>': csrfToken
                },
                type:"POST",
                url:"admin/delete_image",
                cache:false,
                success:function(response){
                    console.log(response)
                }
            })
        }
    });
</script>
  </body>
</html>