MOON
Server: Apache
System: Linux nserver.cafsindia.com 4.18.0-553.104.1.lve.el8.x86_64 #1 SMP Tue Feb 10 20:07:30 UTC 2026 x86_64
User: cafsindia (1002)
PHP: 8.2.30
Disabled: NONE
Upload Files
File: /home/cafsindia/crm_cafsindia_com/dist/dashboard_RM.js
$(document).ready(function() {

    salesbyitem();
    salesbyitemline();
    salesbyitembar();

    salebycategory();
    salesbycatline();
    salesbycatbar();

    salebyemployee();
    salebyemployeeline();
    salebyemployeebar();

    salebypaymenttype();
    salebypaymenttypeline();
    salebypaymenttypebar();

    salebydate();
    salebydateline();
	salebydatebar();

});

// Item wise sales
function salesbyitem() {

    var options = {
        chart: {
            renderTo: 'salebyitem',
            plotBackgroundColor: null,
            plotBorderWidth: null,
            plotShadow: false
        },
        title: {
            text: 'Sales By Product'
        },
        tooltip: {
            formatter: function() {
                return '<b>' + this.point.name + '</b>: ' + this.y;
            }
        },
        plotOptions: {
            pie: {
                allowPointSelect: true,
                cursor: 'pointer',
                dataLabels: {
                    enabled: true,
                    color: '#000000',
                    connectorColor: '#000000',
                    formatter: function() {
                        return '<b>' + this.point.name + '</b>: ' + this.y;
                    }
                },
                showInLegend: true
            }
        },
        series: []
    };
    $.getJSON("index.php/home/salebyitem", function(json) {
        options.series = json;
        chart = new Highcharts.Chart(options);
    });
}

// Sales by item line view
function salesbyitemline(){
     var options = {
        chart: {
            renderTo: 'salesbyitemline',
            type: 'line'
        },
        title: {
            text: 'Sales By Product',
            x: -20 //center
        },
        subtitle: {
            text: 'live sales',
            x: -20
        },
        xAxis: {
            categories: [],
            title: {
                text: 'Products'
            }
        },
        yAxis: {
            title: {
                text: 'Count'
            },
            plotLines: [{
                    value: 0,
                    width: 1,
                    color: '#000'
                }]
        },
        tooltip: {
            valueSuffix: ''
        },
        legend: {
            layout: 'vertical',
            align: 'right',
            verticalAlign: 'middle',
            borderWidth: 0
        },
        series: []
    };
    $.getJSON("index.php/home/salesbyitemline", function(json) {
        options.xAxis.categories = json[0]['data']; //xAxis: {categories: []}
        options.series[0] = json[1];
        chart = new Highcharts.Chart(options);
    });
}
function salesbyitembar(){
    var options = {
        chart: {
            renderTo: 'salesbyitembar',
            type: 'bar'
        },
        title: {
            text: 'Sales By Product',
            x: -20 //center
        },
        subtitle: {
            text: 'live sales',
            x: -20
        },
        xAxis: {
            categories: [],
            title: {
                text: 'Products'
            }
        },
        yAxis: {
            title: {
                text: 'Count'
            },
            plotLines: [{
                    value: 0,
                    width: 1,
                    color: '#000'
                }]
        },
        tooltip: {
            valueSuffix: ''
        },
        legend: {
            layout: 'vertical',
            align: 'right',
            verticalAlign: 'middle',
            borderWidth: 0
        },
        series: []
    };
    $.getJSON("index.php/home/salesbyitembar", function(json) {
        options.xAxis.categories = json[0]['data']; //xAxis: {categories: []}
        options.series[0] = json[1];
        chart = new Highcharts.Chart(options);
    });
}

//category wise sales report
function salebycategory(){
    var options = {
        chart: {
            renderTo: 'salebycategory',
            plotBackgroundColor: null,
            plotBorderWidth: null,
            plotShadow: false
        },
        title: {
            text: 'Sales By Category'
        },
        tooltip: {
            formatter: function() {
                return '<b>' + this.point.name + '</b>: ' + this.y;
            }
        },
        plotOptions: {
            pie: {
                allowPointSelect: true,
                cursor: 'pointer',
                dataLabels: {
                    enabled: true,
                    color: '#000000',
                    connectorColor: '#000000',
                    formatter: function() {
                        return '<b>' + this.point.name + '</b>: ' + this.y;
                    }
                },
                showInLegend: true
            }
        },
        series: []
    };
    $.getJSON("index.php/home/salebycategory", function(json) {
        options.series = json;
        chart = new Highcharts.Chart(options);
    });
}

