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/cloud_cafsinfotech_in/dist/highcharts/timeoffice_dashboard.js
$(document).ready(function() {
	Highcharts.theme = {
		colors: ['#058DC7', '#50B432', '#ED561B', '#DDDF00', '#24CBE5', '#64E572',   
             '#FF9655', '#FFF263', '#6AF9C4'],
		chart: {
			backgroundColor: {
				linearGradient: [0, 0, 500, 500],
				stops: [
					[0, 'rgb(255, 255, 255)'],
					[1, 'rgb(240, 240, 255)']
				]
			},
		},
		title: {
			style: {
				color: '#000',
				font: 'bold 16px "Trebuchet MS", Verdana, sans-serif'
			}
		},
		subtitle: {
			style: {
				color: '#666666',
				font: 'bold 12px "Trebuchet MS", Verdana, sans-serif'
			}
		},
        legend: {
			layout: 'vertical',
			align: 'right',
			verticalAlign: 'top',
			x: -40,
			y: 80,
			floating: true,
			borderWidth: 1,
			backgroundColor:
				Highcharts.defaultOptions.legend.backgroundColor || '#FFFFFF',
			shadow: true
		},
	};
	// Apply the theme
	Highcharts.setOptions(Highcharts.theme);
});

function emp_master_count(){
    $.ajax({
        type: "POST",
        url: './index.php/timeoffice_dashboard/get_emp_master_count',
        success: function(data) {
            var rslt    = JSON.parse(data);
            $('#total_employees').text(rslt.table_data.total_employees);
            $('#active_employees').text(rslt.table_data.active_employees);
            $('#active_department').text(rslt.table_data.total_departments);
            $('#active_sections').text(rslt.table_data.total_sections);
            $('#joined_this_month').text(rslt.table_data.joined_employees);
            $('#left_this_month').text(rslt.table_data.left_employees);            
        },
    });
}
function get_emp_statistics_info(date_period,category){
	$.ajax({
		type: "POST",
     data: {date_period:date_period,category:category},
		url: './index.php/timeoffice_dashboard/get_emp_statistics',
		success: function(data) {
			var rslt    = JSON.parse(data);
			$('#Statistics_info').html(rslt.table_data);
		},
	});
}
function get_emp_present_absent_info(category){
	$.ajax({
		type: "POST",
     data: {category:category},
		url: './index.php/timeoffice_dashboard/get_emp_present_absent_sts',
		success: function(data) {
			var rslt    = JSON.parse(data);
			$('#present_absent_info').html(rslt.table_data);
		},
	});
}

function get_employee_details(get_cell,table_id,from_date,to_date,category){
    $.ajax({
        type: "POST",
     data: {category:category,from_date:from_date,to_date:to_date,table_id:table_id,get_cell:get_cell},
        url: './index.php/timeoffice_dashboard/get_employee_details',
        success: function(data) {
            var rslt    = JSON.parse(data);            
            $('.modal-body').html(rslt.table_data);
            $('.modal').modal({backdrop: 'static', keyboard: false});
            $('#detail_'+table_id).DataTable();
            $('.modal-title').html("View Employees");
            
        },
    });
}

