<?php
// Data Parameters
			
$Question_Labels = array(
				"2"=>$language_array['qes_q99_1'],
				"5"=>$language_array['qes_q99_2'],
				"6"=>$language_array['qes_q99_3'],
				"7"=>$language_array['qes_q99_4'],
				//"8"=>$language_array['qes_q99_15'],
				"9"=>$language_array['qes_q99_5'],
				"10"=>$language_array['qes_q99_6'],
				"11"=>$language_array['qes_q99_7'],
				"12"=>$language_array['qes_q99_8'],
				"13"=>$language_array['qes_q99_16'],
				"14"=>$language_array['qes_q99_9'],
				"17"=>$language_array['qes_q99_10'],
				//"18"=>$language_array['qes_q99_11'],
				"22"=>$language_array['qes_q99_12'],
				"23"=>$language_array['qes_q99_13'],
				"24"=>$language_array['qes_q99_14'],
				"99"=>$language_array['qes_gen_2']
);

$Q99_DATA = array( 
				array($language_array['qes_q99_1'],
				$Q2_S_Avg,$Q2_IDX_OV[0],$Q2_C_Avg,$Q2_IDX_OV[1],$Q2_A_Avg,$Q2_IDX_OV[2],$Q2_N_Avg,$Q2_IDX_OV[3],$Q2_P_Avg,$Q2_IDX_OV[4],
				$Q2_S_Avg2,$Q2_C_Avg2,$Q2_A_Avg2,$Q2_N_Avg2,$Q2_P_Avg2),
				array($language_array['qes_q99_2'],
				$Q5_S_Avg,$Q5_IDX_OV[0],$Q5_C_Avg,$Q5_IDX_OV[1],$Q5_A_Avg,$Q5_IDX_OV[2],$Q5_N_Avg,$Q5_IDX_OV[3],$Q5_P_Avg,$Q5_IDX_OV[4],
				$Q5_S_Avg2,$Q5_C_Avg2,$Q5_A_Avg2,$Q5_N_Avg2,$Q5_P_Avg2),
				array($language_array['qes_q99_3'],
				$Q6_S_Avg,$Q6_IDX_OV[0],$Q6_C_Avg,$Q6_IDX_OV[1],$Q6_A_Avg,$Q6_IDX_OV[2],$Q6_N_Avg,$Q6_IDX_OV[3],$Q6_P_Avg,$Q6_IDX_OV[4],
				$Q6_S_Avg2,$Q6_C_Avg2,$Q6_A_Avg2,$Q6_N_Avg2,$Q6_P_Avg2),
				array($language_array['qes_q99_4'],
				$Q7_S_Avg,$Q7_IDX_OV[0],$Q7_C_Avg,$Q7_IDX_OV[1],$Q7_A_Avg,$Q7_IDX_OV[2],$Q7_N_Avg,$Q7_IDX_OV[3],$Q7_P_Avg,$Q7_IDX_OV[4],
				$Q7_S_Avg2,$Q7_C_Avg2,$Q7_A_Avg2,$Q7_N_Avg2,$Q7_P_Avg2),
				array($language_array['qes_q99_5'],
				$Q9_S_Avg,$Q9_IDX_OV[0],$Q9_C_Avg,$Q9_IDX_OV[1],$Q9_A_Avg,$Q9_IDX_OV[2],$Q9_N_Avg,$Q9_IDX_OV[3],$Q9_P_Avg,$Q9_IDX_OV[4],
				$Q9_S_Avg2,$Q9_C_Avg2,$Q9_A_Avg2,$Q9_N_Avg2,$Q9_P_Avg2),
				array($language_array['qes_q99_6'],
				$Q10_S_Avg,$Q10_IDX_OV[0],$Q10_C_Avg,$Q10_IDX_OV[1],$Q10_A_Avg,$Q10_IDX_OV[2],$Q10_N_Avg,$Q10_IDX_OV[3],$Q10_P_Avg,$Q10_IDX_OV[4],
				$Q10_S_Avg2,$Q10_C_Avg2,$Q10_A_Avg2,$Q10_N_Avg2,$Q10_P_Avg2),
				array($language_array['qes_q99_7'],
				$Q11_S_Avg,$Q11_IDX_OV[0],$Q11_C_Avg,$Q11_IDX_OV[1],$Q11_A_Avg,$Q11_IDX_OV[2],$Q11_N_Avg,$Q11_IDX_OV[3],$Q11_P_Avg,$Q11_IDX_OV[4],
				$Q11_S_Avg2,$Q11_C_Avg2,$Q11_A_Avg2,$Q11_N_Avg2,$Q11_P_Avg2),
				array($language_array['qes_q99_8'],
				$Q12_S_Avg,$Q12_IDX_OV[0],$Q12_C_Avg,$Q12_IDX_OV[1],$Q12_A_Avg,$Q12_IDX_OV[2],$Q12_N_Avg,$Q12_IDX_OV[3],$Q12_P_Avg,$Q12_IDX_OV[4],
				$Q12_S_Avg2,$Q12_C_Avg2,$Q12_A_Avg2,$Q12_N_Avg2,$Q12_P_Avg2),
				array($language_array['qes_q99_16'],
				$Q13_S_Avg,$Q13_IDX_OV[0],$Q13_C_Avg,$Q13_IDX_OV[1],$Q13_A_Avg,$Q13_IDX_OV[2],$Q13_N_Avg,$Q13_IDX_OV[3],$Q13_P_Avg,$Q13_IDX_OV[4],
				$Q13_S_Avg2,$Q13_C_Avg2,$Q13_A_Avg2,$Q13_N_Avg2,$Q13_P_Avg2),				
				array($language_array['qes_q99_9'],
				$Q14_S_Avg,$Q14_IDX_OV[0],$Q14_C_Avg,$Q14_IDX_OV[1],$Q14_A_Avg,$Q14_IDX_OV[2],$Q14_N_Avg,$Q14_IDX_OV[3],$Q14_P_Avg,$Q14_IDX_OV[4],
				$Q14_S_Avg2,$Q14_C_Avg2,$Q14_A_Avg2,$Q14_N_Avg2,$Q14_P_Avg2),
				array($language_array['qes_q99_10'],
				$Q17_S_Avg,$Q17_IDX_OV[0],$Q17_C_Avg,$Q17_IDX_OV[1],$Q17_A_Avg,$Q17_IDX_OV[2],$Q17_N_Avg,$Q17_IDX_OV[3],$Q17_P_Avg,$Q17_IDX_OV[4],
				$Q17_S_Avg2,$Q17_C_Avg2,$Q17_A_Avg2,$Q17_N_Avg2,$Q17_P_Avg2),
				array($language_array['qes_q99_12'],
				$Q22_S_Avg,$Q22_IDX_OV[0],$Q22_C_Avg,$Q22_IDX_OV[1],$Q22_A_Avg,$Q22_IDX_OV[2],$Q22_N_Avg,$Q22_IDX_OV[3],$Q22_P_Avg,$Q22_IDX_OV[4],
				$Q22_S_Avg2,$Q22_C_Avg2,$Q22_A_Avg2,$Q22_N_Avg2,$Q22_P_Avg2),
				array($language_array['qes_q99_13'],
				$Q23_S_Avg,$Q23_IDX_OV[0],$Q23_C_Avg,$Q23_IDX_OV[1],$Q23_A_Avg,$Q23_IDX_OV[2],$Q23_N_Avg,$Q23_IDX_OV[3],$Q23_P_Avg,$Q23_IDX_OV[4],
				$Q23_S_Avg2,$Q23_C_Avg2,$Q23_A_Avg2,$Q23_N_Avg2,$Q23_P_Avg2),
				array($language_array['qes_q99_14'],
				$Q24_S_Avg,$Q24_IDX_OV[0],$Q24_C_Avg,$Q24_IDX_OV[1],$Q24_A_Avg,$Q24_IDX_OV[2],$Q24_N_Avg,$Q24_IDX_OV[3],$Q24_P_Avg,$Q24_IDX_OV[4],
				$Q24_S_Avg2,$Q24_C_Avg2,$Q24_A_Avg2,$Q24_N_Avg2,$Q24_P_Avg2),
				array($language_array['qes_gen_2'],
				$Overall_S_Avg,100.0,$Overall_C_Avg,100.0,$Overall_A_Avg,100.0,$Overall_N_Avg,100.0,$Overall_P_Avg,100.0,
				$Overall_S_Avg2,$Overall_C_Avg2,$Overall_A_Avg2,$Overall_N_Avg2,$Overall_P_Avg2)
			);

