<?php
include 'connect/cms-config.php' ;
include 'requires/function.php' ;
$user_permission_check = 'all-permission' ;
include 'requires/session.php' ;

// keep parameter in value
$page 				= escapeString($_GET['page']) ;
$type 				= escapeString($_GET['type']) ;

// active page
$active_main_menu 	= 'dashboard' ;
$active_menu 		= 'dashboard' ;

// check permission
if ( !permissionCheck($row_user, 'dashboard-view') ){
	header('Location: page-logout.php') ;
	exit ;
}



// start header here
include 'requires/page_header.php' ;
// include 'requires/page_top.php' ;

?>

	<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
    <script type="text/javascript">

      	google.charts.load('current', {'packages':['corechart']});
      	google.charts.setOnLoadCallback(drawChartTask);
     	google.charts.setOnLoadCallback(drawChartSuggestion);
     	google.charts.setOnLoadCallback(drawChartRequest);
     	google.charts.setOnLoadCallback(drawChartGrievance);
     	google.charts.setOnLoadCallback(drawChartRedeem);
     	google.charts.setOnLoadCallback(drawChartAssociation);
     	google.charts.setOnLoadCallback(drawChartTraining);
     	google.charts.setOnLoadCallback(drawChartHeadcount);
     	google.charts.setOnLoadCallback(drawChartNomination);
     	google.charts.setOnLoadCallback(drawChartResignation);

     	<?php 
     		$loop_counter = 6; 
     		$search_date =  escapeString($_GET['search_date']);
     		$cur_date = ($search_date != '' ? $search_date : date('Y-m-d'));
     	?>

     	function drawChartTask() {

			<?php 
				unset($array_label_date);

				for ($i = $loop_counter; $i >= 0; $i--) {
					$date = date('Y-m-d', strtotime('-'.$i.' days', strtotime( ($cur_date != '' ? $cur_date : date('Y-m-d') ) )));

					$mysqli_ck_created_task = $mysqli->query("SELECT count(task_id) AS count_created_task FROM task where DATE(created_at) = '".$date."' AND deleted_at IS NULL");
					if ($mysqli_ck_created_task->num_rows >0) {
						$row_ck_created_task = $mysqli_ck_created_task->fetch_assoc();
						$count_created_task = $row_ck_created_task['count_created_task'];
					}else{
						$count_created_task = 0;
					}	

					$mysqli_ck_approved_task = $mysqli->query("SELECT count(task_id) AS count_approved_task FROM task where status = 'approved' AND DATE(updated_at) = '".$date."' AND deleted_at IS NULL");
					if ($mysqli_ck_approved_task->num_rows >0) {
						$row_ck_approved_task = $mysqli_ck_approved_task->fetch_assoc();
						$count_approved_task = $row_ck_approved_task['count_approved_task'];
					}else{
						$count_approved_task = 0;
					}

					$array_label_date[$i] = [$date, $count_created_task, $count_approved_task];
				}

			?>

			const array_label_date = [["Date", "Created", "Approved"]];

			<?php
				foreach ($array_label_date as $key => $value) {
			?>
				array_label_date.push(["<?php print_r($value[0])?>", <?php print_r($value[1])?>, <?php print_r($value[2])?>]);
			<?php } ?>

	        var data = google.visualization.arrayToDataTable(array_label_date);

	        var max_vAxis = Math.max(data.getColumnRange(1).max,data.getColumnRange(2).max);
	        if (max_vAxis == 0) {
	        	max_vAxis = 1;
	        }
	        var min_vAxis = Math.min(data.getColumnRange(1).min,data.getColumnRange(2).min);

	        var options = {
	        	title: 'Monthly Task Chart',
				legend:'bottom',
				lineWidth: 5,
				tooltip: { trigger: 'selection' },
				vAxis: {
					viewWindow: {
						min: min_vAxis,
						max: max_vAxis
					}
				},
				series: {
					0: {
			            color: '#5368ff',
			            type: 'bars',
			            pointSize: 15
			        },
			        1: {
			            color: '#ff5353',
			            type: 'line',
			            pointSize: 15
			        },
				}
	        };
	        var chart = new google.visualization.ComboChart(document.getElementById('chartContainer1'));

	        chart.draw(data, options);

			chart.setAction({
				id: 'task_opt',
				text: 'Check Details',
				action: function() {
					selection = chart.getSelection();
					console.log(array_label_date);
					var column_num_select = selection[0].column;
					var row_num_select = selection[0].row + 1;
					var date_select;
					var type_select;

					date_select = array_label_date[row_num_select][0];

					if (column_num_select == 1) {
						type_select = 'created';
					}else if (column_num_select == 2) {
						type_select = 'approved';
					}

					window.open("task.php?"+(type_select != 'created' ? '&search_type[]='+type_select : '')+"&search_create_date="+(type_select == 'created' ? date_select : '')+"&search_update_date="+(type_select != 'created' ? date_select : '')+"&page_mode=list","_blank");
				}
			});

			google.visualization.events.addListener(chart, 'select', showHide);
			var cur_item = 0;

			function showHide() {
	    	 	
				var selection = chart.getSelection();
			  	for (var i = 0; i < selection.length; i++) {

				    var item = selection[i];
				    if (item.row == null) {
					    if (cur_item == 0 || cur_item == '') {
						    if (item.column == 1) {
						    	cur_item = item.column;
						    	view = new google.visualization.DataView(data);
						      	view.hideColumns([2]); 
						      	options.series[0].color = '#5368ff';
						      	options.series[0].type = 'bars';
						      	chart.draw(view, options);
						    }else if (item.column == 2) {
						    	cur_item = item.column;
						    	view = new google.visualization.DataView(data);
						      	view.hideColumns([1]); 
						      	options.series[0].color = '#ff5353';
						      	options.series[0].type = 'line';
						      	chart.draw(view, options);
						    }
						}else{
							cur_item = 0;
							view = new google.visualization.DataView(data);
							options.series[0].color = '#5368ff';
							options.series[0].type = 'bars';
							options.series[1].color = '#ff5353';
						    options.series[1].type = 'line';
						    chart.draw(view, options);
						}
					}
			  	}
			}
	    }


      	function drawChartSuggestion() {

			<?php
				unset($array_label_date);

				for ($i = $loop_counter; $i >= 0; $i--) {
					$date = date('Y-m-d', strtotime('-'.$i.' days', strtotime( ($cur_date != '' ? $cur_date : date('Y-m-d') ) )));

					$mysqli_ck_created_sug = $mysqli->query("SELECT count(suggestion_id) AS count_created_sug FROM suggestion where DATE(created_at) = '".$date."' AND deleted_at IS NULL");
					if ($mysqli_ck_created_sug->num_rows >0) {
						$row_ck_created_sug = $mysqli_ck_created_sug->fetch_assoc();
						$count_created_sug = $row_ck_created_sug['count_created_sug'];
					}else{
						$count_created_sug = 0;
					}	

					$mysqli_ck_approved_sug = $mysqli->query("SELECT count(suggestion_id) AS count_approved_sug FROM suggestion where status = 'confirmed' AND DATE(updated_at) = '".$date."' AND deleted_at IS NULL");
					if ($mysqli_ck_approved_sug->num_rows >0) {
						$row_ck_approved_sug = $mysqli_ck_approved_sug->fetch_assoc();
						$count_approved_sug = $row_ck_approved_sug['count_approved_sug'];
					}else{
						$count_approved_sug = 0;
					}

					$array_label_date[$i] = [$date, $count_created_sug, $count_approved_sug];
				}

			?>

			const array_label_date = [["Date", "Created", "Approved"]];

			<?php
				foreach ($array_label_date as $key => $value) {
			?>
				array_label_date.push(["<?php print_r($value[0])?>", <?php print_r($value[1])?>, <?php print_r($value[2])?>]);
			<?php } ?>

	        var data = google.visualization.arrayToDataTable(array_label_date);

	        var max_vAxis = Math.max(data.getColumnRange(1).max,data.getColumnRange(2).max);
	        if (max_vAxis == 0) {
	        	max_vAxis = 1;
	        }
	        var min_vAxis = Math.min(data.getColumnRange(1).min,data.getColumnRange(2).min);

	       var options = {
	        	title: 'Monthly Suggestion Chart',
				legend:'bottom',
				lineWidth: 5,
				tooltip: { trigger: 'selection' },
				vAxis: {	
					viewWindow: {
			            min: min_vAxis,
			            max: max_vAxis
			        }
				},
				series: {
					0: {
			            color: '#5368ff',
			            type: 'bars',
			            pointSize: 15
			        },
			        1: {
			            color: '#ff5353',
			            type: 'line',
			            pointSize: 15
			        },
				}
	        };
	        var chart = new google.visualization.ComboChart(document.getElementById('chartContainer2'));

	        chart.draw(data, options);

	        chart.setAction({
				id: 'suggest_opt',
				text: 'Check Details',
				action: function() {
					selection = chart.getSelection();
					console.log(array_label_date);
					var column_num_select = selection[0].column;
					var row_num_select = selection[0].row + 1;
					var date_select;
					var type_select;

					date_select = array_label_date[row_num_select][0];

					if (column_num_select == 1) {
						type_select = 'created';
					}else if (column_num_select == 2) {
						type_select = 'confirmed';
					}

					window.open("app-suggestion.php?search_date="+(type_select == 'created' ? date_select : '')+"&search_update_date="+(type_select != 'created' ? date_select : '')+"&search_type="+(type_select != 'created' ? type_select : '')+"&page_mode=list","_blank");
				}
			});

			google.visualization.events.addListener(chart, 'select', showHide);
			var cur_item = 0;

			function showHide() {
	    	 	
				var selection = chart.getSelection();
			  	for (var i = 0; i < selection.length; i++) {

				    var item = selection[i];
				    if (item.row == null) {
					    if (cur_item == 0 || cur_item == '') {
						    if (item.column == 1) {
						    	cur_item = item.column;
						    	view = new google.visualization.DataView(data);
						      	view.hideColumns([2]); 
						      	options.series[0].color = '#5368ff';
						      	options.series[0].type = 'bars';
						      	chart.draw(view, options);
						    }else if (item.column == 2) {
						    	cur_item = item.column;
						    	view = new google.visualization.DataView(data);
						      	view.hideColumns([1]); 
						      	options.series[0].color = '#ff5353';
						      	options.series[0].type = 'line';
						      	chart.draw(view, options);
						    }
						}else{
							cur_item = 0;
							view = new google.visualization.DataView(data);
							options.series[0].color = '#5368ff';
							options.series[0].type = 'bars';
							options.series[1].color = '#ff5353';
						    options.series[1].type = 'line';
						    chart.draw(view, options);
						}
					}
			  	}
			}
	    }


	    function drawChartRequest() {

			<?php
				unset($array_label_date);

				for ($i = $loop_counter; $i >= 0; $i--) {
					$date = date('Y-m-d', strtotime('-'.$i.' days', strtotime( ($cur_date != '' ? $cur_date : date('Y-m-d') ) )));

					$mysqli_ck_created_request = $mysqli->query("SELECT count(request_id) AS count_created_request FROM request where DATE(created_at) = '".$date."' AND deleted_at IS NULL");
					if ($mysqli_ck_created_request->num_rows >0) {
						$row_ck_created_request = $mysqli_ck_created_request->fetch_assoc();
						$count_created_request = $row_ck_created_request['count_created_request'];
					}else{
						$count_created_request = 0;
					}	

					$mysqli_ck_approved_request = $mysqli->query("SELECT count(request_id) AS count_approved_request FROM request where status = 'confirmed' AND DATE(updated_at) = '".$date."' AND deleted_at IS NULL");
					if ($mysqli_ck_approved_request->num_rows >0) {
						$row_ck_approved_request = $mysqli_ck_approved_request->fetch_assoc();
						$count_approved_request = $row_ck_approved_request['count_approved_request'];
					}else{
						$count_approved_request = 0;
					}

					$array_label_date[$i] = [$date, $count_created_request, $count_approved_request];
				}

			?>

			const array_label_date = [["Date", "Created", "Approved"]];

			<?php
				foreach ($array_label_date as $key => $value) {
			?>
				array_label_date.push(["<?php print_r($value[0])?>", <?php print_r($value[1])?>, <?php print_r($value[2])?>]);
			<?php } ?>

	        var data = google.visualization.arrayToDataTable(array_label_date);

	        var max_vAxis = Math.max(data.getColumnRange(1).max,data.getColumnRange(2).max);
	        if (max_vAxis == 0) {
	        	max_vAxis = 1;
	        }
	        var min_vAxis = Math.min(data.getColumnRange(1).min,data.getColumnRange(2).min);

	       	var options = {
	        	title: 'Monthly Request Chart',
				legend:'bottom',
				lineWidth: 5,
				tooltip: { trigger: 'selection' },
				vAxis: {	
					viewWindow: {
			            min: min_vAxis,
			            max: max_vAxis
			        }
				},
				series: {
					0: {
			            color: '#5368ff',
			            type: 'bars',
			            pointSize: 15
			        },
			        1: {
			            color: '#ff5353',
			            type: 'line',
			            pointSize: 15
			        },
				}
	        };

	        var chart = new google.visualization.ComboChart(document.getElementById('chartContainer3'));

	        chart.draw(data, options);

	        chart.setAction({
				id: 'request_opt',
				text: 'Check Details',
				action: function() {
					selection = chart.getSelection();
					console.log(array_label_date);
					var column_num_select = selection[0].column;
					var row_num_select = selection[0].row + 1;
					var date_select;
					var type_select;

					date_select = array_label_date[row_num_select][0];

					if (column_num_select == 1) {
						type_select = 'created';
					}else if (column_num_select == 2) {
						type_select = 'confirmed';
					}

					window.open("app-request.php?search_date="+(type_select == 'created' ? date_select : '')+"&search_update_date="+(type_select != 'created' ? date_select : '')+(type_select != 'created' ? "&search_status[]="+type_select : '')+"&page_mode=list","_blank");
				}
			});

	        google.visualization.events.addListener(chart, 'select', showHide);
			var cur_item = 0;
			function showHide() {
	    	 	
				var selection = chart.getSelection();
			  	for (var i = 0; i < selection.length; i++) {

				    var item = selection[i];
				    if (item.row == null) {
					    if (cur_item == 0 || cur_item == '') {
						    if (item.column == 1) {
						    	cur_item = item.column;
						    	view = new google.visualization.DataView(data);
						      	view.hideColumns([2]); 
						      	options.series[0].color = '#5368ff';
						      	options.series[0].type = 'bars';
						      	chart.draw(view, options);
						    }else if (item.column == 2) {
						    	cur_item = item.column;
						    	view = new google.visualization.DataView(data);
						      	view.hideColumns([1]); 
						      	options.series[0].color = '#ff5353';
						      	options.series[0].type = 'line';
						      	chart.draw(view, options);
						    }
						}else{
							cur_item = 0;
							view = new google.visualization.DataView(data);
							options.series[0].color = '#5368ff';
							options.series[0].type = 'bars';
							options.series[1].color = '#ff5353';
						    options.series[1].type = 'line';
						    chart.draw(view, options);
						}
					}
			  	}
			}
	    }


	    function drawChartGrievance() {

			<?php 
				unset($array_label_date);

				for ($i = $loop_counter; $i >= 0; $i--) {
					$date = date('Y-m-d', strtotime('-'.$i.' days', strtotime( ($cur_date != '' ? $cur_date : date('Y-m-d') ) )));

					$mysqli_ck_created_grievance = $mysqli->query("SELECT count(grievance_id) AS count_created_grievance FROM grievance where DATE(created_at) = '".$date."' AND deleted_at IS NULL");
					if ($mysqli_ck_created_grievance->num_rows >0) {
						$row_ck_created_grievance = $mysqli_ck_created_grievance->fetch_assoc();
						$count_created_grievance = $row_ck_created_grievance['count_created_grievance'];
					}else{
						$count_created_grievance = 0;
					}	

					$mysqli_ck_approved_grievance = $mysqli->query("SELECT count(grievance_id) AS count_approved_grievance FROM grievance where status = 'confirmed' AND DATE(updated_at) = '".$date."' AND deleted_at IS NULL");
					if ($mysqli_ck_approved_grievance->num_rows >0) {
						$row_ck_approved_grievance = $mysqli_ck_approved_grievance->fetch_assoc();
						$count_approved_grievance = $row_ck_approved_grievance['count_approved_grievance'];
					}else{
						$count_approved_grievance = 0;
					}

					$array_label_date[$i] = [$date, $count_created_grievance, $count_approved_grievance];
				}

			?>

			const array_label_date = [["Date", "Created", "Approved"]];

			<?php
				foreach ($array_label_date as $key => $value) {
			?>
				array_label_date.push(["<?php print_r($value[0])?>", <?php print_r($value[1])?>, <?php print_r($value[2])?>]);
			<?php } ?>

	        var data = google.visualization.arrayToDataTable(array_label_date);

	        var max_vAxis = Math.max(data.getColumnRange(1).max,data.getColumnRange(2).max);
	        if (max_vAxis == 0) {
	        	max_vAxis = 1;
	        }
	        var min_vAxis = Math.min(data.getColumnRange(1).min,data.getColumnRange(2).min);

	       	var options = {
	        	title: 'Monthly Grievance Chart',
				legend:'bottom',
				lineWidth: 5,
				tooltip: { trigger: 'selection' },
				vAxis: {	
					viewWindow: {
			            min: min_vAxis,
			            max: max_vAxis
			        }
				},
				series: {
					0: {
			            color: '#5368ff',
			            type: 'bars',
			            pointSize: 15
			        },
			        1: {
			            color: '#ff5353',
			            type: 'line',
			            pointSize: 15
			        },
				}
	        };

	        var chart = new google.visualization.ComboChart(document.getElementById('chartContainer4'));

	        chart.draw(data, options);

	        chart.setAction({
				id: 'grievance_opt',
				text: 'Check Details',
				action: function() {
					selection = chart.getSelection();
					console.log(array_label_date);
					var column_num_select = selection[0].column;
					var row_num_select = selection[0].row + 1;
					var date_select;
					var type_select;

					date_select = array_label_date[row_num_select][0];

					if (column_num_select == 1) {
						type_select = 'created';
					}else if (column_num_select == 2) {
						type_select = 'confirmed';
					}

					window.open("app-grievance.php?search_date="+(type_select == 'created' ? date_select : '')+"&search_update_date="+(type_select != 'created' ? date_select : '')+"&search_type="+(type_select != 'created' ? type_select : '')+"&page_mode=list","_blank");
				}
			});

	        google.visualization.events.addListener(chart, 'select', showHide);
			var cur_item = 0;
			function showHide() {
	    	 	
				var selection = chart.getSelection();
			  	for (var i = 0; i < selection.length; i++) {

				    var item = selection[i];
				    if (item.row == null) {
					    if (cur_item == 0 || cur_item == '') {
						    if (item.column == 1) {
						    	cur_item = item.column;
						    	view = new google.visualization.DataView(data);
						      	view.hideColumns([2]); 
						      	options.series[0].color = '#5368ff';
						      	options.series[0].type = 'bars';
						      	chart.draw(view, options);
						    }else if (item.column == 2) {
						    	cur_item = item.column;
						    	view = new google.visualization.DataView(data);
						      	view.hideColumns([1]); 
						      	options.series[0].color = '#ff5353';
						      	options.series[0].type = 'line';
						      	chart.draw(view, options);
						    }
						}else{
							cur_item = 0;
							view = new google.visualization.DataView(data);
							options.series[0].color = '#5368ff';
							options.series[0].type = 'bars';
							options.series[1].color = '#ff5353';
						    options.series[1].type = 'line';
						    chart.draw(view, options);
						}
					}
			  	}
			}
	    }


	    function drawChartRedeem() {

			<?php
				unset($array_label_date);

				for ($i = $loop_counter; $i >= 0; $i--) {
					$date = date('Y-m-d', strtotime('-'.$i.' days', strtotime( ($cur_date != '' ? $cur_date : date('Y-m-d') ) )));

					$mysqli_ck_created_redeem = $mysqli->query("SELECT count(view_id) AS count_created_redeem FROM staff_redeem where DATE(created_at) = '".$date."' AND deleted_at IS NULL");
					if ($mysqli_ck_created_redeem->num_rows >0) {
						$row_ck_created_redeem = $mysqli_ck_created_redeem->fetch_assoc();
						$count_created_redeem = $row_ck_created_redeem['count_created_redeem'];
					}else{
						$count_created_redeem = 0;
					}	

					$mysqli_ck_approved_redeem = $mysqli->query("SELECT count(view_id) AS count_approved_redeem FROM staff_redeem where status = 'confirmed' AND DATE(updated_at) = '".$date."' AND deleted_at IS NULL");
					if ($mysqli_ck_approved_redeem->num_rows >0) {
						$row_ck_approved_redeem = $mysqli_ck_approved_redeem->fetch_assoc();
						$count_approved_redeem = $row_ck_approved_redeem['count_approved_redeem'];
					}else{
						$count_approved_redeem = 0;
					}

					$array_label_date[$i] = [$date, $count_created_redeem, $count_approved_redeem];
				}

			?>

			const array_label_date = [["Date", "Created", "Approved"]];

			<?php
				foreach ($array_label_date as $key => $value) {
			?>
				array_label_date.push(["<?php print_r($value[0])?>", <?php print_r($value[1])?>, <?php print_r($value[2])?>]);
			<?php } ?>

	        var data = google.visualization.arrayToDataTable(array_label_date);

	        var max_vAxis = Math.max(data.getColumnRange(1).max,data.getColumnRange(2).max);
	        if (max_vAxis == 0) {
	        	max_vAxis = 1;
	        }
	        var min_vAxis = Math.min(data.getColumnRange(1).min,data.getColumnRange(2).min);

	       	var options = {
	        	title: 'Monthly Redeem Chart',
				legend:'bottom',
				lineWidth: 5,
				tooltip: { trigger: 'selection' },
				vAxis: {	
					viewWindow: {
			            min: min_vAxis,
			            max: max_vAxis
			        }
				},
				series: {
					0: {
			            color: '#5368ff',
			            type: 'bars',
			            pointSize: 15
			        },
			        1: {
			            color: '#ff5353',
			            type: 'line',
			            pointSize: 15
			        },
				}
	        };

	        var chart = new google.visualization.ComboChart(document.getElementById('chartContainer5'));

	        chart.draw(data, options);

	        chart.setAction({
				id: 'redeem_opt',
				text: 'Check Details',
				action: function() {
					selection = chart.getSelection();
					console.log(array_label_date);
					var column_num_select = selection[0].column;
					var row_num_select = selection[0].row + 1;
					var date_select;
					var type_select;

					date_select = array_label_date[row_num_select][0];

					if (column_num_select == 1) {
						type_select = 'created';
					}else if (column_num_select == 2) {
						type_select = 'confirmed';
					}

					window.open("app-redeem.php?search_date="+(type_select == 'created' ? date_select : '')+"&search_update_date="+(type_select != 'created' ? date_select : '')+(type_select != 'created' ? '&search_type[]='+type_select : '')+"&page_mode=all","_blank");
				}
			});

	        google.visualization.events.addListener(chart, 'select', showHide);
			var cur_item = 0;
			function showHide() {
	    	 	
				var selection = chart.getSelection();
			  	for (var i = 0; i < selection.length; i++) {

				    var item = selection[i];
				    if (item.row == null) {
					    if (cur_item == 0 || cur_item == '') {
						    if (item.column == 1) {
						    	cur_item = item.column;
						    	view = new google.visualization.DataView(data);
						      	view.hideColumns([2]); 
						      	options.series[0].color = '#5368ff';
						      	options.series[0].type = 'bars';
						      	chart.draw(view, options);
						    }else if (item.column == 2) {
						    	cur_item = item.column;
						    	view = new google.visualization.DataView(data);
						      	view.hideColumns([1]); 
						      	options.series[0].color = '#ff5353';
						      	options.series[0].type = 'line';
						      	chart.draw(view, options);
						    }
						}else{
							cur_item = 0;
							view = new google.visualization.DataView(data);
							options.series[0].color = '#5368ff';
							options.series[0].type = 'bars';
							options.series[1].color = '#ff5353';
						    options.series[1].type = 'line';
						    chart.draw(view, options);
						}
					}
			  	}
			}
	    }


	    function drawChartAssociation() {

			<?php
				unset($array_label_date);

				for ($i = $loop_counter; $i >= 0; $i--) {
					$date = date('Y-m-d', strtotime('-'.$i.' days', strtotime( ($cur_date != '' ? $cur_date : date('Y-m-d') ) )));

					$mysqli_ck_created_association = $mysqli->query("SELECT count(view_id) AS count_created_association FROM staff_association where DATE(created_at) = '".$date."' AND deleted_at IS NULL");
					if ($mysqli_ck_created_association->num_rows >0) {
						$row_ck_created_association = $mysqli_ck_created_association->fetch_assoc();
						$count_created_association = $row_ck_created_association['count_created_association'];
					}else{
						$count_created_association = 0;
					}	

					$mysqli_ck_approved_association = $mysqli->query("SELECT count(view_id) AS count_approved_association FROM staff_association where status IN ('confirmed', 'rated') AND DATE(updated_at) = '".$date."' AND deleted_at IS NULL");
					if ($mysqli_ck_approved_association->num_rows >0) {
						$row_ck_approved_association = $mysqli_ck_approved_association->fetch_assoc();
						$count_approved_association = $row_ck_approved_association['count_approved_association'];
					}else{
						$count_approved_association = 0;
					}

					$array_label_date[$i] = [$date, $count_created_association, $count_approved_association];
				}

			?>

			const array_label_date = [["Date", "Created", "Approved"]];

			<?php
				foreach ($array_label_date as $key => $value) {
			?>
				array_label_date.push(["<?php print_r($value[0])?>", <?php print_r($value[1])?>, <?php print_r($value[2])?>]);
			<?php } ?>

	        var data = google.visualization.arrayToDataTable(array_label_date);

	        var max_vAxis = Math.max(data.getColumnRange(1).max,data.getColumnRange(2).max);
	        if (max_vAxis == 0) {
	        	max_vAxis = 1;
	        }
	        var min_vAxis = Math.min(data.getColumnRange(1).min,data.getColumnRange(2).min);

	       	var options = {
	        	title: 'Monthly Association Chart',
				legend:'bottom',
				lineWidth: 5,
				tooltip: { trigger: 'selection' },
				vAxis: {	
					viewWindow: {
			            min: min_vAxis,
			            max: max_vAxis
			        }
				},
				series: {
					0: {
			            color: '#5368ff',
			            type: 'bars',
			            pointSize: 15
			        },
			        1: {
			            color: '#ff5353',
			            type: 'line',
			            pointSize: 15
			        },
				}
	        };

	        var chart = new google.visualization.ComboChart(document.getElementById('chartContainer6'));

	        chart.draw(data, options);

	        chart.setAction({
				id: 'association_opt',
				text: 'Check Details',
				action: function() {
					selection = chart.getSelection();
					console.log(array_label_date);
					var column_num_select = selection[0].column;
					var row_num_select = selection[0].row + 1;
					var date_select;
					var type_select;

					date_select = array_label_date[row_num_select][0];

					if (column_num_select == 1) {
						type_select = 'created';
					}else if (column_num_select == 2) {
						type_select = 'confirmed';
					}

					window.open("app-association.php?search_date="+(type_select == 'created' ? date_select : '')+"&search_update_date="+(type_select != 'created' ? date_select : '')+(type_select == 'confirmed' ? '&search_type[]=confirmed&search_type[]=rated' : '')+"&page_mode=view_all","_blank");
				}
			});

	        google.visualization.events.addListener(chart, 'select', showHide);
			var cur_item = 0;
			function showHide() {
	    	 	
				var selection = chart.getSelection();
			  	for (var i = 0; i < selection.length; i++) {

				    var item = selection[i];
				    if (item.row == null) {
					    if (cur_item == 0 || cur_item == '') {
						    if (item.column == 1) {
						    	cur_item = item.column;
						    	view = new google.visualization.DataView(data);
						      	view.hideColumns([2]); 
						      	options.series[0].color = '#5368ff';
						      	options.series[0].type = 'bars';
						      	chart.draw(view, options);
						    }else if (item.column == 2) {
						    	cur_item = item.column;
						    	view = new google.visualization.DataView(data);
						      	view.hideColumns([1]); 
						      	options.series[0].color = '#ff5353';
						      	options.series[0].type = 'line';
						      	chart.draw(view, options);
						    }
						}else{
							cur_item = 0;
							view = new google.visualization.DataView(data);
							options.series[0].color = '#5368ff';
							options.series[0].type = 'bars';
							options.series[1].color = '#ff5353';
						    options.series[1].type = 'line';
						    chart.draw(view, options);
						}
					}
			  	}
			}
	    }


	    function drawChartTraining() {

			<?php
				unset($array_label_date);

				for ($i = $loop_counter; $i >= 0; $i--) {
					$date = date('Y-m-d', strtotime('-'.$i.' days', strtotime( ($cur_date != '' ? $cur_date : date('Y-m-d') ) )));

					$mysqli_ck_created_training = $mysqli->query("SELECT count(view_id) AS count_created_training FROM staff_training where DATE(created_at) = '".$date."' AND deleted_at IS NULL");
					if ($mysqli_ck_created_training->num_rows >0) {
						$row_ck_created_training = $mysqli_ck_created_training->fetch_assoc();
						$count_created_training = $row_ck_created_training['count_created_training'];
					}else{
						$count_created_training = 0;
					}	

					$mysqli_ck_approved_training = $mysqli->query("SELECT count(view_id) AS count_approved_training FROM staff_training where status IN ('confirmed', 'rated') AND DATE(updated_at) = '".$date."' AND deleted_at IS NULL");
					if ($mysqli_ck_approved_training->num_rows >0) {
						$row_ck_approved_training = $mysqli_ck_approved_training->fetch_assoc();
						$count_approved_training = $row_ck_approved_training['count_approved_training'];
					}else{
						$count_approved_training = 0;
					}

					$array_label_date[$i] = [$date, $count_created_training, $count_approved_training];
				}

			?>

			const array_label_date = [["Date", "Created", "Approved"]];

			<?php
				foreach ($array_label_date as $key => $value) {
			?>
				array_label_date.push(["<?php print_r($value[0])?>", <?php print_r($value[1])?>, <?php print_r($value[2])?>]);
			<?php } ?>

	        var data = google.visualization.arrayToDataTable(array_label_date);

	        var max_vAxis = Math.max(data.getColumnRange(1).max,data.getColumnRange(2).max);
	        if (max_vAxis == 0) {
	        	max_vAxis = 1;
	        }
	        var min_vAxis = Math.min(data.getColumnRange(1).min,data.getColumnRange(2).min);

	       	var options = {
	        	title: 'Monthly Training Chart',
				legend:'bottom',
				lineWidth: 5,
				tooltip: { trigger: 'selection' },
				vAxis: {	
					viewWindow: {
			            min: min_vAxis,
			            max: max_vAxis
			        }
				},
				series: {
					0: {
			            color: '#5368ff',
			            type: 'bars',
			            pointSize: 15
			        },
			        1: {
			            color: '#ff5353',
			            type: 'line',
			            pointSize: 15
			        },
				}
	        };
	        var chart = new google.visualization.ComboChart(document.getElementById('chartContainer7'));

	        chart.draw(data, options);

	       	chart.setAction({
				id: 'training_opt',
				text: 'Check Details',
				action: function() {
					selection = chart.getSelection();
					console.log(array_label_date);
					var column_num_select = selection[0].column;
					var row_num_select = selection[0].row + 1;
					var date_select;
					var type_select;

					date_select = array_label_date[row_num_select][0];

					if (column_num_select == 1) {
						type_select = 'created';
					}else if (column_num_select == 2) {
						type_select = 'confirmed';
					}

					window.open("app-training.php?search_date="+(type_select == 'created' ? date_select : '')+"&search_update_date="+(type_select != 'created' ? date_select : '')+(type_select == 'confirmed' ? '&search_type[]=confirmed&search_type[]=rated' : '')+"&page_mode=view_all","_blank");
				}
			});

	        google.visualization.events.addListener(chart, 'select', showHide);
			var cur_item = 0;
			function showHide() {
	    	 	
				var selection = chart.getSelection();
			  	for (var i = 0; i < selection.length; i++) {

				    var item = selection[i];
				    if (item.row == null) {
					    if (cur_item == 0 || cur_item == '') {
						    if (item.column == 1) {
						    	cur_item = item.column;
						    	view = new google.visualization.DataView(data);
						      	view.hideColumns([2]); 
						      	options.series[0].color = '#5368ff';
						      	options.series[0].type = 'bars';
						      	chart.draw(view, options);
						    }else if (item.column == 2) {
						    	cur_item = item.column;
						    	view = new google.visualization.DataView(data);
						      	view.hideColumns([1]); 
						      	options.series[0].color = '#ff5353';
						      	options.series[0].type = 'line';
						      	chart.draw(view, options);
						    }
						}else{
							cur_item = 0;
							view = new google.visualization.DataView(data);
							options.series[0].color = '#5368ff';
							options.series[0].type = 'bars';
							options.series[1].color = '#ff5353';
						    options.series[1].type = 'line';
						    chart.draw(view, options);
						}
					}
			  	}
			}
	    }


	    function drawChartHeadcount() {

			<?php
				unset($array_label_date);

				for ($i = $loop_counter; $i >= 0; $i--) {
					$date = date('Y-m-d', strtotime('-'.$i.' days', strtotime( ($cur_date != '' ? $cur_date : date('Y-m-d') ) )));

					$mysqli_ck_created_head = $mysqli->query("SELECT count(formheadcount_id) AS count_created_head FROM formheadcount where DATE(created_at) = '".$date."' AND deleted_at IS NULL");
					if ($mysqli_ck_created_head->num_rows >0) {
						$row_ck_created_head = $mysqli_ck_created_head->fetch_assoc();
						$count_created_head = $row_ck_created_head['count_created_head'];
					}else{
						$count_created_head = 0;
					}	

					$mysqli_ck_approved_head = $mysqli->query("SELECT count(formheadcount_id) AS count_approved_head FROM formheadcount where status = 'confirmed' AND DATE(updated_at) = '".$date."' AND deleted_at IS NULL");
					if ($mysqli_ck_approved_head->num_rows >0) {
						$row_ck_approved_head = $mysqli_ck_approved_head->fetch_assoc();
						$count_approved_head = $row_ck_approved_head['count_approved_head'];
					}else{
						$count_approved_head = 0;
					}

					$array_label_date[$i] = [$date, $count_created_head, $count_approved_head];
				}

			?>

			const array_label_date = [["Date", "Created", "Approved"]];

			<?php
				foreach ($array_label_date as $key => $value) {
			?>
				array_label_date.push(["<?php print_r($value[0])?>", <?php print_r($value[1])?>, <?php print_r($value[2])?>]);
			<?php } ?>

	        var data = google.visualization.arrayToDataTable(array_label_date);

	        var max_vAxis = Math.max(data.getColumnRange(1).max,data.getColumnRange(2).max);
	        if (max_vAxis == 0) {
	        	max_vAxis = 1;
	        }
	        var min_vAxis = Math.min(data.getColumnRange(1).min,data.getColumnRange(2).min);

	       var options = {
	        	title: 'Monthly Headcount Chart',
				legend:'bottom',
				lineWidth: 5,
				tooltip: { trigger: 'selection' },
				vAxis: {	
					viewWindow: {
			            min: min_vAxis,
			            max: max_vAxis
			        }
				},
				series: {
					0: {
			            color: '#5368ff',
			            type: 'bars',
			            pointSize: 15
			        },
			        1: {
			            color: '#ff5353',
			            type: 'line',
			            pointSize: 15
			        },
				}
	        };
	        var chart = new google.visualization.ComboChart(document.getElementById('chartContainer8'));

	        chart.draw(data, options);

	        chart.setAction({
				id: 'headcount_opt',
				text: 'Check Details',
				action: function() {
					selection = chart.getSelection();
					console.log(array_label_date);
					var column_num_select = selection[0].column;
					var row_num_select = selection[0].row + 1;
					var date_select;
					var type_select;

					date_select = array_label_date[row_num_select][0];

					if (column_num_select == 1) {
						type_select = 'created';
					}else if (column_num_select == 2) {
						type_select = 'confirmed';
					}

					window.open("app-form-headcount.php?search_date="+(type_select == 'created' ? date_select : '')+"&search_update_date="+(type_select != 'created' ? date_select : '')+"&search_type="+(type_select != 'created' ? type_select : '')+"&page_mode=list","_blank");
				}
			});

			google.visualization.events.addListener(chart, 'select', showHide);
			var cur_item = 0;

			function showHide() {
	    	 	
				var selection = chart.getSelection();
			  	for (var i = 0; i < selection.length; i++) {

				    var item = selection[i];
				    if (item.row == null) {
					    if (cur_item == 0 || cur_item == '') {
						    if (item.column == 1) {
						    	cur_item = item.column;
						    	view = new google.visualization.DataView(data);
						      	view.hideColumns([2]); 
						      	options.series[0].color = '#5368ff';
						      	options.series[0].type = 'bars';
						      	chart.draw(view, options);
						    }else if (item.column == 2) {
						    	cur_item = item.column;
						    	view = new google.visualization.DataView(data);
						      	view.hideColumns([1]); 
						      	options.series[0].color = '#ff5353';
						      	options.series[0].type = 'line';
						      	chart.draw(view, options);
						    }
						}else{
							cur_item = 0;
							view = new google.visualization.DataView(data);
							options.series[0].color = '#5368ff';
							options.series[0].type = 'bars';
							options.series[1].color = '#ff5353';
						    options.series[1].type = 'line';
						    chart.draw(view, options);
						}
					}
			  	}
			}
	    }


	    function drawChartNomination() {

			<?php
				unset($array_label_date);

				for ($i = $loop_counter; $i >= 0; $i--) {
					$date = date('Y-m-d', strtotime('-'.$i.' days', strtotime( ($cur_date != '' ? $cur_date : date('Y-m-d') ) )));

					$mysqli_ck_created_nomination = $mysqli->query("SELECT count(formnomination_id) AS count_created_nomination FROM formnomination where DATE(created_at) = '".$date."' AND deleted_at IS NULL");
					if ($mysqli_ck_created_nomination->num_rows >0) {
						$row_ck_created_nomination = $mysqli_ck_created_nomination->fetch_assoc();
						$count_created_nomination = $row_ck_created_nomination['count_created_nomination'];
					}else{
						$count_created_nomination = 0;
					}	

					$mysqli_ck_approved_nomination = $mysqli->query("SELECT count(formnomination_id) AS count_approved_nomination FROM formnomination where status = 'confirmed' AND DATE(updated_at) = '".$date."' AND deleted_at IS NULL");
					if ($mysqli_ck_approved_nomination->num_rows >0) {
						$row_ck_approved_nomination = $mysqli_ck_approved_nomination->fetch_assoc();
						$count_approved_nomination = $row_ck_approved_nomination['count_approved_nomination'];
					}else{
						$count_approved_nomination = 0;
					}

					$array_label_date[$i] = [$date, $count_created_nomination, $count_approved_nomination];
				}

			?>

			const array_label_date = [["Date", "Created", "Approved"]];

			<?php
				foreach ($array_label_date as $key => $value) {
			?>
				array_label_date.push(["<?php print_r($value[0])?>", <?php print_r($value[1])?>, <?php print_r($value[2])?>]);
			<?php } ?>

	        var data = google.visualization.arrayToDataTable(array_label_date);

	        var max_vAxis = Math.max(data.getColumnRange(1).max,data.getColumnRange(2).max);
	        if (max_vAxis == 0) {
	        	max_vAxis = 1;
	        }
	        var min_vAxis = Math.min(data.getColumnRange(1).min,data.getColumnRange(2).min);

	       var options = {
	        	title: 'Monthly Nomination Chart',
				legend:'bottom',
				lineWidth: 5,
				tooltip: { trigger: 'selection' },
				vAxis: {	
					viewWindow: {
			            min: min_vAxis,
			            max: max_vAxis
			        }
				},
				series: {
					0: {
			            color: '#5368ff',
			            type: 'bars',
			            pointSize: 15
			        },
			        1: {
			            color: '#ff5353',
			            type: 'line',
			            pointSize: 15
			        },
				}
	        };
	        var chart = new google.visualization.ComboChart(document.getElementById('chartContainer9'));

	        chart.draw(data, options);

	        chart.setAction({
				id: 'nomination_opt',
				text: 'Check Details',
				action: function() {
					selection = chart.getSelection();
					console.log(array_label_date);
					var column_num_select = selection[0].column;
					var row_num_select = selection[0].row + 1;
					var date_select;
					var type_select;

					date_select = array_label_date[row_num_select][0];

					if (column_num_select == 1) {
						type_select = 'created';
					}else if (column_num_select == 2) {
						type_select = 'confirmed';
					}

					window.open("app-form-nomination.php?search_date="+(type_select == 'created' ? date_select : '')+"&search_update_date="+(type_select != 'created' ? date_select : '')+"&search_type="+(type_select != 'created' ? type_select : '')+"&page_mode=list","_blank");
				}
			});

			google.visualization.events.addListener(chart, 'select', showHide);
			var cur_item = 0;

			function showHide() {
	    	 	
				var selection = chart.getSelection();
			  	for (var i = 0; i < selection.length; i++) {

				    var item = selection[i];
				    if (item.row == null) {
					    if (cur_item == 0 || cur_item == '') {
						    if (item.column == 1) {
						    	cur_item = item.column;
						    	view = new google.visualization.DataView(data);
						      	view.hideColumns([2]); 
						      	options.series[0].color = '#5368ff';
						      	options.series[0].type = 'bars';
						      	chart.draw(view, options);
						    }else if (item.column == 2) {
						    	cur_item = item.column;
						    	view = new google.visualization.DataView(data);
						      	view.hideColumns([1]); 
						      	options.series[0].color = '#ff5353';
						      	options.series[0].type = 'line';
						      	chart.draw(view, options);
						    }
						}else{
							cur_item = 0;
							view = new google.visualization.DataView(data);
							options.series[0].color = '#5368ff';
							options.series[0].type = 'bars';
							options.series[1].color = '#ff5353';
						    options.series[1].type = 'line';
						    chart.draw(view, options);
						}
					}
			  	}
			}
	    }


	    function drawChartResignation() {

			<?php
				unset($array_label_date);

				for ($i = $loop_counter; $i >= 0; $i--) {
					$date = date('Y-m-d', strtotime('-'.$i.' days', strtotime( ($cur_date != '' ? $cur_date : date('Y-m-d') ) )));

					$mysqli_ck_created_resignation = $mysqli->query("SELECT count(formresignation_id) AS count_created_resignation FROM formresignation where DATE(created_at) = '".$date."' AND deleted_at IS NULL");
					if ($mysqli_ck_created_resignation->num_rows >0) {
						$row_ck_created_resignation = $mysqli_ck_created_resignation->fetch_assoc();
						$count_created_resignation = $row_ck_created_resignation['count_created_resignation'];
					}else{
						$count_created_resignation = 0;
					}	

					$mysqli_ck_approved_resignation = $mysqli->query("SELECT count(formresignation_id) AS count_approved_resignation FROM formresignation where status = 'confirmed' AND DATE(updated_at) = '".$date."' AND deleted_at IS NULL");
					if ($mysqli_ck_approved_resignation->num_rows >0) {
						$row_ck_approved_resignation = $mysqli_ck_approved_resignation->fetch_assoc();
						$count_approved_resignation = $row_ck_approved_resignation['count_approved_resignation'];
					}else{
						$count_approved_resignation = 0;
					}

					$array_label_date[$i] = [$date, $count_created_resignation, $count_approved_resignation];
				}

			?>

			const array_label_date = [["Date", "Created", "Approved"]];

			<?php
				foreach ($array_label_date as $key => $value) {
			?>
				array_label_date.push(["<?php print_r($value[0])?>", <?php print_r($value[1])?>, <?php print_r($value[2])?>]);
			<?php } ?>

	        var data = google.visualization.arrayToDataTable(array_label_date);

	        var max_vAxis = Math.max(data.getColumnRange(1).max,data.getColumnRange(2).max);
	        if (max_vAxis == 0) {
	        	max_vAxis = 1;
	        }
	        var min_vAxis = Math.min(data.getColumnRange(1).min,data.getColumnRange(2).min);

	       var options = {
	        	title: 'Monthly Resignation Chart',
				legend:'bottom',
				lineWidth: 5,
				tooltip: { trigger: 'selection' },
				vAxis: {	
					viewWindow: {
			            min: min_vAxis,
			            max: max_vAxis
			        }
				},
				series: {
					0: {
			            color: '#5368ff',
			            type: 'bars',
			            pointSize: 15
			        },
			        1: {
			            color: '#ff5353',
			            type: 'line',
			            pointSize: 15
			        },
				}
	        };
	        var chart = new google.visualization.ComboChart(document.getElementById('chartContainer10'));

	        chart.draw(data, options);

	        chart.setAction({
				id: 'resignation_opt',
				text: 'Check Details',
				action: function() {
					selection = chart.getSelection();
					console.log(array_label_date);
					var column_num_select = selection[0].column;
					var row_num_select = selection[0].row + 1;
					var date_select;
					var type_select;

					date_select = array_label_date[row_num_select][0];

					if (column_num_select == 1) {
						type_select = 'created';
					}else if (column_num_select == 2) {
						type_select = 'confirmed';
					}

					window.open("app-form-resignation.php?search_date="+(type_select == 'created' ? date_select : '')+"&search_update_date="+(type_select != 'created' ? date_select : '')+"&search_type="+(type_select != 'created' ? type_select : '')+"&page_mode=list","_blank");
				}
			});

			google.visualization.events.addListener(chart, 'select', showHide);
			var cur_item = 0;

			function showHide() {
	    	 	
				var selection = chart.getSelection();
			  	for (var i = 0; i < selection.length; i++) {

				    var item = selection[i];
				    if (item.row == null) {
					    if (cur_item == 0 || cur_item == '') {
						    if (item.column == 1) {
						    	cur_item = item.column;
						    	view = new google.visualization.DataView(data);
						      	view.hideColumns([2]); 
						      	options.series[0].color = '#5368ff';
						      	options.series[0].type = 'bars';
						      	chart.draw(view, options);
						    }else if (item.column == 2) {
						    	cur_item = item.column;
						    	view = new google.visualization.DataView(data);
						      	view.hideColumns([1]); 
						      	options.series[0].color = '#ff5353';
						      	options.series[0].type = 'line';
						      	chart.draw(view, options);
						    }
						}else{
							cur_item = 0;
							view = new google.visualization.DataView(data);
							options.series[0].color = '#5368ff';
							options.series[0].type = 'bars';
							options.series[1].color = '#ff5353';
						    options.series[1].type = 'line';
						    chart.draw(view, options);
						}
					}
			  	}
			}
	    }

    </script>


	<!-- preloader -->
	<div class="loading-container"><div class="loading"><div class="l1"><div></div></div><div class="l2"><div></div></div><div class="l3"><div></div></div><div class="l4"><div></div></div></div></div>
	<!-- end preloader -->
	<body style="overflow-y: hidden;">
		<div class="panel panel-default" id="basic-table-title">
	        <div class="panel-heading" style="text-align:right"></div>
			<div class="panel-body" >
	            <form method="get" class="form-horizontal" style="max-width:600px;">
	                <div class="form-group">
	                    <label class="col-sm-1 control-label"><?= $lang['date'] ?></label>
	                    <div class="col-sm-9">
	                        <input type="date" name="search_date" value="<?= $search_date ?>" class="form-control" />
	                    </div>
	                </div>
	                <div class="form-group">
	                    <div class="col-sm-10">
	                        <button type="submit" id="chart-form-btn" class="btn btn-purple" style="float:right"><?= $lang['submit'] ?></button>
	                    </div>
	                </div>
	            </form>
	        </div>
	    </div>
	        <div class="panel-heading" style="text-align:right"></div>
	        <div class="panel-body" style="display: flex; flex-wrap: wrap; padding: 0px;">
				<table cellpadding="0" cellspacing="0" border="0" class="responsive table table-striped table-bordered" style="width:100%;height:100%;">
					<thead>
						<tr>
							<th>TASK</th>
						</tr>
					</thead>
					<tbody>
						<tr class="odd gradeX">
							<td class="border_none">
								<div id="chartContainer1" style="min-height: 300px; width: 100%;"></div>
							</td>
						</tr>
					</tbody>
				</table>
				<table cellpadding="0" cellspacing="0" border="0" class="responsive table table-striped table-bordered" style="width:100%;height:100%;">
					<thead>
						<tr>
							<th>SUGGESTION</th>
						</tr>
					</thead>
					<tbody>
						<tr class="odd gradeX">
							<td class="border_none">
								<div id="chartContainer2" style="min-height: 300px; width: 100%;"></div>
							</td>
						</tr>
					</tbody>
				</table>
				<table cellpadding="0" cellspacing="0" border="0" class="responsive table table-striped table-bordered" style="width:100%;height:100%;">
					<thead>
						<tr>
							<th>REQUEST</th>
						</tr>
					</thead>
					<tbody>
						<tr class="odd gradeX">
							<td class="border_none">
								<div id="chartContainer3" style="min-height: 300px; width: 100%;"></div>
							</td>
						</tr>
					</tbody>
				</table>
				<table cellpadding="0" cellspacing="0" border="0" class="responsive table table-striped table-bordered" style="width:100%;height:100%;">
					<thead>
						<tr>
							<th>GRIEVANCE</th>
						</tr>
					</thead>
					<tbody>
						<tr class="odd gradeX">
							<td class="border_none">
								<div id="chartContainer4" style="min-height: 300px; width: 100%;"></div>
							</td>
						</tr>
					</tbody>
				</table>
				<table cellpadding="0" cellspacing="0" border="0" class="responsive table table-striped table-bordered" style="width:100%;height:100%;">
					<thead>
						<tr>
							<th>REDEEM</th>
						</tr>
					</thead>
					<tbody>
						<tr class="odd gradeX">
							<td class="border_none">
								<div id="chartContainer5" style="min-height: 300px; width: 100%;"></div>
							</td>
						</tr>
					</tbody>
				</table>
				<table cellpadding="0" cellspacing="0" border="0" class="responsive table table-striped table-bordered" style="width:100%;height:100%;">
					<thead>
						<tr>
							<th>ASSOCIATION</th>
						</tr>
					</thead>
					<tbody>
						<tr class="odd gradeX">
							<td class="border_none">
								<div id="chartContainer6" style="min-height: 300px; width: 100%;"></div>
							</td>
						</tr>
					</tbody>
				</table>
				<table cellpadding="0" cellspacing="0" border="0" class="responsive table table-striped table-bordered" style="width:100%;height:100%;">
					<thead>
						<tr>
							<th>TRAINING</th>
						</tr>
					</thead>
					<tbody>
						<tr class="odd gradeX">
							<td class="border_none">
								<div id="chartContainer7" style="min-height: 300px; width: 100%;"></div>
							</td>
						</tr>
					</tbody>
				</table>
				<table cellpadding="0" cellspacing="0" border="0" class="responsive table table-striped table-bordered" style="width:100%;height:100%;">
					<thead>
						<tr>
							<th>HEADCOUNT</th>
						</tr>
					</thead>
					<tbody>
						<tr class="odd gradeX">
							<td class="border_none">
								<div id="chartContainer8" style="min-height: 300px; width: 100%;"></div>
							</td>
						</tr>
					</tbody>
				</table>
				<table cellpadding="0" cellspacing="0" border="0" class="responsive table table-striped table-bordered" style="width:100%;height:100%;">
					<thead>
						<tr>
							<th>NOMINATION</th>
						</tr>
					</thead>
					<tbody>
						<tr class="odd gradeX">
							<td class="border_none">
								<div id="chartContainer9" style="min-height: 300px; width: 100%;"></div>
							</td>
						</tr>
					</tbody>
				</table>
				<table cellpadding="0" cellspacing="0" border="0" class="responsive table table-striped table-bordered" style="width:100%;height:100%;">
					<thead>
						<tr>
							<th>RESIGNATION</th>
						</tr>
					</thead>
					<tbody>
						<tr class="odd gradeX">
							<td class="border_none">
								<div id="chartContainer10" style="min-height: 300px; width: 100%;"></div>
							</td>
						</tr>
					</tbody>
				</table>
	        </div>
    </body>

	<script>
		var search_chart_iframe = '<?php echo $search_date; ?>';
	</script>