// Sales by  line view 
function salesbycatline(){
    var options = {
        chart: {
            renderTo: 'salesbycatline',
            type: 'line'
        },
        title: {
            text: 'Sales By Category',
            x: -20 //center
        },
        subtitle: {
            text: 'live sales',
            x: -20
        },
        xAxis: {
            categories: [],
            title: {
                text: 'Category'
            }
        },

        yAxis: {
            title: {
                text: 'Count'
            },
            plotLines: [{
                    value: 0,
                    width: 1,
                    color: '#000'
                }]
        },
        tooltip: {
            valueSuffix: ''
        },
        legend: {
            layout: 'vertical',
            align: 'right',
            verticalAlign: 'middle',
            borderWidth: 0
        },
        series: []
    };
    $.getJSON("index.php/home/salesbycatline", function(json) {
        options.xAxis.categories = json[0]['data']; //xAxis: {categories: []}
        options.series[0] = json[1];
        chart = new Highcharts.Chart(options);
    });
}

// Sales by  line view 
function salesbycatbar(){
    var options = {
        chart: {
            renderTo: 'salesbycatbar',
            type: 'bar'
        },
        title: {
            text: 'Sales By Category',
            x: -20 //center
        },
        subtitle: {
            text: 'live sales',
            x: -20
        },
        xAxis: {
            categories: [],
            title: {
                text: 'Category'
            }
        },

        yAxis: {
            title: {
                text: 'Count'
            },
            plotLines: [{
                    value: 0,
                    width: 1,
                    color: '#000'
                }]
        },
        tooltip: {
            valueSuffix: ''
        },
        legend: {
            layout: 'vertical',
            align: 'right',
            verticalAlign: 'middle',
            borderWidth: 0
        },
        series: []
    };
    $.getJSON("index.php/home/salesbycatbar", function(json) {
        options.xAxis.categories = json[0]['data']; //xAxis: {categories: []}
        options.series[0] = json[1];
        chart = new Highcharts.Chart(options);
    });
}

//  Sales by employee
function salebyemployee() {
    var options = {
        chart: {
            renderTo: 'salebyemployee',
            plotBackgroundColor: null,
            plotBorderWidth: null,
            plotShadow: false
        },
        title: {
            text: 'Sales By Employee'
        },
        tooltip: {
            formatter: function() {
                return '<b>' + this.point.name + '</b>: ' + this.y;
            }
        },
        plotOptions: {
            pie: {
                allowPointSelect: true,
                cursor: 'pointer',
                dataLabels: {
                    enabled: true,
                    color: '#000000',
                    connectorColor: '#000000',
                    formatter: function() {
                        return '<b>' + this.point.name + '</b>: ' + this.y;
                    }
                },
                showInLegend: true
            }
        },
        series: []
    };
    $.getJSON("index.php/home/salebyemployee", function(json) {
        options.series = json;
        chart = new Highcharts.Chart(options);
    });
}

function salebyemployeeline(){
    var options = {
        chart: {
            renderTo: 'salebyemployeeline',
            type: 'line'
        },
        title: {
            text: 'Sales By Employee',
            x: -20 //center
        },
        subtitle: {
            text: 'live sales',
            x: -20
        },
        xAxis: {
            categories: [],
            title: {
                text: 'Employee'
            }
        },
        yAxis: {
            title: {
                text: 'Count'
            },
            plotLines: [{
                    value: 0,
                    width: 1,
                    color: '#000'
                }]
        },

        tooltip: {
            valueSuffix: ''
        },
        legend: {
            layout: 'vertical',
            align: 'right',
            verticalAlign: 'middle',
            borderWidth: 0
        },
        series: []
    };
    $.getJSON("index.php/home/salebyemployeeline", function(json) {
        options.xAxis.categories = json[0]['data']; //xAxis: {categories: []}
        options.series[0] = json[1];
        chart = new Highcharts.Chart(options);
    });
}
function salebyemployeebar(){
    var options = {
        chart: {
            renderTo: 'salebyemployeebar',
            type: 'bar'
        },
        title: {
            text: 'Sales By Employee',
            x: -20 //center
        },
        subtitle: {
            text: 'live sales',
            x: -20
        },
        xAxis: {
            categories: [],
            title: {
                text: 'Employee'
            }
        },
        yAxis: {
            title: {
                text: 'Count'
            },
            plotLines: [{
                    value: 0,
                    width: 1,
                    color: '#000'
                }]
        },

        tooltip: {
            valueSuffix: ''
        },
        legend: {
            layout: 'vertical',
            align: 'right',
            verticalAlign: 'middle',
            borderWidth: 0
        },
        series: []
    };
    $.getJSON("index.php/home/salebyemployeebar", function(json) {
        options.xAxis.categories = json[0]['data']; //xAxis: {categories: []}
        options.series[0] = json[1];
        chart = new Highcharts.Chart(options);
    });
}