$Q2_DATA = array( 
				array($language_array['qes_q2_1'],
				$Q2_a[2],$Q2_IDX['a'][0],$Q2_a[3],$Q2_IDX['a'][1],$Q2_a[4],$Q2_IDX['a'][2],$Q2_a[1],$Q2_IDX['a'][3],$Q2_a[0],$Q2_IDX['a'][4],
				$Q2_a[9],$Q2_a[10],$Q2_a[11],$Q2_a[8],$Q2_a[7]),
				array($language_array['qes_q2_2'],
				$Q2_b[2],$Q2_IDX['b'][0],$Q2_b[3],$Q2_IDX['b'][1],$Q2_b[4],$Q2_IDX['b'][2],$Q2_b[1],$Q2_IDX['b'][3],$Q2_b[0],$Q2_IDX['b'][4],
				$Q2_b[9],$Q2_b[10],$Q2_b[11],$Q2_b[8],$Q2_b[7]),
				array($language_array['qes_q2_3'],
				$Q2_c[2],$Q2_IDX['c'][0],$Q2_c[3],$Q2_IDX['c'][1],$Q2_c[4],$Q2_IDX['c'][2],$Q2_c[1],$Q2_IDX['c'][3],$Q2_c[0],$Q2_IDX['c'][4],
				$Q2_c[9],$Q2_c[10],$Q2_c[11],$Q2_c[8],$Q2_c[7]),
				array($language_array['qes_q2_4'],
				$Q2_d[2],$Q2_IDX['d'][0],$Q2_d[3],$Q2_IDX['d'][1],$Q2_d[4],$Q2_IDX['d'][2],$Q2_d[1],$Q2_IDX['d'][3],$Q2_d[0],$Q2_IDX['d'][4],
				$Q2_d[9],$Q2_d[10],$Q2_d[11],$Q2_d[8],$Q2_d[7]),
				array($language_array['qes_q2_5'],
				$Q2_e[2],$Q2_IDX['e'][0],$Q2_e[3],$Q2_IDX['e'][1],$Q2_e[4],$Q2_IDX['e'][2],$Q2_e[1],$Q2_IDX['e'][3],$Q2_e[0],$Q2_IDX['e'][4],
				$Q2_e[9],$Q2_e[10],$Q2_e[11],$Q2_e[8],$Q2_e[7]),
				array($language_array['qes_q2_6'],
				$Q2_f[2],$Q2_IDX['f'][0],$Q2_f[3],$Q2_IDX['f'][1],$Q2_f[4],$Q2_IDX['f'][2],$Q2_f[1],$Q2_IDX['f'][3],$Q2_f[0],$Q2_IDX['f'][4],
				$Q2_f[9],$Q2_f[10],$Q2_f[11],$Q2_f[8],$Q2_f[7]),
				array($language_array['qes_q2_7'],
				$Q2_g[2],$Q2_IDX['g'][0],$Q2_g[3],$Q2_IDX['g'][1],$Q2_g[4],$Q2_IDX['g'][2],$Q2_g[1],$Q2_IDX['g'][3],$Q2_g[0],$Q2_IDX['g'][4],
				$Q2_g[9],$Q2_g[10],$Q2_g[11],$Q2_g[8],$Q2_g[7]),
				array($language_array['qes_gen_1'],
				$Q2_S_Avg,$Q2_IDX_OV[0],$Q2_C_Avg,$Q2_IDX_OV[1],$Q2_A_Avg,$Q2_IDX_OV[2],$Q2_N_Avg,$Q2_IDX_OV[3],$Q2_P_Avg,$Q2_IDX_OV[4],
				$Q2_S_Avg2,$Q2_C_Avg2,$Q2_A_Avg2,$Q2_N_Avg2,$Q2_P_Avg2),
			);

$Q5_DATA = array( 
				array($language_array['qes_q5_1'],
				$Q5_a[2],$Q5_IDX['a'][0],$Q5_a[3],$Q5_IDX['a'][1],$Q5_a[4],$Q5_IDX['a'][2],$Q5_a[1],$Q5_IDX['a'][3],$Q5_a[0],$Q5_IDX['a'][4],
				$Q5_a[9],$Q5_a[10],$Q5_a[11],$Q5_a[8],$Q5_a[7]),
				array($language_array['qes_q5_2'],
				$Q5_b[2],$Q5_IDX['b'][0],$Q5_b[3],$Q5_IDX['b'][1],$Q5_b[4],$Q5_IDX['b'][2],$Q5_b[1],$Q5_IDX['b'][3],$Q5_b[0],$Q5_IDX['b'][4],
				$Q5_b[9],$Q5_b[10],$Q5_b[11],$Q5_b[8],$Q5_b[7]),
				array($language_array['qes_q5_3'],
				$Q5_c[2],$Q5_IDX['c'][0],$Q5_c[3],$Q5_IDX['c'][1],$Q5_c[4],$Q5_IDX['c'][2],$Q5_c[1],$Q5_IDX['c'][3],$Q5_c[0],$Q5_IDX['c'][4],
				$Q5_c[9],$Q5_c[10],$Q5_c[11],$Q5_c[8],$Q5_c[7]),
				array($language_array['qes_q5_4'],
				$Q5_d[2],$Q5_IDX['d'][0],$Q5_d[3],$Q5_IDX['d'][1],$Q5_d[4],$Q5_IDX['d'][2],$Q5_d[1],$Q5_IDX['d'][3],$Q5_d[0],$Q5_IDX['d'][4],
				$Q5_d[9],$Q5_d[10],$Q5_d[11],$Q5_d[8],$Q5_d[7]),
				array($language_array['qes_gen_1'],
				$Q5_S_Avg,$Q5_IDX_OV[0],$Q5_C_Avg,$Q5_IDX_OV[1],$Q5_A_Avg,$Q5_IDX_OV[2],$Q5_N_Avg,$Q5_IDX_OV[3],$Q5_P_Avg,$Q5_IDX_OV[4],
				$Q5_S_Avg2,$Q5_C_Avg2,$Q5_A_Avg2,$Q5_N_Avg2,$Q5_P_Avg2),
			);

$Q6_DATA = array( 
				array($language_array['qes_q6_1'],
				$Q6_a[2],$Q6_IDX['a'][0],$Q6_a[3],$Q6_IDX['a'][1],$Q6_a[4],$Q6_IDX['a'][2],$Q6_a[1],$Q6_IDX['a'][3],$Q6_a[0],$Q6_IDX['a'][4],
				$Q6_a[9],$Q6_a[10],$Q6_a[11],$Q6_a[8],$Q6_a[7]),
				array($language_array['qes_q6_2'],
				$Q6_b[2],$Q6_IDX['b'][0],$Q6_b[3],$Q6_IDX['b'][1],$Q6_b[4],$Q6_IDX['b'][2],$Q6_b[1],$Q6_IDX['b'][3],$Q6_b[0],$Q6_IDX['b'][4],
				$Q6_b[9],$Q6_b[10],$Q6_b[11],$Q6_b[8],$Q6_b[7]),
				array($language_array['qes_q6_3'],
				$Q6_c[2],$Q6_IDX['c'][0],$Q6_c[3],$Q6_IDX['c'][1],$Q6_c[4],$Q6_IDX['c'][2],$Q6_c[1],$Q6_IDX['c'][3],$Q6_c[0],$Q6_IDX['c'][4],
				$Q6_c[9],$Q6_c[10],$Q6_c[11],$Q6_c[8],$Q6_c[7]),
				array($language_array['qes_gen_1'],
				$Q6_S_Avg,$Q6_IDX_OV[0],$Q6_C_Avg,$Q6_IDX_OV[1],$Q6_A_Avg,$Q6_IDX_OV[2],$Q6_N_Avg,$Q6_IDX_OV[3],$Q6_P_Avg,$Q6_IDX_OV[4],
				$Q6_S_Avg2,$Q6_C_Avg2,$Q6_A_Avg2,$Q6_N_Avg2,$Q6_P_Avg2),
			);

$Q7_DATA = array( 
				array($language_array['qes_q7_1'],
				$Q7_a[2],$Q7_IDX['a'][0],$Q7_a[3],$Q7_IDX['a'][1],$Q7_a[4],$Q7_IDX['a'][2],$Q7_a[1],$Q7_IDX['a'][3],$Q7_a[0],$Q7_IDX['a'][4],
				$Q7_a[9],$Q7_a[10],$Q7_a[11],$Q7_a[8],$Q7_a[7]),
				array($language_array['qes_q7_2'],
				$Q7_b[2],$Q7_IDX['b'][0],$Q7_b[3],$Q7_IDX['b'][1],$Q7_b[4],$Q7_IDX['b'][2],$Q7_b[1],$Q7_IDX['b'][3],$Q7_b[0],$Q7_IDX['b'][4],
				$Q7_b[9],$Q7_b[10],$Q7_b[11],$Q7_b[8],$Q7_b[7]),
				array($language_array['qes_q7_3'],
				$Q7_c[2],$Q7_IDX['c'][0],$Q7_c[3],$Q7_IDX['c'][1],$Q7_c[4],$Q7_IDX['c'][2],$Q7_c[1],$Q7_IDX['c'][3],$Q7_c[0],$Q7_IDX['c'][4],
				$Q7_c[9],$Q7_c[10],$Q7_c[11],$Q7_c[8],$Q7_c[7]),

				array($language_array['qes_gen_1'],
				$Q7_S_Avg,$Q7_IDX_OV[0],$Q7_C_Avg,$Q7_IDX_OV[1],$Q7_A_Avg,$Q7_IDX_OV[2],$Q7_N_Avg,$Q7_IDX_OV[3],$Q7_P_Avg,$Q7_IDX_OV[4],
				$Q7_S_Avg2,$Q7_C_Avg2,$Q7_A_Avg2,$Q7_N_Avg2,$Q7_P_Avg2),
			);
/*
$Q8_DATA = array( 
				array($language_array['qes_q8_1'],
				$Q8_a[2],$Q8_IDX['a'][0],$Q8_a[3],$Q8_IDX['a'][1],$Q8_a[4],$Q8_IDX['a'][2],$Q8_a[1],$Q8_IDX['a'][3],$Q8_a[0],$Q8_IDX['a'][4],
				$Q8_a[9],$Q8_a[10],$Q8_a[11],$Q8_a[8],$Q8_a[7])
			);
*/

$Q9_DATA = array( 
				array($language_array['qes_q9_1'],
				$Q9_a[2],$Q9_IDX['a'][0],$Q9_a[3],$Q9_IDX['a'][1],$Q9_a[4],$Q9_IDX['a'][2],$Q9_a[1],$Q9_IDX['a'][3],$Q9_a[0],$Q9_IDX['a'][4],
				$Q9_a[9],$Q9_a[10],$Q9_a[11],$Q9_a[8],$Q9_a[7]),
				array($language_array['qes_q9_2'],
				$Q9_b[2],$Q9_IDX['b'][0],$Q9_b[3],$Q9_IDX['b'][1],$Q9_b[4],$Q9_IDX['b'][2],$Q9_b[1],$Q9_IDX['b'][3],$Q9_b[0],$Q9_IDX['b'][4],
				$Q9_a[9],$Q9_a[10],$Q9_a[11],$Q9_a[8],$Q9_a[7]),
				array($language_array['qes_q9_3'],
				$Q9_c[2],$Q9_IDX['c'][0],$Q9_c[3],$Q9_IDX['c'][1],$Q9_c[4],$Q9_IDX['c'][2],$Q9_c[1],$Q9_IDX['c'][3],$Q9_c[0],$Q9_IDX['c'][4],
				$Q9_a[9],$Q9_a[10],$Q9_a[11],$Q9_a[8],$Q9_a[7]),
				array($language_array['qes_gen_1'],
				$Q9_S_Avg,$Q9_IDX_OV[0],$Q9_C_Avg,$Q9_IDX_OV[1],$Q9_A_Avg,$Q9_IDX_OV[2],$Q9_N_Avg,$Q9_IDX_OV[3],$Q9_P_Avg,$Q9_IDX_OV[4],
				$Q9_S_Avg2,$Q9_C_Avg2,$Q9_A_Avg2,$Q9_N_Avg2,$Q9_P_Avg2),
			);

