<footer class="site-footer">
    <div class="text-center">
        20<?php echo date('y'); ?> &copy; <?php echo lang('livestock'); ?> | <?php echo lang('livestock_management_system_by_wake_up_ict'); ?>.
        <a href="<?php echo current_full_url() . '#'; ?>" class="go-top">
            <i class="fa fa-angle-up"></i>
        </a>
    </div>
</footer>
<!--footer end-->
</section>
<!-- js placed at the end of the document so the pages load faster -->
<script type="text/javascript" src="<?php echo base_url('common/js/jquery.js'); ?>"></script>
<script type="text/javascript" src="<?php echo base_url('common/js/jquery-1.8.3.min.js'); ?>"></script>
<script type="text/javascript" src="<?php echo base_url('common/js/bootstrap.min.js'); ?>"></script>



<script type="text/javascript" src="<?php echo base_url('common/js/jquery.scrollTo.min.js'); ?>"></script>
<script type="text/javascript" src="<?php echo base_url('common/js/jquery.nicescroll.js'); ?>"></script>
<script type="text/javascript" src="<?php echo base_url('common/assets/data-tables/jquery.dataTables.js'); ?>"></script>
<script type="text/javascript" src="<?php echo base_url('common/assets/data-tables/DT_bootstrap.js'); ?>"></script>
<script type="text/javascript" src="<?php echo base_url('common/js/respond.min.js'); ?>"></script>
<script type="text/javascript" src="<?php echo base_url('common/assets/bootstrap-datepicker/js/bootstrap-datepicker.js'); ?>"></script>
<script type="text/javascript" src="<?php echo base_url('common/assets/bootstrap-datetimepicker/js/bootstrap-datetimepicker.js'); ?>"></script>
<script type="text/javascript" src="<?php echo base_url('common/assets/jquery-multi-select/js/jquery.multi-select.js'); ?>"></script>
<script type="text/javascript" src="<?php echo base_url('common/assets/jquery-multi-select/js/jquery.quicksearch.js'); ?>"></script>
<!-- <script type="text/javascript" src="common/assets/bootstrap-datepicker/js/bootstrap-datepicker.js"></script> -->
<!-- <script type="text/javascript" src="common/assets/jquery-ui/jquery-ui.min.js"></script> -->
<script type="text/javascript" src="<?php echo base_url('common/js/jquery-ui-1.11.2.js'); ?>"></script>
<!-- Toastr -->
<script type="text/javascript" src="<?php echo base_url('common/js/toastr.min.js'); ?>"></script>
<!-- sweet Alert -->
<script type="text/javascript" src="<?php echo base_url('common/assets/sweetalert2/sweetalert2.all.min.js'); ?>"></script>
<!-- <script src="common/js/advanced-form-components.js"></script> -->

<script type="text/javascript" src="<?php echo base_url('common/assets/ckeditor/ckeditor.js'); ?>"></script>

<script type="text/javascript" src="<?php echo base_url('common/js/jquery.cookie.js'); ?>"></script>

<!--common script for all pages-->
<script type="text/javascript" src="<?php echo base_url('common/js/common-scripts.js'); ?>"></script>
<script class="include" type="text/javascript" src="<?php echo base_url('common/js/jquery.dcjqaccordion.2.7.js'); ?>"></script>

<!--script for this page only-->
<script src="<?php echo base_url('common/js/editable-table.js'); ?>"></script>

<!-- END JAVASCRIPTS -->
<script>
    $(document).ready(function() {
        // Date picker
        $('.datepicker').datepicker({
            dateFormat: '<?php if ($settings->date_format == "d-m-Y") {
                                echo "dd-mm-yy";
                            } else {
                                echo "mm-dd-yy";
                            } ?>'
        });

        // Year picker
        $(".yearpicker").datepicker({
            dateFormat: 'yy'
        });
    });


    jQuery(document).ready(function() {
        EditableTable.init();
    });

    // $('.default-date-picker').datepicker({
    //     format: 'dd-mm-yyyy'
    // });
</script>


<script>
    $(window).scroll(function() {

        if ($(this).scrollTop() > 0) {
            $('.top_menu_title').fadeOut();
            $('.top-nav').fadeOut();
        } else {
            $('.top_menu_title').fadeIn();
            $('.top-nav').fadeIn();
        }
    });
</script>
<script type="text/javascript" src="<?php echo base_url('common/assets/select2/select2.min.js'); ?>"></script>