function salebypaymenttype() {
    var options = {
        chart: {
            renderTo: 'salebypaymenttype',
            plotBackgroundColor: null,
            plotBorderWidth: null,
            plotShadow: false
        },
        title: {
            text: 'Sales By Payment'
        },
        tooltip: {
            formatter: function() {
                return '<b>' + this.point.name + '</b>: ' + this.y;
            }
        },
        plotOptions: {
            pie: {
                allowPointSelect: true,
                cursor: 'pointer',
                dataLabels: {
                    enabled: true,
                    color: '#000000',
                    connectorColor: '#000000',
                    formatter: function() {
                        return '<b>' + this.point.name + '</b>: ' + this.y;
                    }
                },
                showInLegend: true
            }
        },
        series: []
    };
    $.getJSON("index.php/home/salebypaymenttype", function(json) {
        options.series = json;
        chart = new Highcharts.Chart(options);
    });
}
function salebypaymenttypeline(){
    var options = {
        chart: {
            renderTo: 'salebypaymenttypeline',
            type: 'line'
        },
        title: {
            text: 'Sales By Payment',
            x: -20 //center
        },
        subtitle: {
            text: 'live sales',
            x: -20
        },
        xAxis: {
            categories: [],
            title: {
                text: 'Payment'
            }
        },
        yAxis: {
            title: {
                text: 'Count'
            },
            plotLines: [{
                    value: 0,
                    width: 1,
                    color: '#000'
                }]
        },
        tooltip: {
            valueSuffix: ''
        },
        legend: {
            layout: 'vertical',
            align: 'right',
            verticalAlign: 'middle',
            borderWidth: 0
        },
        series: []
    };
    $.getJSON("index.php/home/salebypaymenttypeline", function(json) {
        options.xAxis.categories = json[0]['data']; //xAxis: {categories: []}
        options.series[0] = json[1];
        chart = new Highcharts.Chart(options);
    });
}
function salebypaymenttypebar(){
    var options = {
        chart: {
            renderTo: 'salebypaymenttypebar',
            type: 'bar'
        },
        title: {
            text: 'Sales By Payment',
            x: -20 //center
        },
        subtitle: {
            text: 'live sales',
            x: -20
        },
        xAxis: {
            categories: [],
            title: {
                text: 'Payment'
            }
        },
        yAxis: {
            title: {
                text: 'Count'
            },
            plotLines: [{
                    value: 0,
                    width: 1,
                    color: '#000'
                }]
        },
        tooltip: {
            valueSuffix: ''
        },
        legend: {
            layout: 'vertical',
            align: 'right',
            verticalAlign: 'middle',
            borderWidth: 0
        },
        series: []
    };
    $.getJSON("index.php/home/salebypaymenttypebar", function(json) {
        options.xAxis.categories = json[0]['data']; //xAxis: {categories: []}
        options.series[0] = json[1];
        chart = new Highcharts.Chart(options);
    });
}

function salebydate() {
    var options = {
        chart: {
            renderTo: 'salebydate',
            plotBackgroundColor: null,
            plotBorderWidth: null,
            plotShadow: false
        },
        title: {
            text: 'Sales By Date'
        },
        tooltip: {
            formatter: function() {
                return '<b>' + this.point.name + '</b>: ' + this.y;
            }
        },
        plotOptions: {
            pie: {
                allowPointSelect: true,
                cursor: 'pointer',
                dataLabels: {
                    enabled: true,
                    color: '#000000',
                    connectorColor: '#000000',
                    formatter: function() {
                        return '<b>' + this.point.name + '</b>: ' + this.y;
                    }
                },
                showInLegend: true
            }
        },
        series: []
    };
    $.getJSON("index.php/home/salebydate", function(json) {
        options.series = json;
        chart = new Highcharts.Chart(options);
    });
}

function salebydateline(){
    var options = {
        chart: {
            renderTo: 'salebydateline',
            type: 'line'
        },
        title: {
            text: 'Sales By Date',
            x: -20 //center
        },
        subtitle: {
            text: 'live sales',
            x: -20
        },
        xAxis: {
            categories: [],
            title: {
                text: 'Payment'
            }
        },
        yAxis: {
            title: {
                text: 'Count'
            },
            plotLines: [{
                    value: 0,
                    width: 1,
                    color: '#000'
                }]
        },
        tooltip: {
            valueSuffix: ''
        },
        legend: {
            layout: 'vertical',
            align: 'right',
            verticalAlign: 'middle',
            borderWidth: 0
        },
        series: []
    };
    $.getJSON("index.php/home/salebydateline", function(json) {
        options.xAxis.categories = json[0]['data']; //xAxis: {categories: []}
        options.series[0] = json[1];
        chart = new Highcharts.Chart(options);
    });
}

function salebydatebar(){
     var options = {
        chart: {
            renderTo: 'salebydatebar',
            type: 'bar'
        },
        title: {
            text: 'Sales By Date',
            x: -20 //center
        },
        subtitle: {
            text: 'live sales',
            x: -20
        },
        xAxis: {
            categories: [],
            title: {
                text: 'Payment'
            }
        },
        yAxis: {
            title: {
                text: 'Count'
            },
            plotLines: [{
                    value: 0,
                    width: 1,
                    color: '#000'
                }]
        },
        tooltip: {
            valueSuffix: ''
        },
        legend: {
            layout: 'vertical',
            align: 'right',
            verticalAlign: 'middle',
            borderWidth: 0
        },
        series: []
    };
    $.getJSON("index.php/home/salebydatebar", function(json) {
        options.xAxis.categories = json[0]['data']; //xAxis: {categories: []}
        options.series[0] = json[1];
        chart = new Highcharts.Chart(options);
    });   
}