$Q10_DATA = array( 
				array($language_array['qes_q10_1'],
				$Q10_a[2],$Q10_IDX['a'][0],$Q10_a[3],$Q10_IDX['a'][1],$Q10_a[4],$Q10_IDX['a'][2],$Q10_a[1],$Q10_IDX['a'][3],$Q10_a[0],$Q10_IDX['a'][4],
				$Q10_a[9],$Q10_a[10],$Q10_a[11],$Q10_a[8],$Q10_a[7]),
				array($language_array['qes_q10_2'],
				$Q10_b[2],$Q10_IDX['b'][0],$Q10_b[3],$Q10_IDX['b'][1],$Q10_b[4],$Q10_IDX['b'][2],$Q10_b[1],$Q10_IDX['b'][3],$Q10_b[0],$Q10_IDX['b'][4],
				$Q10_b[9],$Q10_b[10],$Q10_b[11],$Q10_b[8],$Q10_b[7]),
				array($language_array['qes_q10_3'],
				$Q10_c[2],$Q10_IDX['c'][0],$Q10_c[3],$Q10_IDX['c'][1],$Q10_c[4],$Q10_IDX['c'][2],$Q10_c[1],$Q10_IDX['c'][3],$Q10_c[0],$Q10_IDX['c'][4],
				$Q10_c[9],$Q10_c[10],$Q10_c[11],$Q10_c[8],$Q10_c[7]),
				array($language_array['qes_gen_1'],
				$Q10_S_Avg,$Q10_IDX_OV[0],$Q10_C_Avg,$Q10_IDX_OV[1],$Q10_A_Avg,$Q10_IDX_OV[2],$Q10_N_Avg,$Q10_IDX_OV[3],$Q10_P_Avg,$Q10_IDX_OV[4],
				$Q10_S_Avg2,$Q10_C_Avg2,$Q10_A_Avg2,$Q10_N_Avg2,$Q10_P_Avg2),
			);

$Q11_DATA = array( 
				array($language_array['qes_q11_1'],
				$Q11_a[2],$Q11_IDX['a'][0],$Q11_a[3],$Q11_IDX['a'][1],$Q11_a[4],$Q11_IDX['a'][2],$Q11_a[1],$Q11_IDX['a'][3],$Q11_a[0],$Q11_IDX['a'][4],
				$Q11_a[9],$Q11_a[10],$Q11_a[11],$Q11_a[8],$Q11_a[7]),
				array($language_array['qes_q11_2'],
				$Q11_b[2],$Q11_IDX['b'][0],$Q11_b[3],$Q11_IDX['b'][1],$Q11_b[4],$Q11_IDX['b'][2],$Q11_b[1],$Q11_IDX['b'][3],$Q11_b[0],$Q11_IDX['b'][4],
				$Q11_b[9],$Q11_b[10],$Q11_b[11],$Q11_b[8],$Q11_b[7]),
				array($language_array['qes_q11_3'],
				$Q11_c[2],$Q11_IDX['c'][0],$Q11_c[3],$Q11_IDX['c'][1],$Q11_c[4],$Q11_IDX['c'][2],$Q11_c[1],$Q11_IDX['c'][3],$Q11_c[0],$Q11_IDX['c'][4],
				$Q11_c[9],$Q11_c[10],$Q11_c[11],$Q11_c[8],$Q11_c[7]),
				array($language_array['qes_gen_1'],
				$Q11_S_Avg,$Q11_IDX_OV[0],$Q11_C_Avg,$Q11_IDX_OV[1],$Q11_A_Avg,$Q11_IDX_OV[2],$Q11_N_Avg,$Q11_IDX_OV[3],$Q11_P_Avg,$Q11_IDX_OV[4],
				$Q11_S_Avg2,$Q11_C_Avg2,$Q11_A_Avg2,$Q11_N_Avg2,$Q11_P_Avg2),
			);


$Q12_DATA = array( 
				array($language_array['qes_q12_1'],
				$Q12_a[2],$Q12_IDX['a'][0],$Q12_a[3],$Q12_IDX['a'][1],$Q12_a[4],$Q12_IDX['a'][2],$Q12_a[1],$Q12_IDX['a'][3],$Q12_a[0],$Q12_IDX['a'][4],
				$Q12_a[9],$Q12_a[10],$Q12_a[11],$Q12_a[8],$Q12_a[7]),
				array($language_array['qes_q12_2'],
				$Q12_b[2],$Q12_IDX['b'][0],$Q12_b[3],$Q12_IDX['b'][1],$Q12_b[4],$Q12_IDX['b'][2],$Q12_b[1],$Q12_IDX['b'][3],$Q12_b[0],$Q12_IDX['b'][4],
				$Q12_b[9],$Q12_b[10],$Q12_b[11],$Q12_b[8],$Q12_b[7]),
				array($language_array['qes_q12_3'],
				$Q12_c[2],$Q12_IDX['c'][0],$Q12_c[3],$Q12_IDX['c'][1],$Q12_c[4],$Q12_IDX['c'][2],$Q12_c[1],$Q12_IDX['c'][3],$Q12_c[0],$Q12_IDX['c'][4],
				$Q12_c[9],$Q12_c[10],$Q12_c[11],$Q12_c[8],$Q12_c[7]),
				array($language_array['qes_q12_4'],
				$Q12_d[2],$Q12_IDX['d'][0],$Q12_d[3],$Q12_IDX['d'][1],$Q12_d[4],$Q12_IDX['d'][2],$Q12_d[1],$Q12_IDX['d'][3],$Q12_d[0],$Q12_IDX['d'][4],
				$Q12_d[9],$Q12_d[10],$Q12_d[11],$Q12_d[8],$Q12_d[7]),
				array($language_array['qes_q12_5'],
				$Q12_e[2],$Q12_IDX['e'][0],$Q12_e[3],$Q12_IDX['e'][1],$Q12_e[4],$Q12_IDX['e'][2],$Q12_e[1],$Q12_IDX['e'][3],$Q12_e[0],$Q12_IDX['e'][4],
				$Q12_e[9],$Q12_e[10],$Q12_e[11],$Q12_e[8],$Q12_e[7]),
				array($language_array['qes_q12_6'],
				$Q12_f[2],$Q12_IDX['f'][0],$Q12_f[3],$Q12_IDX['f'][1],$Q12_f[4],$Q12_IDX['f'][2],$Q12_f[1],$Q12_IDX['f'][3],$Q12_f[0],$Q12_IDX['f'][4],
				$Q12_f[9],$Q12_f[10],$Q12_f[11],$Q12_f[8],$Q12_f[7]),
				array($language_array['qes_gen_1'],
				$Q12_S_Avg,$Q12_IDX_OV[0],$Q12_C_Avg,$Q12_IDX_OV[1],$Q12_A_Avg,$Q12_IDX_OV[2],$Q12_N_Avg,$Q12_IDX_OV[3],$Q12_P_Avg,$Q12_IDX_OV[4],
				$Q12_S_Avg2,$Q12_C_Avg2,$Q12_A_Avg2,$Q12_N_Avg2,$Q12_P_Avg2),
			);
			
$Q13_DATA = array( 
				array($language_array['qes_q13_1'],
				$Q13_a[2],$Q13_IDX['a'][0],$Q13_a[3],$Q13_IDX['a'][1],$Q13_a[4],$Q13_IDX['a'][2],$Q13_a[1],$Q13_IDX['a'][3],$Q13_a[0],$Q13_IDX['a'][4],
				$Q13_a[9],$Q13_a[10],$Q13_a[11],$Q13_a[8],$Q13_a[7]),
				array($language_array['qes_q13_2'],
				$Q13_b[2],$Q13_IDX['b'][0],$Q13_b[3],$Q13_IDX['b'][1],$Q13_b[4],$Q13_IDX['b'][2],$Q13_b[1],$Q13_IDX['b'][3],$Q13_b[0],$Q13_IDX['b'][4],
				$Q13_b[9],$Q13_b[10],$Q13_b[11],$Q13_b[8],$Q13_b[7]),
				array($language_array['qes_gen_1'],
				$Q13_S_Avg,$Q13_IDX_OV[0],$Q13_C_Avg,$Q13_IDX_OV[1],$Q13_A_Avg,$Q13_IDX_OV[2],$Q13_N_Avg,$Q13_IDX_OV[3],$Q13_P_Avg,$Q13_IDX_OV[4],
				$Q13_S_Avg2,$Q13_C_Avg2,$Q13_A_Avg2,$Q13_N_Avg2,$Q13_P_Avg2),
			);
						

