<!-- Essential javascripts for application to work-->
<script src="assets/js/jquery-3.7.0.min.js"></script>
    <script src="assets/js/bootstrap.min.js"></script>
    <script src="assets/js/main.js"></script>
    <!-- Page specific javascripts-->
    <script type="text/javascript" src="assets/js/plugins/chart.js"></script>


   

        <!-- Data table plugin-->
    <script src="https://cdn.datatables.net/2.0.3/js/dataTables.js"></script>

    <script src="https://cdn.datatables.net/2.0.3/js/dataTables.bootstrap5.js"></script>
    <script type="text/javascript">
      const salesData = {
        type: "line",
        data: {
            labels: [
                "Jan",
                "Feb",
                "March",
                "April",
                "May",
                "June",
            ],
            datasets: [{
                label: 'Monthly Sales',
                data: [65, 59, 80, 81, 56, 55, 40],
                fill: false,
                borderColor: 'rgb(75, 192, 192)',
                tension: 0.1
            }]
        }
      }
      
      const supportRequests = {
        type: "doughnut",
        data: {
            labels: [
                'In-Progress',
                'Complete',
                'Delayed'
            ],
            datasets: [{
                label: 'Support Requests',
                data: [300, 50, 100],
                backgroundColor: [
                    '#EFCC00',
                    '#5AD3D1',
                    '#FF5A5E'
                ],
                hoverOffset: 4
            }]
        }
      };
      
      const salesChartCtx = document.getElementById('salesChart');
      new Chart(salesChartCtx, salesData);
      
      const supportChartCtx = document.getElementById('supportRequestChart');
      new Chart(supportChartCtx, supportRequests);
      
    </script>


<script>
      document.addEventListener('DOMContentLoaded', function() {
for (var nk = window.location,
    o = $(".app-menu a").filter(function() {
    return this.href == nk;
    })
    .addClass("active")
    .parent()
    .addClass("active");;) {
    // console.log(o)
    if (!o.is("li")) break;
    o = o.parent()
    .addClass("your_class")
    .parent()
    .addClass("active");
    }
    // ______________Active Class
    $(document).ready(function() {
    $(".treeview-menu a").each(function() {
    var pageUrl = window.location.href.split(/[?#]/)[0];
    if (this.href == pageUrl) {
    $(this).addClass("active");
    $(this).parent().addClass("active"); // add active to li of the current link
    $(this).parent().parent().prev().addClass("active"); // add active class to an anchor
    $(this).parent().parent().prev().click(); // click the item to make it drop
    }
    });
    });

       });

</script>