<script type="text/javascript">
    $(document).ready(function() {
        $(".js-example-basic-single").select2();

        $(".js-example-basic-multiple").select2();
    });
</script>
<script>
    $('.multi-select').multiSelect({
        selectableHeader: "<input type='text' class='search-input' autocomplete='off' placeholder=' search...'>",
        selectionHeader: "<input type='text' class='search-input' autocomplete='off' placeholder=''>",
        afterInit: function(ms) {
            var that = this,
                $selectableSearch = that.$selectableUl.prev(),
                $selectionSearch = that.$selectionUl.prev(),
                selectableSearchString = '#' + that.$container.attr('id') + ' .ms-elem-selectable:not(.ms-selected)',
                selectionSearchString = '#' + that.$container.attr('id') + ' .ms-elem-selection.ms-selected';
            that.qs1 = $selectableSearch.quicksearch(selectableSearchString)
                .on('keydown', function(e) {
                    if (e.which === 40) {
                        that.$selectableUl.focus();
                        return false;
                    }
                });
            that.qs2 = $selectionSearch.quicksearch(selectionSearchString)
                .on('keydown', function(e) {
                    if (e.which == 40) {
                        that.$selectionUl.focus();
                        return false;
                    }
                });
        },
        afterSelect: function() {
            this.qs1.cache();
            this.qs2.cache();
        },
        afterDeselect: function() {
            this.qs1.cache();
            this.qs2.cache();
        }
    });
</script>

<script>
    $('#my_multi_select3').multiSelect()
</script>

<!-- Sweet Alert -->
<script>
    $(document).on("click", ".deleteBySweetAlert", function(e) {
        e.preventDefault();
        var link = $(this).attr("href");
        var totalUsedPlace = $(this).attr("total-used");
        var typeName = $(this).attr("type-name");
        if (totalUsedPlace > 0) {
            var textPrint = "This Livestock type (" + typeName + ") is used " + totalUsedPlace + " another places. That will be removed. Are you sure you want to delete this item?";
        } else {
            var textPrint = "You won't be able to revert this!";
        }
        Swal.fire({
            title: 'Are you sure?',
            text: textPrint,
            icon: 'warning',
            showCancelButton: true,
            confirmButtonColor: '#3085d6',
            cancelButtonColor: '#d33',
            confirmButtonText: 'Yes, delete it!'
        }).then((result) => {
            if (result.isConfirmed) {
                window.location.href = link;
                Swal.fire('Deleted!', 'Your file has been deleted.', 'success');
            } else {
                Swal.fire('Canceled!', 'Your imaginary file is safe :)', 'error');
            }
        });
    });
</script>




<!-- input only number/float number/ remove white space -->
<!-- Input field (type="text") -->
<script>
    $(document).ready(function() {
        // Remove White  Space
        $(".input__number").on('keyup change paste keypress', function(e) {
            var data, i;
            data = document.querySelectorAll(".input__number"); //HTML DOM querySelector() Method
            for (i = 0; i < data.length; i++) {
                data[i].value = data[i].value.replace(/[^0-9.]/g, '').replace(/(\..*)\./g, '$1');
            }
        });

        $(".input__number").on('drop', function(e) {
            $(this).prop("readonly", true)
        });
        $(".input__number").on('click, keyup', function(e) {
            $(this).prop("readonly", false)
        });
    });
</script>
<!-- =============================== Readonly Input Field =============================== -->
<script>
    $(".readonly").on('keydown paste focus mousedown', function(e) {
        if (e.keyCode != 9) // ignore tab
            e.preventDefault();
    });
</script>
<!-- Create PDF File -->
<script type="text/javascript" src="<?php echo base_url('common/assets/canvas/pdfmake-0.1.22.min.js'); ?>"></script>
<script type="text/javascript" src="<?php echo base_url('common/assets/canvas/html2canvas-0.4.1.min.js'); ?>"></script>
<script type="text/javascript">
    $("body").on("click", "#exportButton", function() {

        html2canvas($('[id*=createPdfPrintBody]')[0], {
            onrendered: function(canvas) {
                var data = canvas.toDataURL();
                var docDefinition = {
                    content: [{
                        image: data,
                        width: 520,
                    }]
                };
                pdfMake.createPdf(docDefinition).download("invoice.pdf");
            }
        });
    });
</script>



</body>

</html>