$Q14_DATA = array( 
				array($language_array['qes_q14_1'],
				$Q14_a[2],$Q14_IDX['a'][0],$Q14_a[3],$Q14_IDX['a'][1],$Q14_a[4],$Q14_IDX['a'][2],$Q14_a[1],$Q14_IDX['a'][3],$Q14_a[0],$Q14_IDX['a'][4],
				$Q14_a[9],$Q14_a[10],$Q14_a[11],$Q14_a[8],$Q14_a[7]),
				array($language_array['qes_q14_2'],
				$Q14_b[2],$Q14_IDX['b'][0],$Q14_b[3],$Q14_IDX['b'][1],$Q14_b[4],$Q14_IDX['b'][2],$Q14_b[1],$Q14_IDX['b'][3],$Q14_b[0],$Q14_IDX['b'][4],
				$Q14_b[9],$Q14_b[10],$Q14_b[11],$Q14_b[8],$Q14_b[7]),
				array($language_array['qes_q14_3'],
				$Q14_c[2],$Q14_IDX['c'][0],$Q14_c[3],$Q14_IDX['c'][1],$Q14_c[4],$Q14_IDX['c'][2],$Q14_c[1],$Q14_IDX['c'][3],$Q14_c[0],$Q14_IDX['c'][4],
				$Q14_c[9],$Q14_c[10],$Q14_c[11],$Q14_c[8],$Q14_c[7]),
				array($language_array['qes_q14_4'],
				$Q14_d[2],$Q14_IDX['d'][0],$Q14_d[3],$Q14_IDX['d'][1],$Q14_d[4],$Q14_IDX['d'][2],$Q14_d[1],$Q14_IDX['d'][3],$Q14_d[0],$Q14_IDX['d'][4],
				$Q14_d[9],$Q14_d[10],$Q14_d[11],$Q14_d[8],$Q14_d[7]),
				array($language_array['qes_q14_5'],
				$Q14_e[2],$Q14_IDX['e'][0],$Q14_e[3],$Q14_IDX['e'][1],$Q14_e[4],$Q14_IDX['e'][2],$Q14_e[1],$Q14_IDX['e'][3],$Q14_e[0],$Q14_IDX['e'][4],
				$Q14_e[9],$Q14_e[10],$Q14_e[11],$Q14_e[8],$Q14_e[7]),
				array($language_array['qes_q14_6'],
				$Q14_f[2],$Q14_IDX['f'][0],$Q14_f[3],$Q14_IDX['f'][1],$Q14_f[4],$Q14_IDX['f'][2],$Q14_f[1],$Q14_IDX['f'][3],$Q14_f[0],$Q14_IDX['f'][4],
				$Q14_f[9],$Q14_f[10],$Q14_f[11],$Q14_f[8],$Q14_f[7]),
				array($language_array['qes_gen_1'],
				$Q14_S_Avg,$Q14_IDX_OV[0],$Q14_C_Avg,$Q14_IDX_OV[1],$Q14_A_Avg,$Q14_IDX_OV[2],$Q14_N_Avg,$Q14_IDX_OV[3],$Q14_P_Avg,$Q14_IDX_OV[4],
				$Q14_S_Avg2,$Q14_C_Avg2,$Q14_A_Avg2,$Q14_N_Avg2,$Q14_P_Avg2),
			);
			
$Q17_DATA = array( 
				array($language_array['qes_q17_1'],
				$Q17_a[2],$Q17_IDX['a'][0],$Q17_a[3],$Q17_IDX['a'][1],$Q17_a[4],$Q17_IDX['a'][2],$Q17_a[1],$Q17_IDX['a'][3],$Q17_a[0],$Q17_IDX['a'][4],
				$Q17_a[9],$Q17_a[10],$Q17_a[11],$Q17_a[8],$Q17_a[7]),
				array($language_array['qes_q17_2'],
				$Q17_b[2],$Q17_IDX['b'][0],$Q17_b[3],$Q17_IDX['b'][1],$Q17_b[4],$Q17_IDX['b'][2],$Q17_b[1],$Q17_IDX['b'][3],$Q17_b[0],$Q17_IDX['b'][4],
				$Q17_b[9],$Q17_b[10],$Q17_b[11],$Q17_b[8],$Q17_b[7]),
				array($language_array['qes_q17_3'],
				$Q17_c[2],$Q17_IDX['c'][0],$Q17_c[3],$Q17_IDX['c'][1],$Q17_c[4],$Q17_IDX['c'][2],$Q17_c[1],$Q17_IDX['c'][3],$Q17_c[0],$Q17_IDX['c'][4],
				$Q17_c[9],$Q17_c[10],$Q17_c[11],$Q17_c[8],$Q17_c[7]),
				array($language_array['qes_q17_4'],
				$Q17_d[2],$Q17_IDX['d'][0],$Q17_d[3],$Q17_IDX['d'][1],$Q17_d[4],$Q17_IDX['d'][2],$Q17_d[1],$Q17_IDX['d'][3],$Q17_d[0],$Q17_IDX['d'][4],
				$Q17_d[9],$Q17_d[10],$Q17_d[11],$Q17_d[8],$Q17_d[7]),
				array($language_array['qes_q17_5'],
				$Q17_e[2],$Q17_IDX['e'][0],$Q17_e[3],$Q17_IDX['e'][1],$Q17_e[4],$Q17_IDX['e'][2],$Q17_e[1],$Q17_IDX['e'][3],$Q17_e[0],$Q17_IDX['e'][4],
				$Q17_e[9],$Q17_e[10],$Q17_e[11],$Q17_e[8],$Q17_e[7]),
				array($language_array['qes_gen_1'],
				$Q17_S_Avg,$Q17_IDX_OV[0],$Q17_C_Avg,$Q17_IDX_OV[1],$Q17_A_Avg,$Q17_IDX_OV[2],$Q17_N_Avg,$Q17_IDX_OV[3],$Q17_P_Avg,$Q17_IDX_OV[4],
				$Q17_S_Avg2,$Q17_C_Avg2,$Q17_A_Avg2,$Q17_N_Avg2,$Q17_P_Avg2),
			);

/*
$Q18_DATA = array( 
				array($language_array['qes_q18_1'],
				$Q18_a[2],$Q18_IDX['a'][0],$Q18_a[3],$Q18_IDX['a'][1],$Q18_a[4],$Q18_IDX['a'][2],$Q18_a[1],$Q18_IDX['a'][3],$Q18_a[0],$Q18_IDX['a'][4],
				$Q18_a[9],$Q18_a[10],$Q18_a[11],$Q18_a[8],$Q18_a[7]),
				array($language_array['qes_q18_2'],
				$Q18_b[2],$Q18_IDX['b'][0],$Q18_b[3],$Q18_IDX['b'][1],$Q18_b[4],$Q18_IDX['b'][2],$Q18_b[1],$Q18_IDX['b'][3],$Q18_b[0],$Q18_IDX['b'][4],
				$Q18_b[9],$Q18_b[10],$Q18_b[11],$Q18_b[8],$Q18_b[7]),
				array($language_array['qes_q18_3'],
				$Q18_c[2],$Q18_IDX['c'][0],$Q18_c[3],$Q18_IDX['c'][1],$Q18_c[4],$Q18_IDX['c'][2],$Q18_c[1],$Q18_IDX['c'][3],$Q18_c[0],$Q18_IDX['c'][4],
				$Q18_c[9],$Q18_c[10],$Q18_c[11],$Q18_c[8],$Q18_c[7]),
				array($language_array['qes_q18_4'],
				$Q18_d[2],$Q18_IDX['d'][0],$Q18_d[3],$Q18_IDX['d'][1],$Q18_d[4],$Q18_IDX['d'][2],$Q18_d[1],$Q18_IDX['d'][3],$Q18_d[0],$Q18_IDX['d'][4],
				$Q18_d[9],$Q18_d[10],$Q18_d[11],$Q18_d[8],$Q18_d[7]),
				array($language_array['qes_q18_5'],
				$Q18_e[2],$Q18_IDX['e'][0],$Q18_e[3],$Q18_IDX['e'][1],$Q18_e[4],$Q18_IDX['e'][2],$Q18_e[1],$Q18_IDX['e'][3],$Q18_e[0],$Q18_IDX['e'][4],
				$Q18_e[9],$Q18_e[10],$Q18_e[11],$Q18_e[8],$Q18_e[7]),
				array($language_array['qes_q18_6'],
				$Q18_f[2],$Q18_IDX['f'][0],$Q18_f[3],$Q18_IDX['f'][1],$Q18_f[4],$Q18_IDX['f'][2],$Q18_f[1],$Q18_IDX['f'][3],$Q18_f[0],$Q18_IDX['f'][4],
				$Q18_f[9],$Q18_f[10],$Q18_f[11],$Q18_f[8],$Q18_f[7]),
				array($language_array['qes_q18_7'],
				$Q18_g[2],$Q18_IDX['g'][0],$Q18_g[3],$Q18_IDX['g'][1],$Q18_g[4],$Q18_IDX['g'][2],$Q18_g[1],$Q18_IDX['g'][3],$Q18_g[0],$Q18_IDX['g'][4],
				$Q18_g[9],$Q18_g[10],$Q18_g[11],$Q18_g[8],$Q18_g[7]),
				array($language_array['qes_q18_8'],
				$Q18_h[2],$Q18_IDX['h'][0],$Q18_h[3],$Q18_IDX['h'][1],$Q18_h[4],$Q18_IDX['h'][2],$Q18_h[1],$Q18_IDX['h'][3],$Q18_h[0],$Q18_IDX['h'][4],
				$Q18_h[9],$Q18_h[10],$Q18_h[11],$Q18_h[8],$Q18_h[7]),
				array($language_array['qes_q18_9'],
				$Q18_i[2],$Q18_IDX['i'][0],$Q18_i[3],$Q18_IDX['i'][1],$Q18_i[4],$Q18_IDX['i'][2],$Q18_i[1],$Q18_IDX['i'][3],$Q18_i[0],$Q18_IDX['i'][4],
				$Q18_i[9],$Q18_i[10],$Q18_i[11],$Q18_i[8],$Q18_i[7]),
				array($language_array['qes_q18_10'],
				$Q18_j[2],$Q18_IDX['j'][0],$Q18_j[3],$Q18_IDX['j'][1],$Q18_j[4],$Q18_IDX['j'][2],$Q18_j[1],$Q18_IDX['j'][3],$Q18_j[0],$Q18_IDX['j'][4],
				$Q18_j[9],$Q18_j[10],$Q18_j[11],$Q18_j[8],$Q18_j[7]),
				array($language_array['qes_q18_11'],
				$Q18_k[2],$Q18_IDX['k'][0],$Q18_k[3],$Q18_IDX['k'][1],$Q18_k[4],$Q18_IDX['k'][2],$Q18_k[1],$Q18_IDX['k'][3],$Q18_k[0],$Q18_IDX['k'][4],
				$Q18_k[9],$Q18_k[10],$Q18_k[11],$Q18_k[8],$Q18_k[7]),				
				array($language_array['qes_gen_1'],
				$Q18_S_Avg,$Q18_IDX_OV[0],$Q18_C_Avg,$Q18_IDX_OV[1],$Q18_A_Avg,$Q18_IDX_OV[2],$Q18_N_Avg,$Q18_IDX_OV[3],$Q18_P_Avg,$Q18_IDX_OV[4],
				$Q18_S_Avg2,$Q18_C_Avg2,$Q18_A_Avg2,$Q18_N_Avg2,$Q18_P_Avg2),
			);
*/

