VaKeR CYBER ARMY
Logo of a company Server : Apache
System : Linux host44.registrar-servers.com 4.18.0-513.18.1.lve.2.el8.x86_64 #1 SMP Sat Mar 30 15:36:11 UTC 2024 x86_64
User : vapecompany ( 2719)
PHP Version : 7.4.33
Disable Function : NONE
Directory :  /home/vapecompany/demo.vapecompany.com.bd/public/backend/js/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/vapecompany/demo.vapecompany.com.bd/public/backend/js/dashboard1.js
/*
Template Name: Admin Pro Admin
Author: Wrappixel
Email: niravjoshi87@gmail.com
File: js
*/
$(function() {
    "use strict";
    
    // ============================================================== 
    // Overview
    // ============================================================== 
    var chart = c3.generate({
        bindto: '.earningsbox'
        , data: {
            columns: [
                ['Site A', 5, 6, 3, 7, 9, 10, 14, 12, 11, 9, 8, 7, 10, 6, 12, 10, 8]
            ]
            , type: 'area-spline'
        }
        , axis: {
            y: {
                show: false
                , tick: {
                    count: 0
                    , outer: false
                }
            }
            , x: {
                show: false
            , }
        }
        , padding: {
            top: 0
            , right: -8
            , bottom: -28
            , left: -8
        , }
        , point: {
            r: 0
        , }
        , legend: {
            hide: true
                //or hide: 'data1'
                //or hide: ['data1', 'data2']
        }
        , color: {
            pattern: ['#40c4ff', '#dadada', '#ff821c', '#7e74fb']
        }
        
    });
    // ============================================================== 
    // Revenue
    // ============================================================== 
    
    var productslabel=[];var i=0;
    var totalproductqty=0;
    $('.product_name').each(function(){
        var newarr=[];
        
        if($('.sall_quantity')[i].value){
            newarr.push(this.value+'('+$('.sall_quantity')[i].value+')');
            newarr.push($('.sall_quantity')[i].value);
            totalproductqty += parseInt($('.sall_quantity')[i].value);
        }else{
             newarr.push(this.value);
            newarr.push(0);
        }
        
        productslabel.push(newarr);
       
        i++;
    });
    var title='Monthly Total Sales :'+totalproductqty+'\n ';
 
    var chart = c3.generate({
        bindto: '.revenue',
        data: {
            columns:productslabel,
            
            type : 'donut'
        },
        donut: {
            label: {
                show: false,
              },
            title:title,
            width:35,
            
        },
        
        legend: {
          hide: false
          //or hide: 'data1'
          //or hide: ['data1', 'data2']
        },
        color: {
              pattern: ['#C0392B','#40c4ff', '#2961ff', '#ff821c', '#7e74fb',' #922B21','#B03A2E','#6C3483','#1A5276','#2874A6','#148F77','#117A65','#1E8449','#239B56','#9A7D0A','#B9770E','#AF601A','#A04000','#909497','#5F6A6A','#515A5A','#212F3C','#5D6D7E']
        }
    });
    
    // ============================================================== 
    // product-sales
    // ============================================================== 
    var category=[];
    var monlyqty=[];
    var lastdaycurrentmonth=parseInt($('.currentMonthlastday')[0].value);
    var currentMonthnow=parseInt($('.currentMonthnow')[0].value);
    //if(currentMonthnow <)
    var i=0;
    monlyqty.push('Sale Quantity:');
    // for(var i=0;i<currentMonthnow;i++){
    //     category.push(i+1);
       
    //     if($('.sall_quantity_monthly'+(i+1))[0]){
    //         monlyqty.push($('.sall_quantity_monthly'+(i+1))[0].value);
    //     }else{
    //         monlyqty.push('0');
    //     }
    // }

    $('.product_name_daily').each(function(){
       
        
        if($('.sall_quantity_daily')[i].value){
            monlyqty.push($('.sall_quantity_daily')[i].value);
        }else{
            monlyqty.push(0);
        }
        category.push(this.value);
        
       
        i++;
    });
    
    if(category.length == 0){
        category.push('No Sales');
        monlyqty.push(0);
    }
    
    var chart = c3.generate({
        bindto: '.product-sales'
        , data: {
            columns: [
                monlyqty
                
            ]
            , type: 'bar'
        }
        , axis: {
            y: {
                show: true
                , tick: {
                    count: 0
                    , outer: false
                }
            }
            , x: {
                //show: true,
                type: 'category',
            categories: category
            , }
        },bar: {
          
          width: 8
            
        }
        , padding: {
            top: 40
            , right: 10
            , bottom: 0
            , left: 20
        , }
        , point: {
            r: 1
        , }
        , legend: {
            hide: true
                //or hide: 'data1'
                //or hide: ['data1', 'data2']
        }
        , color: {
            pattern: ['#2961ff', '#40c4ff', '#ff821c', '#7e74fb']
        }
    });
    
    // ============================================================== 
    // weekly sales
    // ============================================================== 
    var productslabel=[];var i=0;
    var totalproductqty=0;
    $('.product_name_week').each(function(){
        var newarr=[];
        
        if($('.sall_quantity_week')[i].value){
            newarr.push(this.value+'('+$('.sall_quantity_week')[i].value+')');
            newarr.push($('.sall_quantity_week')[i].value);
            totalproductqty += parseInt($('.sall_quantity_week')[i].value);
        }else{
             newarr.push(this.value);
            newarr.push(0);
        }
        
        productslabel.push(newarr);
       
        i++;
    });
    var title='Weekly Total Sales :'+totalproductqty+'\n ';
    var chart = c3.generate({
        bindto: '.rate',
        data: {
            columns:productslabel,
            
            type : 'donut'
        },
        donut: {
            label: {
                show: false,
              },
            title:title,
            width:35,
            
        },
        
        legend: {
          hide: false
          //or hide: 'data1'
          //or hide: ['data1', 'data2']
        },
        color: {
              pattern: ['#C0392B','#40c4ff', '#2961ff', '#ff821c', '#7e74fb',' #922B21','#B03A2E','#6C3483','#1A5276','#2874A6','#148F77','#117A65','#1E8449','#239B56','#9A7D0A','#B9770E','#AF601A','#A04000','#909497','#5F6A6A','#515A5A','#212F3C','#5D6D7E']
        }
    });
    // ============================================================== 
    // Revenue
    // ============================================================== 
    var tre=$('#total_requisition').val();
    var tde=$('#total_chalan').val();
    var tpe=$('#total_pending').val();
    var chart = c3.generate({
        bindto: '.status',
        data: {
            columns: [
                ['Total Requisition',tre],
                ['Total Delivery',tde],
                ['Total Pending',tpe]
            ],
            
            type : 'donut'
        },
        donut: {
            label: {
                show: false
              },
            title:"Orders",
            width:35,
            
        },
        
        legend: {
          hide: true
          //or hide: 'data1'
          //or hide: ['data1', 'data2']
        },
        color: {
              pattern: ['#7460ee', '#2962ff', '#fb8c00']
        }
    });

    $('.div_name');
    var labels = [];
    var colors = [];
    var i=0;
    $('.div_name').each(function(){
        var newarr=[];
        newarr.push(this.value);
        if($('.div_qty')[i].value){
            newarr.push($('.div_qty')[i].value);
        }else{
            newarr.push(0);
        }
        
        labels.push(newarr);
       
        i++;
    });
    $('.div_qty');
    $('.div_color');
    $('.div_color').each(function(){
        colors.push(this.value);
    });
    
    var chart = c3.generate({
        bindto: '.div_status',
        data: {
            columns: labels,
            
            type : 'pie'
        },
        // donut: {
        //     label: {
        //         show: false
        //       },
        //     title:"Orders",
        //     width:35,
            
        // },
        
        legend: {
          hide: true
          //or hide: 'data1'
          //or hide: ['data1', 'data2']
        },
        color: {
              pattern: colors
        }
    });
    $(".sidebartoggler").on("click", function() { chart.resize() });
    



    


      

        
    /*
    // ============================================================== 
    // Our Visitor
    // ============================================================== 
    var sparklineLogin = function () {
        $('#activeu').sparkline([6, 10, 9, 11, 9, 10, 12, 11, 10, 9, 11, 9, 10], {
            type: 'bar'
            , height: '122'
            , barWidth: '4'
            , width: '100%'
            , resize: true
            , barSpacing: '11'
            , barColor: '#fff'
        });
        
    };
    var sparkResize;
    $(window).resize(function (e) {
        clearTimeout(sparkResize);
        sparkResize = setTimeout(sparklineLogin, 500);
    });
    sparklineLogin();
    
    // ============================================================== 
    // EArnings
    // ============================================================== 
    var chart = c3.generate({
        bindto: '.earnings'
        , data: {
            columns: [
                ['Site A', 0, 6, 3, 7, 9, 10, 14, 12, 11, 9, 8, 7, 10, 6, 12, 10, 8]
                
            ]
            , type: 'spline'
        }
        , axis: {
            y: {
                show: false
                , tick: {
                    count: 0
                    , outer: false
                }
            }
            , x: {
                show: false
            , }
        }
        , padding: {
            top: 0
            , right: 10
            , bottom: 0
            , left: 20
        , }
        , point: {
            r: 0
        , }
        , legend: {
            hide: true
                //or hide: 'data1'
                //or hide: ['data1', 'data2']
        }
        , color: {
            pattern: ['#fff', '#ff821c', '#ff821c', '#7e74fb']
        }
    });*/
});
let chartsdiv;
let stage;
    anychart.onDocumentReady(function(){
        stage = anychart.graphics.create("container");
        //console.log(stage);
        chartsdiv =null;
        createnewchat();

     });
    function createnewchat(){
       
            var labels2 = [];
        
        var i=0;
        $('.div_name').each(function(){
            var newarr = new Object();

            newarr.x=this.value;
            newarr.value=parseFloat($('.div_qty')[i].value);
           newarr.fill=$('.div_color')[i].value;
            // newarr.push(this.value);
            // if($('.div_qty')[i].value){
            //     newarr.push($('.div_qty')[i].value);
            // }else{
            //     newarr.push(0);
            // }
            
            labels2.push(newarr);
           
            i++;
        });
      //  console.log(labels2);
        
         var chart = anychart.pie(labels2);
         //chart.bounds("0%","20%", "10%", "10%");
      chart.labels().position('outside');
      chart.outsideLabelsCriticalAngle(100);
       //chart.labels(false);
       chart.legend(false);
      chart.container(stage);
      chart.draw(true);
      chartsdiv=chart;
    }
 function change_division_status(){
    if(chartsdiv){
        chartsdiv.dispose();
    }
    
       createnewchat();
    }
   // createnewchat();
   

VaKeR 2022