// EMPLOYEES COUNT DEPARTMENT WISE LINE CHART
function emp_department_count_chart(category){
    var options = {
        chart: {
            renderTo: 'emp_department_count_chart',
            type: 'line',
            marginRight: 120
        },
        title: {
            text: 'Department Wise Employees Count',
            x: -20 //center
        },
        subtitle: {
            text: 'Till Today',
            x: -20
        },
        xAxis: {
            categories: [],
            title: {
                text: 'Department'
            }
        },
        yAxis: {
            title: {
                text: 'Count'
            },
            plotLines: [{
                    value: 0,
                    width: 1,
                    color: '#d84f57'
                }]
        },
        tooltip: {
            valueSuffix: ''
        },
        plotOptions: {
            line: {
                    pointWidth: 70,
                    pointPadding: 0.2,
                    borderWidth: 0,
                    dataLabels: {
                    enabled: true,
                    // fontWidth: 5,
                    color: 'green',
                    formatter: function() {
                    total_month_holiday  = "Total: " + this.point.y;
                    return total_month_holiday;
                    },
                }
            },
        },
        legend: {
            layout: 'vertical',
            align: 'right',
            verticalAlign: 'middle',
            borderWidth: 0,
            x: 0,
            y: 100
        },
        series: []
    };
    $.ajax({
		type: "POST",
		data: {category:category},
		url: './index.php/timeoffice_dashboard/emp_department_count_chart',
		success: function(data) {
			var rslt   = JSON.parse(data);
			options.xAxis.categories = rslt[0]['data'];		
			options.series[0] = rslt[1]; 
			chart = new Highcharts.Chart(options);
		},
	});
}
function emp_leave_details_info(date_period,category){
	$.ajax({
		type: "POST",
     data: {date_period:date_period,category:category},
		url: './index.php/timeoffice_dashboard/emp_leave_details_info',
		success: function(data) {
			var rslt    = JSON.parse(data);
			$('#emp_leave_details_info').html(rslt.table_data);
		},
	});
}
// EMPLOYEE COUNT DESIGNATION WISE
function emp_designation_count_chart(category){
	var designation_employees_count = {
			 chart: {
					type: 'bar',
					renderTo: 'emp_designation_count_chart'
			 },
			title: {
				text: 'Designation Wise Employees Count',
				x: -20 //center
			},
			xAxis: {
				title: {
					text: 'DESIGNATION'
				}
			},
			yAxis: {
				plotLines: [{
						value: 0,
						width: 1,
						color: '#0001'
					}]
			},
			tooltip: {
				valueSuffix: ''
			},
			plotOptions: {
				column: {
					pointPadding: 0.2,
					borderWidth: 0
				}
			},
		series: []
    };	
	$.ajax({
		type: "POST",
		data: {category:category},
		url: './index.php/timeoffice_dashboard/emp_designation_count_chart',
		success: function(data) {
			var rslt   = JSON.parse(data);
			designation_employees_count.xAxis.categories = rslt[0]['data'];		
			designation_employees_count.series[0] = rslt[1]; 
			chart = new Highcharts.Chart(designation_employees_count);
		},
	});
}

function emp_shift_count_chart(date_period,category){
	var emp_shift_count_chart = {
        chart: {
            renderTo: 'emp_shift_count_chart',
            type: 'column',
            marginRight: 120
        },
        title: {
            text: 'Shift Allocated Count',
            x: -20 //center
        },
        subtitle: {
            text: 'Total Employees',
            x: -20
        },
        xAxis: {
            categories: [],
            title: {
                text: 'Shift'
            }
        },
        yAxis: {
            title: {
                text: 'Count'
            },
            plotLines: [{
                    value: 0,
                    width: 1,
                    color: '#d84f57'
                }]
        },
        tooltip: {
            valueSuffix: ''
        },
        plotOptions: {
            line: {
                    pointWidth: 70,
                    pointPadding: 0.2,
                    borderWidth: 0,
                    dataLabels: {
                    enabled: true,
                    // fontWidth: 5,
                    color: 'green',
                    formatter: function() {
                    total_shift_count  = "Total: " + this.point.y;
                    return total_shift_count;
                    },
                }
            },
        },
        legend: {
            layout: 'vertical',
            align: 'right',
            verticalAlign: 'middle',
            borderWidth: 0,
            x: 0,
            y: 100
        },
        series: []
    };
    $.ajax({
		type: "POST",
		data: {date_period:date_period,category:category},
		url: './index.php/timeoffice_dashboard/emp_shift_count_chart',
		success: function(data) {
			var rslt   = JSON.parse(data);
			emp_shift_count_chart.xAxis.categories = rslt[0]['data'];		
			emp_shift_count_chart.series[0] = rslt[1]; 
			chart = new Highcharts.Chart(emp_shift_count_chart);
		},
	});
}