$Q22_DATA = array( 
				array($language_array['qes_q22_1'],
				$Q22_a[2],$Q22_IDX['a'][0],$Q22_a[3],$Q22_IDX['a'][1],$Q22_a[4],$Q22_IDX['a'][2],$Q22_a[1],$Q22_IDX['a'][3],$Q22_a[0],$Q22_IDX['a'][4],
				$Q22_a[9],$Q22_a[10],$Q22_a[11],$Q22_a[8],$Q22_a[7]),
				array($language_array['qes_q22_2'],
				$Q22_b[2],$Q22_IDX['b'][0],$Q22_b[3],$Q22_IDX['b'][1],$Q22_b[4],$Q22_IDX['b'][2],$Q22_b[1],$Q22_IDX['b'][3],$Q22_b[0],$Q22_IDX['b'][4],
				$Q22_b[9],$Q22_b[10],$Q22_b[11],$Q22_b[8],$Q22_b[7]),
				array($language_array['qes_q22_3'],
				$Q22_c[2],$Q22_IDX['c'][0],$Q22_c[3],$Q22_IDX['c'][1],$Q22_c[4],$Q22_IDX['c'][2],$Q22_c[1],$Q22_IDX['c'][3],$Q22_c[0],$Q22_IDX['c'][4],
				$Q22_c[9],$Q22_c[10],$Q22_c[11],$Q22_c[8],$Q22_c[7]),
				array($language_array['qes_q22_4'],
				$Q22_d[2],$Q22_IDX['d'][0],$Q22_d[3],$Q22_IDX['d'][1],$Q22_d[4],$Q22_IDX['d'][2],$Q22_d[1],$Q22_IDX['d'][3],$Q22_d[0],$Q22_IDX['d'][4],
				$Q22_d[9],$Q22_d[10],$Q22_d[11],$Q22_d[8],$Q22_d[7]),
				array($language_array['qes_q22_5'],
				$Q22_e[2],$Q22_IDX['e'][0],$Q22_e[3],$Q22_IDX['e'][1],$Q22_e[4],$Q22_IDX['e'][2],$Q22_e[1],$Q22_IDX['e'][3],$Q22_e[0],$Q22_IDX['e'][4],
				$Q22_e[9],$Q22_e[10],$Q22_e[11],$Q22_e[8],$Q22_e[7]),
				array($language_array['qes_q22_6'],
				$Q22_f[2],$Q22_IDX['f'][0],$Q22_f[3],$Q22_IDX['f'][1],$Q22_f[4],$Q22_IDX['f'][2],$Q22_f[1],$Q22_IDX['f'][3],$Q22_f[0],$Q22_IDX['f'][4],
				$Q22_f[9],$Q22_f[10],$Q22_f[11],$Q22_f[8],$Q22_f[7]),
				array($language_array['qes_q22_7'],
				$Q22_g[2],$Q22_IDX['g'][0],$Q22_g[3],$Q22_IDX['g'][1],$Q22_g[4],$Q22_IDX['g'][2],$Q22_g[1],$Q22_IDX['g'][3],$Q22_g[0],$Q22_IDX['g'][4],
				$Q22_g[9],$Q22_g[10],$Q22_g[11],$Q22_g[8],$Q22_g[7]),
				array($language_array['qes_q22_8'],
				$Q22_h[2],$Q22_IDX['h'][0],$Q22_h[3],$Q22_IDX['h'][1],$Q22_h[4],$Q22_IDX['h'][2],$Q22_h[1],$Q22_IDX['h'][3],$Q22_h[0],$Q22_IDX['h'][4],
				$Q22_h[9],$Q22_h[10],$Q22_h[11],$Q22_h[8],$Q22_h[7]),				
				array($language_array['qes_gen_1'],
				$Q22_S_Avg,$Q22_IDX_OV[0],$Q22_C_Avg,$Q22_IDX_OV[1],$Q22_A_Avg,$Q22_IDX_OV[2],$Q22_N_Avg,$Q22_IDX_OV[3],$Q22_P_Avg,$Q22_IDX_OV[4],
				$Q22_S_Avg2,$Q22_C_Avg2,$Q22_A_Avg2,$Q22_N_Avg2,$Q22_P_Avg2),
			);

$Q23_DATA = array( 
				array($language_array['qes_q23_1'],
				$Q23_a[2],$Q23_IDX['a'][0],$Q23_a[3],$Q23_IDX['a'][1],$Q23_a[4],$Q23_IDX['a'][2],$Q23_a[1],$Q23_IDX['a'][3],$Q23_a[0],$Q23_IDX['a'][4],
				$Q23_a[9],$Q23_a[10],$Q23_a[11],$Q23_a[8],$Q23_a[7]),
				array($language_array['qes_q23_2'],
				$Q23_b[2],$Q23_IDX['b'][0],$Q23_b[3],$Q23_IDX['b'][1],$Q23_b[4],$Q23_IDX['b'][2],$Q23_b[1],$Q23_IDX['b'][3],$Q23_b[0],$Q23_IDX['b'][4],
				$Q23_b[9],$Q23_b[10],$Q23_b[11],$Q23_b[8],$Q23_b[7]),
				array($language_array['qes_q23_3'],
				$Q23_c[2],$Q23_IDX['c'][0],$Q23_c[3],$Q23_IDX['c'][1],$Q23_c[4],$Q23_IDX['c'][2],$Q23_c[1],$Q23_IDX['c'][3],$Q23_c[0],$Q23_IDX['c'][4],
				$Q23_c[9],$Q23_c[10],$Q23_c[11],$Q23_c[8],$Q23_c[7]),
				array($language_array['qes_q23_4'],
				$Q23_d[2],$Q23_IDX['d'][0],$Q23_d[3],$Q23_IDX['d'][1],$Q23_d[4],$Q23_IDX['d'][2],$Q23_d[1],$Q23_IDX['d'][3],$Q23_d[0],$Q23_IDX['d'][4],
				$Q23_d[9],$Q23_d[10],$Q23_d[11],$Q23_d[8],$Q23_d[7]),
				array($language_array['qes_q23_5'],
				$Q23_e[2],$Q23_IDX['e'][0],$Q23_e[3],$Q23_IDX['e'][1],$Q23_e[4],$Q23_IDX['e'][2],$Q23_e[1],$Q23_IDX['e'][3],$Q23_e[0],$Q23_IDX['e'][4],
				$Q23_e[9],$Q23_e[10],$Q23_e[11],$Q23_e[8],$Q23_e[7]),	
				array($language_array['qes_gen_1'],
				$Q23_S_Avg,$Q23_IDX_OV[0],$Q23_C_Avg,$Q23_IDX_OV[1],$Q23_A_Avg,$Q23_IDX_OV[2],$Q23_N_Avg,$Q23_IDX_OV[3],$Q23_P_Avg,$Q23_IDX_OV[4],
				$Q23_S_Avg2,$Q23_C_Avg2,$Q23_A_Avg2,$Q23_N_Avg2,$Q23_P_Avg2),
			);


$Q24_DATA = array( 
				array($language_array['qes_q24_1'],
				$Q24_a[2],$Q24_IDX['a'][0],$Q24_a[3],$Q24_IDX['a'][1],$Q24_a[4],$Q24_IDX['a'][2],$Q24_a[1],$Q24_IDX['a'][3],$Q24_a[0],$Q24_IDX['a'][4],
				$Q24_a[9],$Q24_a[10],$Q24_a[11],$Q24_a[8],$Q24_a[7])
			);


$QDATA = ${"Q".$_SESSION["seas_brd_filter_topic"]."_DATA"};


//***********************************************************************************************************************************************//
include_once("../PHPExcel/Classes/PHPExcel.php");
$objPHPExcel = new PHPExcel();
$objPHPExcel->setActiveSheetIndex(0);
$objWorksheet = $objPHPExcel->getSheet(0);
$objWorksheet->setTitle('HAAD');

$objWorkSheet2 = $objPHPExcel->createSheet(1);
$objWorkSheet2->setTitle("ChartData");

$objWorksheet->setShowGridlines(false);

// Set Row Column Height Width
$objWorksheet->getColumnDimension('A')->setWidth(4);
$objWorksheet->getColumnDimension('B')->setWidth(60);
$objWorksheet->getColumnDimension('C')->setWidth(60);
$objWorksheet->getColumnDimension('D')->setWidth(10);
$objWorksheet->getColumnDimension('E')->setWidth(10);
$objWorksheet->getColumnDimension('F')->setWidth(10);
$objWorksheet->getColumnDimension('G')->setWidth(10);
$objWorksheet->getColumnDimension('H')->setWidth(10);
$objWorksheet->getColumnDimension('I')->setWidth(10);

//if($_SESSION["seas_brd_filter_topic"]!=99) {
	$objWorksheet->getRowDimension('1')->setRowHeight(60);
	
	// Add a drawing to the worksheetecho date('H:i:s') . " Add a drawing to the worksheet\n";
	$objDrawing = new PHPExcel_Worksheet_Drawing();
	$objDrawing->setName('Logo');
	$objDrawing->setDescription('Logo');
	$logo = '/view/images/parc-logo.png'; // Provide path to your logo file
	$objDrawing->setPath($logo);  //setOffsetY has no effect
	$objDrawing->setCoordinates('A1');
	$objDrawing->setHeight(80); // logo height
	$objDrawing->setWorksheet($objPHPExcel->getActiveSheet()); 

	// Heading
	$objWorksheet->mergeCells('A1:C1');
	$objWorksheet->setCellValue('A1',$language_array['main_title']);
	if($_SESSION["seas_brd_language"]==2) {
		$style = array(
			'font' => array('bold' => false, 'size' => 17,'name' => 'Verdana'),
			'alignment' => array('horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_LEFT,'vertical'=>PHPExcel_Style_Alignment::VERTICAL_CENTER),
		);
	}
	else {
		$style = array(
			'font' => array('bold' => false, 'size' => 17,'name' => 'Verdana'),
			'alignment' => array('horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_RIGHT,'vertical'=>PHPExcel_Style_Alignment::VERTICAL_CENTER),
		);		
	}
	$objWorksheet->getStyle('A1')->applyFromArray($style);
	
	
	// Column Headings Formats
	$objWorksheet->mergeCells('A2:B3');
	if($trg_sample >50) {
		$objWorksheet->mergeCells('C2:C3');
	}
	$objWorksheet->mergeCells('D2:D3');
	$objWorksheet->mergeCells('E2:I2');

	if($_SESSION["seas_brd_language"]==2) {	
		$style = array(
			'font' => array('bold' => true, 'size' => 9,'name' => 'Verdana'),
			'alignment' => array('horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_RIGHT,'vertical'=>PHPExcel_Style_Alignment::VERTICAL_CENTER),
			'fill' => array('type' => PHPExcel_Style_Fill::FILL_SOLID,'color' => array('rgb' => 'cccccc')),
			'borders' => array('outline' => array('style' => PHPExcel_Style_Border::BORDER_THIN))
		);
	}
	else {
		$style = array(
			'font' => array('bold' => true, 'size' => 9,'name' => 'Verdana'),
			'alignment' => array('horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_LEFT,'vertical'=>PHPExcel_Style_Alignment::VERTICAL_CENTER),
			'fill' => array('type' => PHPExcel_Style_Fill::FILL_SOLID,'color' => array('rgb' => 'cccccc')),
			'borders' => array('outline' => array('style' => PHPExcel_Style_Border::BORDER_THIN))
		);
	}
		
	$objWorksheet->getStyle('A2:B3')->applyFromArray($style);


	$style = array(
		'font' => array('bold' => false, 'size' => 9,'name' => 'Verdana'),
		'alignment' => array('horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER,'vertical'=>PHPExcel_Style_Alignment::VERTICAL_CENTER),
		'fill' => array('type' => PHPExcel_Style_Fill::FILL_SOLID,'color' => array('rgb' => 'cccccc')),
		'borders' => array('outline' => array('style' => PHPExcel_Style_Border::BORDER_THIN))
	);
	$objWorksheet->getStyle('C2:C3')->applyFromArray($style);
	$objWorksheet->getStyle('D2:D3')->applyFromArray($style);
	$style = array(
		'font' => array('bold' => true, 'size' => 9,'name' => 'Verdana'),
		'alignment' => array('horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER,'vertical'=>PHPExcel_Style_Alignment::VERTICAL_CENTER),
		'fill' => array('type' => PHPExcel_Style_Fill::FILL_SOLID,'color' => array('rgb' => 'cccccc')),
		'borders' => array('outline' => array('style' => PHPExcel_Style_Border::BORDER_THIN))
	);
	$objWorksheet->getStyle('E2:I2')->applyFromArray($style);
	$style = array(
		'font' => array('bold' => true, 'size' => 9,'name' => 'Verdana'),
		'alignment' => array('horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER,'vertical'=>PHPExcel_Style_Alignment::VERTICAL_CENTER),
		'fill' => array('type' => PHPExcel_Style_Fill::FILL_SOLID,'color' => array('rgb' => '91C8FF')),
		'borders' => array('outline' => array('style' => PHPExcel_Style_Border::BORDER_THIN))
	);
	$objWorksheet->getStyle('E3')->applyFromArray($style);
	$style = array(
		'font' => array('bold' => true, 'size' => 9,'name' => 'Verdana','color' => array('rgb' => '000000')),
		'alignment' => array('horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER,'vertical'=>PHPExcel_Style_Alignment::VERTICAL_CENTER),
		'fill' => array('type' => PHPExcel_Style_Fill::FILL_SOLID,'color' => array('rgb' => 'ff00ff')),
		'borders' => array('outline' => array('style' => PHPExcel_Style_Border::BORDER_THIN))
	);
	$objWorksheet->getStyle('F3')->applyFromArray($style);
	$style = array(
		'font' => array('bold' => true, 'size' => 9,'name' => 'Verdana'),
		'alignment' => array('horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER,'vertical'=>PHPExcel_Style_Alignment::VERTICAL_CENTER),
		'fill' => array('type' => PHPExcel_Style_Fill::FILL_SOLID,'color' => array('rgb' => '00FF00')),
		'borders' => array('outline' => array('style' => PHPExcel_Style_Border::BORDER_THIN))
	);	
	$objWorksheet->getStyle('G3')->applyFromArray($style);
	$style = array(
		'font' => array('bold' => true, 'size' => 9,'name' => 'Verdana'),
		'alignment' => array('horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER,'vertical'=>PHPExcel_Style_Alignment::VERTICAL_CENTER),
		'fill' => array('type' => PHPExcel_Style_Fill::FILL_SOLID,'color' => array('rgb' => 'FF0000')),
		'borders' => array('outline' => array('style' => PHPExcel_Style_Border::BORDER_THIN))
	);
	$objWorksheet->getStyle('H3')->applyFromArray($style);
	$style = array(
		'font' => array('bold' => true, 'size' => 9,'name' => 'Verdana'),
		'alignment' => array('horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER,'vertical'=>PHPExcel_Style_Alignment::VERTICAL_CENTER),
		'fill' => array('type' => PHPExcel_Style_Fill::FILL_SOLID,'color' => array('rgb' => 'FFFFCC')),
		'borders' => array('outline' => array('style' => PHPExcel_Style_Border::BORDER_THIN))
	);
	$objWorksheet->getStyle('I3')->applyFromArray($style);
		
	
	
	// Column Heading Text
	$objWorksheet->setCellValue('A2',$Question_Labels[$_SESSION["seas_brd_filter_topic"]]);
	
	$filter_txt="";
	$target_filter_txt="";
	$bnch_filter_txt="";
	
	  if(strlen($_SESSION["seas_brd_filter_text"])>0) {
	   	$filter_txt= $_SESSION["seas_brd_filter_text"]."\r"; 
		$filter_txt= str_replace("<br>","\r",$filter_txt);
	  }
	  if(strlen($_SESSION["seas_brd_target_sample_text"])>0) {
	   	$target_filter_txt= $_SESSION["seas_brd_target_sample_text"]."\r"; 
		$target_filter_txt= str_replace("<br>","\r",$target_filter_txt);
	  }
	  if(strlen($_SESSION["seas_brd_benchmark_sample_text"])>0) {
	   	$bnch_filter_txt= $_SESSION["seas_brd_benchmark_sample_text"]."\r"; 
		$bnch_filter_txt= str_replace("<br>","\r",$bnch_filter_txt);
	  } 	  
	  
	$objWorksheet->getRowDimension(2)->setRowHeight(20);	  
	$objWorksheet->getRowDimension(3)->setRowHeight(20);	  
		
	if(strlen($_SESSION["seas_brd_bnch_filter_condition"])>0) {
		$objWorksheet->setCellValue('C2',$filter_txt.$target_filter_txt.$bnch_filter_txt);
	}
	else {
		$objWorksheet->setCellValue('C2',$filter_txt.$target_filter_txt);
	}
	$objWorksheet->getStyle('C2')->getAlignment()->setWrapText(true);
	
	if($trg_sample <=50) {
		$objWorksheet->setCellValue('C3',$language_array['caution_small_sample_size']);	
		$style = array(
			'font' => array('bold' => false, 'size' => 9,'name' => 'Verdana','color' => array('rgb' => 'ff0000'))
		);
		$objWorksheet->getStyle('C3')->applyFromArray($style);		
	}
	
	$objWorksheet->setCellValue('E2',$language_array['opinion']);
	$objWorksheet->setCellValue('E3',$language_array['strength']);
	$objWorksheet->setCellValue('F3',$language_array['tone']);
	$objWorksheet->setCellValue('G3',$language_array['positive']);
	$objWorksheet->setCellValue('H3',$language_array['negative']);
	$objWorksheet->setCellValue('I3',$language_array['average']);
	$rowID= 4;
//}
//else {
//	$rowID= 1;
//}

// Enter Data
if($_SESSION["seas_brd_language"]==2) {
	$alpha =array("ا","ب","ج","د","ه","و","ز","ح","ط","ي","ك","ل","م","ن","س","ع","ف","ص","ق","ر","ش","ت","ث","خ","ذ","ض");
}
else {
	$alpha =array("a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z");
}
$lnCount=0;
$rowID_CD=1;

// Chart Data heading
$objWorkSheet2->getColumnDimension('A')->setWidth(60);
$objWorkSheet2->setCellValue('A'.$rowID_CD,$Question_Labels[$_SESSION["seas_brd_filter_topic"]]);
$objWorkSheet2->setCellValue('B'.$rowID_CD,$language_array['strength']);
$objWorkSheet2->setCellValue('C'.$rowID_CD,$language_array['tone']);
$objWorkSheet2->setCellValue('D'.$rowID_CD,$language_array['positive']);
$objWorkSheet2->setCellValue('E'.$rowID_CD,$language_array['negative']);
$objWorkSheet2->setCellValue('F'.$rowID_CD,$language_array['average']);

$rowID_CD++;
// End Chart Data heading

	foreach($QDATA as $QD) {
	
		//if($QD[0]!="Chapter Overall Average") {
			//if($_SESSION["seas_brd_filter_topic"]!=99) {
				$rowID2=$rowID+1;
				if(strlen($_SESSION["seas_brd_bnch_filter_condition"])>0) {
					$rowID3=$rowID2+1;
				}
				else {
					$rowID3=$rowID2;
				}
				$objWorksheet->mergeCells('A'.$rowID.':A'.$rowID3);
				$objWorksheet->mergeCells('B'.$rowID.':B'.$rowID3);
				$objWorksheet->mergeCells('C'.$rowID.':C'.$rowID3);
				if($_SESSION["seas_brd_filter_topic"]!=99) {
					$objWorksheet->setCellValue('A'.$rowID,$alpha[$lnCount]);
				}
				if($QD[0]!=$language_array['qes_gen_1'] && $QD[0]!=$language_array['qes_gen_2']) {
					if($_SESSION["seas_brd_filter_topic"]!=99) {
						$Q_d = ${"Q". $_SESSION["seas_brd_filter_topic"] ."_".$alpha[$lnCount]};
					}
					else {
						$qdx = explode(".",$QD[0]);
						$Q_d = array(0,0,${$qdx[0]."_S_Avg"},${$qdx[0]."_C_Avg"},0,0,0,0,0,${$qdx[0]."_S_Avg2"},${$qdx[0]."_C_Avg2"}); 	
					}
				}
				else {
					if($_SESSION["seas_brd_filter_topic"]!=99) {
						$Q_d = array(0,0,${"Q". $_SESSION["seas_brd_filter_topic"] ."_S_Avg"},${"Q". $_SESSION["seas_brd_filter_topic"] ."_C_Avg"},0,0,0,0,0,${"Q". $_SESSION["seas_brd_filter_topic"] ."_S_Avg2"},${"Q". $_SESSION["seas_brd_filter_topic"] ."_C_Avg2"}); 
					}
					else {
						$Q_d = array(0,0,${"Overall_S_Avg"},${"Overall_C_Avg"},0,0,0,0,0,${"Overall_S_Avg2"},${"Overall_C_Avg2"}); 
					}
				}

				$gp=createGraph($Q_d,2);
				$objDrawing = new PHPExcel_Worksheet_Drawing();
				$objDrawing->setName('GP1');
				$objDrawing->setDescription('');
				$logo = $gp; // Provide path to your logo file
				$objDrawing->setPath($gp);  //setOffsetY has no effect
				$objDrawing->setCoordinates('C'.$rowID);
				$objDrawing->setHeight(53); // logo height
				$objDrawing->setResizeProportional(true);		
				$objDrawing->setWorksheet($objPHPExcel->getActiveSheet()); 
				// This is the "magic" formula
				$maxWidth = 370;
				if(strlen($_SESSION["seas_brd_bnch_filter_condition"])>0) {
					$maxHeight = 65;	
				}
				else {
					$maxHeight = 55;
				}
				
				$offsetX =$maxWidth - $objDrawing->getWidth();
				$objDrawing->setOffsetX($offsetX);
				$offsetY =$maxHeight - $objDrawing->getHeight();
				$objDrawing->setOffsetY($offsetY);
			//}
			
			// Chart Data
			if($_SESSION["seas_brd_filter_topic"]!=99) {
				$objWorkSheet2->setCellValue('A'.$rowID_CD,strtoupper($alpha[$lnCount]) . ". ".$QD[0]);
			}
			else {
				$objWorkSheet2->setCellValue('A'.$rowID_CD,$QD[0]);	
			}
			if($_SESSION["seas_brd_language"]==2) {	
				$style = array(
					'font' => array('bold' => false, 'size' => 9,'name' => 'Verdana'),
					'alignment' => array('horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_RIGHT,'vertical'=>PHPExcel_Style_Alignment::VERTICAL_CENTER)
				);			
			}
			else {
				$style = array(
					'font' => array('bold' => false, 'size' => 9,'name' => 'Verdana'),
					'alignment' => array('horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_LEFT,'vertical'=>PHPExcel_Style_Alignment::VERTICAL_CENTER)
				);				
			}
			$objWorkSheet2->getStyle('A'.$rowID_CD)->applyFromArray($style);
			$objWorkSheet2->setCellValue('B'.$rowID_CD,round($QD[1],0));
			$objWorkSheet2->setCellValue('C'.$rowID_CD,round($QD[3],0));
			$objWorkSheet2->setCellValue('D'.$rowID_CD,round($QD[9],0));
			if($usr_opts[5]==1) {
				$objWorkSheet2->setCellValue('E'.$rowID_CD,round($QD[7],0));
			}
			else {
				$objWorkSheet2->setCellValue('E'.$rowID_CD,round($QD[7]*-1,0));	
			}
			$objWorkSheet2->setCellValue('F'.$rowID_CD,round($QD[5],0));
			// End Chart Data
	
	
	
			
			// Chart Data for BenchMark
			if(strlen($_SESSION["seas_brd_bnch_filter_condition"])>0) {
				$rowID_CD++;
				if($_SESSION["seas_brd_filter_topic"]!=99) {
					$objWorkSheet2->setCellValue('A'.$rowID_CD,strtoupper($alpha[$lnCount]) . ". " . $language_array['benchmark']);
				}
				else {
					$qr = explode(".",$QD[0]);
					$objWorkSheet2->setCellValue('A'.$rowID_CD,$qr[0]. ". ". $language_array['benchmark']);	
				}
				if($_SESSION["seas_brd_language"]==2) {	
					$style = array(
						'font' => array('bold' => false, 'size' => 9,'name' => 'Verdana'),
						'alignment' => array('horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_RIGHT,'vertical'=>PHPExcel_Style_Alignment::VERTICAL_CENTER)
					);			
				}
				else {
					$style = array(
						'font' => array('bold' => false, 'size' => 9,'name' => 'Verdana'),
						'alignment' => array('horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_LEFT,'vertical'=>PHPExcel_Style_Alignment::VERTICAL_CENTER)
					);				
				}
				$objWorkSheet2->getStyle('A'.$rowID_CD)->applyFromArray($style);
				$objWorkSheet2->setCellValue('B'.$rowID_CD,round($QD[11],0));
				$objWorkSheet2->setCellValue('C'.$rowID_CD,round($QD[12],0));
				$objWorkSheet2->setCellValue('D'.$rowID_CD,round($QD[15],0));
				if($usr_opts[5]==1) {
					$objWorkSheet2->setCellValue('E'.$rowID_CD,round($QD[14],0));
				}
				else {
					$objWorkSheet2->setCellValue('E'.$rowID_CD,round($QD[14]*-1,0));	
				}
				$objWorkSheet2->setCellValue('F'.$rowID_CD,round($QD[13],0));
			}
			// End Chart Data for benchmark
	
	
	
	
	
	
		//}
		//else {
		//	$rowID2=$rowID;	
		//}
		
		//if($_SESSION["seas_brd_filter_topic"]!=99) {
			$objWorksheet->setCellValue('B'.$rowID,$QD[0]);
			$objWorksheet->setCellValue('E'.$rowID,$QD[1]);
			$objWorksheet->setCellValue('F'.$rowID,$QD[3]);
			$objWorksheet->setCellValue('G'.$rowID,$QD[9]);
			$objWorksheet->setCellValue('H'.$rowID,$QD[7]);
			$objWorksheet->setCellValue('I'.$rowID,$QD[5]);
		
			$objWorksheet->getRowDimension($rowID)->setRowHeight(22);
			$objWorksheet->getRowDimension($rowID2)->setRowHeight(22);
			

			if($_SESSION["seas_brd_language"]==2) {
						$style = array(
							'font' => array('bold' => false, 'size' => 9,'name' => 'Verdana'),
							'alignment' => array('horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_RIGHT,'vertical'=>PHPExcel_Style_Alignment::VERTICAL_CENTER),
							'borders' => array('outline' => array('style' => PHPExcel_Style_Border::BORDER_THIN))
						);
			
			}
			else {
						$style = array(
							'font' => array('bold' => false, 'size' => 9,'name' => 'Verdana'),
							'alignment' => array('horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_LEFT,'vertical'=>PHPExcel_Style_Alignment::VERTICAL_CENTER),
							'borders' => array('outline' => array('style' => PHPExcel_Style_Border::BORDER_THIN))
						);
			
			}

			$objWorksheet->getStyle('A'.$rowID.':A'.$rowID3)->applyFromArray($style);
			$objWorksheet->getStyle('B'.$rowID.':B'.$rowID3)->applyFromArray($style);
			$objWorksheet->getStyle('C'.$rowID.':C'.$rowID3)->applyFromArray($style);
			
			$objWorksheet->getStyle('B'.$rowID)->getAlignment()->setWrapText(true);
			
			$style = array(
				'font' => array('bold' => false, 'size' => 9,'name' => 'Verdana'),
				'alignment' => array('horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER,'vertical'=>PHPExcel_Style_Alignment::VERTICAL_CENTER),
				'borders' => array('outline' => array('style' => PHPExcel_Style_Border::BORDER_THIN))
			);
			$objWorksheet->getStyle('D'.$rowID.":D".$rowID3)->applyFromArray($style);
			$objWorksheet->getStyle('E'.$rowID.":E".$rowID3)->applyFromArray($style);
			$objWorksheet->getStyle('F'.$rowID.":F".$rowID3)->applyFromArray($style);
			$objWorksheet->getStyle('G'.$rowID.":G".$rowID3)->applyFromArray($style);
			$objWorksheet->getStyle('H'.$rowID.":H".$rowID3)->applyFromArray($style);
			$objWorksheet->getStyle('I'.$rowID.":I".$rowID3)->applyFromArray($style);
			
			$objWorksheet->setCellValue('D'.$rowID,$language_array['tgt']);
			
			// Bench Mark		
			if(strlen($_SESSION["seas_brd_bnch_filter_condition"])>0) {
				$objWorksheet->setCellValue('E'.$rowID2,$QD[11]);
				$objWorksheet->setCellValue('F'.$rowID2,$QD[12]);
				$objWorksheet->setCellValue('G'.$rowID2,$QD[15]);
				$objWorksheet->setCellValue('H'.$rowID2,$QD[14]);
				$objWorksheet->setCellValue('I'.$rowID2,$QD[13]);
			
				$objWorksheet->getRowDimension($rowID)->setRowHeight(22);
				$objWorksheet->getRowDimension($rowID2)->setRowHeight(22);
				
				$style = array(
					'font' => array('bold' => false, 'size' => 9,'name' => 'Verdana','color' => array('rgb' => '0000ff')),
					'alignment' => array('horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER,'vertical'=>PHPExcel_Style_Alignment::VERTICAL_CENTER)
				);
	
				$objWorksheet->getStyle('E'.$rowID2)->applyFromArray($style);
				$objWorksheet->getStyle('F'.$rowID2)->applyFromArray($style);
				$objWorksheet->getStyle('G'.$rowID2)->applyFromArray($style);
				$objWorksheet->getStyle('H'.$rowID2)->applyFromArray($style);
				$objWorksheet->getStyle('I'.$rowID2)->applyFromArray($style);
				
				$objWorksheet->setCellValue('D'.$rowID2,$language_array['bmk']);
			}
			
			// Index
			//if($QD[0]!="Chapter Overall Average") {
				$objWorksheet->setCellValue('E'.$rowID3, $QD[2] );
				$objWorksheet->setCellValue('F'.$rowID3, $QD[4] );
				$objWorksheet->setCellValue('G'.$rowID3, $QD[10] );
				$objWorksheet->setCellValue('H'.$rowID3, $QD[8] );
				$objWorksheet->setCellValue('I'.$rowID3, $QD[6] );
		
				$style = array(
					'font' => array('bold' => false, 'size' => 8,'name' => 'Verdana','italic' => true,'color' => array('rgb' => '000000')),
					'alignment' => array('horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER,'vertical'=>PHPExcel_Style_Alignment::VERTICAL_CENTER)
				);
				$objWorksheet->getStyle('E'.$rowID3)->applyFromArray($style);
				$objWorksheet->getStyle('F'.$rowID3)->applyFromArray($style);
				$objWorksheet->getStyle('G'.$rowID3)->applyFromArray($style);
				$objWorksheet->getStyle('H'.$rowID3)->applyFromArray($style);
				$objWorksheet->getStyle('I'.$rowID3)->applyFromArray($style);
				
				$objWorksheet->setCellValue('D'.$rowID3,$language_array['idx']);
			//}
			if(strlen($_SESSION["seas_brd_bnch_filter_condition"])>0) {
				$rowID=$rowID+3;
			}
			else {
				$rowID=$rowID+2;
			}
			$lnCount++;
		//}
		
		$rowID_CD++;
		
	}


if($rowID_CD>3 || $_SESSION["seas_brd_filter_topic"]==99) {
		
	$objWorksheet->getRowDimension($rowID)->setRowHeight(40);
	$objWorksheet->mergeCells('A'.$rowID.':I'.$rowID);
	$style = array(
		'font' => array('bold' => true, 'size' => 12,'name' => 'Verdana'),
		'alignment' => array('horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER,'vertical'=>PHPExcel_Style_Alignment::VERTICAL_CENTER)
	);
	$objWorksheet->getStyle('A'.$rowID.':I'.$rowID)->applyFromArray($style);
	$objWorksheet->setCellValue('A'.$rowID,$Question_Labels[$_SESSION["seas_brd_filter_topic"]]);
	$rowID++;


	$dataseriesLabels = array(
		//new PHPExcel_Chart_DataSeriesValues('String', 'ChartData!$B$1', NULL, 1),
		//new PHPExcel_Chart_DataSeriesValues('String', 'ChartData!$C$1', NULL, 1),
		new PHPExcel_Chart_DataSeriesValues('String', 'ChartData!$D$1', NULL, 1),
		new PHPExcel_Chart_DataSeriesValues('String', 'ChartData!$E$1', NULL, 1)
		//new PHPExcel_Chart_DataSeriesValues('String', 'ChartData!$F$1', NULL, 1)
	);
	
	$rowID_CD = $rowID_CD-1;
	$xAxisTickValues = array(
		new PHPExcel_Chart_DataSeriesValues('String', 'ChartData!$A$2:$A$'.$rowID_CD, NULL, $rowID_CD),	//	Jan to Dec
		new PHPExcel_Chart_DataSeriesValues('String', 'ChartData!$A$2:$A$'.$rowID_CD, NULL, $rowID_CD)  //	Jan to Dec
	);
	
	$dataSeriesValues = array(
		//new PHPExcel_Chart_DataSeriesValues('Number', 'ChartData!$B$2:$B$'.$rowID_CD, NULL, $rowID_CD),
		//new PHPExcel_Chart_DataSeriesValues('Number', 'ChartData!$C$2:$C$'.$rowID_CD, NULL, $rowID_CD),
		new PHPExcel_Chart_DataSeriesValues('Number', 'ChartData!$D$2:$D$'.$rowID_CD, NULL, $rowID_CD),
		new PHPExcel_Chart_DataSeriesValues('Number', 'ChartData!$E$2:$E$'.$rowID_CD, NULL, $rowID_CD)
		//new PHPExcel_Chart_DataSeriesValues('Number', 'ChartData!$F$2:$F$'.$rowID_CD, NULL, $rowID_CD)
	);
	
	if($usr_opts[5]==1) {
		$series = new PHPExcel_Chart_DataSeries(
			PHPExcel_Chart_DataSeries::TYPE_RADARCHART,				// plotType
			NULL,													// plotGrouping
			range(0, count($dataSeriesValues)-1),					// plotOrder
			$dataseriesLabels,										// plotLabel
			$xAxisTickValues,										// plotCategory
			$dataSeriesValues,										// plotValues
			NULL,													// smooth line
			PHPExcel_Chart_DataSeries::STYLE_MARKER					// plotStyle
		);
	
		$layout = new PHPExcel_Chart_Layout();
		$plotarea = new PHPExcel_Chart_PlotArea($layout, array($series));
		$legend = new PHPExcel_Chart_Legend(PHPExcel_Chart_Legend::POSITION_RIGHT, NULL, false);
		$title = new PHPExcel_Chart_Title('');
	}
	else {
		//	Build the dataseries
		$series = new PHPExcel_Chart_DataSeries(
			PHPExcel_Chart_DataSeries::TYPE_BARCHART,		// plotType
			PHPExcel_Chart_DataSeries::GROUPING_STACKED,	// plotGrouping
			range(0, count($dataSeriesValues)-1),			// plotOrder
			$dataseriesLabels,								// plotLabel
			$xAxisTickValues,								// plotCategory
			$dataSeriesValues								// plotValues
		);
		//	Set additional dataseries parameters
		//		Make it a vertical column rather than a horizontal bar graph
		$series->setPlotDirection(PHPExcel_Chart_DataSeries::DIRECTION_COL);
		$layout1 = new PHPExcel_Chart_Layout(); 
		$layout1->setShowVal(TRUE);                   
		
		//	Set the series in the plot area
		$plotarea = new PHPExcel_Chart_PlotArea($layout1, array($series));
		//	Set the chart legend
		$legend = new PHPExcel_Chart_Legend(PHPExcel_Chart_Legend::POSITION_RIGHT, NULL, false);
		$title = new PHPExcel_Chart_Title('');
	}

	
	$chart = new PHPExcel_Chart(
		'chart1',		// name
		$title,			// title
		$legend,		// legend
		$plotarea,		// plotArea
		true,			// plotVisibleOnly
		0,				// displayBlanksAs
		NULL,			// xAxisLabel
		NULL			// yAxisLabel		- Radar charts don't have a Y-Axis
	);
	
	//	Set the position where the chart should appear in the worksheet
	$chart->setTopLeftPosition('A'.$rowID );
	$botPos= $rowID+40;
	$chart->setBottomRightPosition('J'.$botPos);
	
	//	Add the chart to the worksheet
	$objWorksheet->addChart($chart);

}


if($usr_opts[0]==0) {
	$objWorksheet->getColumnDimension('D')->setVisible(false);
}
if($usr_opts[1]==0) {
	$objWorksheet->getColumnDimension('E')->setVisible(false);
}
if($usr_opts[2]==0) {
	$objWorksheet->getColumnDimension('F')->setVisible(false);
}
if($usr_opts[3]==0) {
	$objWorksheet->getColumnDimension('G')->setVisible(false);
}
if($usr_opts[4]==0) {
	$objWorksheet->getColumnDimension('H')->setVisible(false);
}

if($_SESSION["seas_brd_language"]==2) {
	$objWorksheet->setRightToLeft(true);
	$objWorkSheet2->setRightToLeft(true);
}

// Save Excel and Output to Browser

$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');
$objWriter->setIncludeCharts(TRUE);
header('Content-type: application/vnd.ms-excel');
header('Content-Disposition: attachment; filename="PCD.xlsx"');
$objWriter->save('php://output');
//$objWriter->save(str_replace(__FILE__,'pcd/graphs/PCD.xlsx',__FILE__));


//***** TEST SCRIPTS ************//

// Create link to Download
/*
echo "<table height='180px' border=0 align='center'><tr><td align='center'>";
echo "<a href='pcd/graphs/PCD.xlsx' style='text-decoration:none;font-family:Verdana, Geneva, sans-serif; font-size:16px' ><< Download >></a>";
echo "</td></tr></table>";
*/

/*
 $objPHPExcel->getActiveSheet()->SetCellValue('A'.$rowCount, $row['name']);
 $ews->fromArray($data, ' ', 'A2');

 http://www.sitepoint.com/generate-excel-files-charts-phpexcel/
***
  
$ews2->setCellValue('a1', 'Lakers 2013-2014 Season');

**
$style = array(
    'font' => array('bold' => true, 'size' => 20,),
    'alignment' => array('horizontal' => \PHPExcel_Style_Alignment::HORIZONTAL_LEFT,),
);
$ews2->mergeCells('a1:b1');
$ews2->getStyle('a1')->applyFromArray($style);
$ews2->getColumnDimension('a')->setAutoSize(true);
**
$header = 'a1:h1';
$ews->getStyle($header)->getFill()->setFillType(\PHPExcel_Style_Fill::FILL_SOLID)->getStartColor()->setARGB('00ffff00');
$style = array(
    'font' => array('bold' => true,),
    'alignment' => array('horizontal' => \PHPExcel_Style_Alignment::HORIZONTAL_CENTER,),
    );
$ews->getStyle($header)->applyFromArray($style);

*/
?>