0xV3NOMx
Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64



Your IP : 18.189.192.214


Current Path : /proc/thread-self/root/var/www/oasis/Report_details/
Upload File :
Current File : //proc/thread-self/root/var/www/oasis/Report_details/report_copoMarksList.php

<?php
$main_src = substr($_SERVER['SCRIPT_FILENAME'], 0, strlen($_SERVER['SCRIPT_FILENAME']) - 7);
error_reporting(E_ALL);
ini_set('display_errors', TRUE);
ini_set('display_startup_errors', TRUE);
date_default_timezone_set('GMT+5:30');
ini_set('max_execution_time', 300);
ini_set('memory_limit', '2G');

if (PHP_SAPI == 'cli')
    die('This example should only be run from a Web Browser');

/** Include PHPExcel */
$pdf_writer_class = $main_src . '/PHPExcel/Classes/PHPExcel.php';
require_once($pdf_writer_class);

function getheaders($objPHPExcel, $fileName)
{
    // To Fit To Page while printing
    ini_set('max_execution_time', '300');
    $objPHPExcel->getActiveSheet()->getPageSetup()->setRowsToRepeatAtTopByStartAndEnd(1);
    $objPHPExcel->getActiveSheet()->getPageSetup()->setFitToWidth(1);
    $objPHPExcel->getActiveSheet()->getPageSetup()->setFitToHeight(0);
    $objPHPExcel->getActiveSheet()->getPageSetup()->setHorizontalCentered(true);
    $objPHPExcel->getActiveSheet()->getPageSetup()->setVerticalCentered(false);

    // Redirect output to a client’s web browser (Excel5)
    header('Content-Type: application/vnd.ms-excel');
    header('Content-Disposition: attachment;filename=' . $fileName);
    header('Cache-Control: max-age=0');
    // If you're serving to IE 9, then the following may be needed
    header('Cache-Control: max-age=1');
    // If you're serving to IE over SSL, then the following may be needed
    header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); // Date in the past
    header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); // always modified
    header('Cache-Control: cache, must-revalidate'); // HTTP/1.1
    header('Pragma: public'); // HTTP/1.0
    ob_clean();
    $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');
    $objWriter->save('php://output');
}

function reportCOPOMarksList($aobj_context)
{
	$collcode=$_SESSION['collcode'];
	$funivcode=$_SESSION['univcode'];
	$degree=$aobj_context->mobj_data['degree'];
	$examno=$aobj_context->mobj_data['examno'];
	$subcode=$aobj_context->mobj_data['subject'];

    $main_src_obj=(explode("/",$_SERVER["REQUEST_URI"]));
    $main_src=$main_src_obj[1];
    $pdf_writer_class=$aobj_context->main_src."/maya-pdf/fpdf.php";
    $root_pdf_file_download=$aobj_context->main_src."/Report_details/output/report_me_student_list.pdf";
	
	include($pdf_writer_class);	
    $objPHPExcel = new PHPExcel();
    $fileName ="CoPo MarksList.xls";
  
    $objPHPExcel->getProperties()->setCreator("Uniclare")
    ->setLastModifiedBy("Me")->setTitle("My Excel Sheet")
    ->setSubject("My Excel Sheet")->setDescription("Excel Sheet")
    ->setKeywords("Excel Sheet")->setCategory("Me");
    
    $objPHPExcel->setActiveSheetIndex(0);
    $styleArray = array(
        'borders' => array(
            'allborders' => array(
                'style' => PHPExcel_Style_Border::BORDER_THIN,
                'color' => array('argb' => '000000'),
            ),
        ),
    );
	$headerStyle = [
		'font' => [
			'bold' => true,
			'size' => 12, 
		],
		'alignment' => [
			'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER,
			'vertical' => PHPExcel_Style_Alignment::VERTICAL_CENTER,
		],
	];

	$beta = ['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',
			 'AA', 'AB', 'AC', 'AD', 'AE', 'AF', 'AG', 'AH', 'AI', 'AJ', 'AK', 'AL', 'AM', 'AN', 'AO', 'AP', 'AQ', 'AR', 'AS', 'AT', 'AU', 'AV', 'AW', 'AX', 'AY', 'AZ',
			 'BA', 'BB', 'BC', 'BD', 'BE', 'BF', 'BG', 'BH', 'BI', 'BJ', 'BK', 'BL', 'BM', 'BN', 'BO', 'BP', 'BQ', 'BR', 'BS', 'BT', 'BU', 'BV', 'BW', 'BX', 'BY', 'BZ',
			 'CA', 'CB', 'CC', 'CD', 'CE', 'CF', 'CG', 'CH', 'CI', 'CJ', 'CK', 'CL', 'CM', 'CN', 'CO', 'CP', 'CQ', 'CR', 'CS', 'CT', 'CU', 'CV', 'CW', 'CX', 'CY', 'CZ'];

	$query1="SELECT DISTINCT fiasubname,fcsubcode FROM markscopo 
	         WHERE fdegree = '{$degree}' AND fexamno = '{$examno}' AND fsubcode = '{$subcode}' AND fcollcode='{$collcode}'";
	$res1 = $aobj_context->mobj_db->GetAll($query1);
	$sheetIndex = 0;
    foreach ($res1 as $sheet) {
        $fiasubname = $sheet['fiasubname'];
        $fcsubcode = $sheet['fcsubcode'];
        if ($sheetIndex > 0) {
            $objPHPExcel->createSheet();
        }
        $objPHPExcel->setActiveSheetIndex($sheetIndex);
        $objPHPExcel->getActiveSheet()->setTitle(substr($fiasubname, 0, 31)); 

		$page_header_university = "select FUNIVNAME as 'FUNIVNAME',FUNIVCODE,
		FUNIVADD1 as 'state', pdf_logo_path,
		ifnull(FEXAMAPPREQ,'F') as FEXAMAPPREQ From control";
		$lobj_page_header_university = $aobj_context->mobj_db->GetRow($page_header_university);
		$get_coll_name = "select fcollname as FCOLLNAME, ftown as FTOWN from college 
		where fcollcode = '{$collcode}'";
		$res_coll_name = $aobj_context->mobj_db->GetRow($get_coll_name);

		$FUNIVNAME = $lobj_page_header_university['FUNIVNAME'];
		$STATE = $lobj_page_header_university['state'];
		$objPHPExcel->getActiveSheet()->getStyle('1:10')->getFont()->setBold(true);
		$objPHPExcel->getActiveSheet()->getStyle('1:1')->getFont()->setSize(18);
		$objPHPExcel->getActiveSheet()->getStyle('2:2')->getFont()->setSize(18);
		$objPHPExcel->getActiveSheet()->getStyle('3:3')->getFont()->setSize(14);
		$objPHPExcel->getActiveSheet()->getStyle('4:4')->getFont()->setSize(13);
		$objPHPExcel->getActiveSheet()->getStyle('7:10')->getFont()->setSize(13);

		$que="SELECT fsubname FROM subject WHERE CONCAT(fsubcode,fssubcode)='{$subcode}' AND fdegree='{$degree}'";
		$result = $aobj_context->mobj_db->GetRow($que);
		
		$query2="SELECT DISTINCT ftest FROM markscopo
		         WHERE fdegree = '{$degree}' AND fexamno = '{$examno}' AND fsubcode = '{$subcode}' AND fcsubcode = '{$fcsubcode}'";
        $res2 = $aobj_context->mobj_db->GetAll($query2);
		$objPHPExcel->getActiveSheet()->mergeCells('A7:B7');
		$objPHPExcel->getActiveSheet()->mergeCells('A8:B8');
		$objPHPExcel->getActiveSheet()->mergeCells('A9:B9');
		$objPHPExcel->getActiveSheet()->setCellValue('A7', 'Internal Assessment Type');
		$objPHPExcel->getActiveSheet()->setCellValue('A8', 'Question No');
		$objPHPExcel->getActiveSheet()->setCellValue('A9', 'Question-CO No');
		$objPHPExcel->getActiveSheet()->setCellValue('A10', 'Sl.No');
		$objPHPExcel->getActiveSheet()->setCellValue('B10', 'USN/Q.Marks');
		$objPHPExcel->getActiveSheet()->getStyle('B10')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
		for($a=7;$a<11;$a++){
			$objPHPExcel->getActiveSheet()->getStyle('A'.$a)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
		}
		$i=0;
		$j=0;
		$k=2;
	    foreach ($res2 as $test) {
		$query3 = "SELECT DISTINCT fqncode, fqnco, fqnmaxmarks FROM markscopo 
				   WHERE fdegree = '{$degree}' AND fexamno = '{$examno}' AND fsubcode = '{$subcode}' 
				   AND fcsubcode = '{$fcsubcode}' AND ftest='{$test['ftest']}'";
		$res3 = $aobj_context->mobj_db->GetAll($query3);
		$count = count($res3); 
		$startCell = $beta[$k] . '7';
		$endCell = $beta[$k + ($count - 1)] . '7';
		$objPHPExcel->getActiveSheet()->mergeCells("$startCell:$endCell");
		$objPHPExcel->getActiveSheet()->setCellValue($beta[$k] . '7', $test['ftest']);
	    $objPHPExcel->getActiveSheet()->getStyle($startCell)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
		$objPHPExcel->getActiveSheet()->getStyle("$startCell:$endCell")->applyFromArray($headerStyle);

        for($b=1;$b<5;$b++){
			$topRowStart = $beta[$k] . $b;
			$topRowEnd = $beta[$k + ($count-1)] . $b;
			$objPHPExcel->getActiveSheet()->mergeCells("$topRowStart:$topRowEnd");
			$objPHPExcel->getActiveSheet()->setCellValue($beta[$k].'1',"         ". $lobj_page_header_university['FUNIVNAME']);
			$objPHPExcel->getActiveSheet()->setCellValue($beta[$k].'2',"         College -".$res_coll_name['FCOLLNAME']." - ". $lobj_page_header_university['state']);
			$objPHPExcel->getActiveSheet()->setCellValue($beta[$k].'3',"            Degree -".$degree. "      Semester -".$examno );
			$objPHPExcel->getActiveSheet()->setCellValue($beta[$k].'4',"            Subject -".$result['fsubname']);
		 }
		foreach ($res3 as $value) {
			$objPHPExcel->getActiveSheet()->setCellValue($beta[$k] . '8', $value['fqncode']);
			$objPHPExcel->getActiveSheet()->setCellValue($beta[$k] . '9', $value['fqnco']);
			$objPHPExcel->getActiveSheet()->setCellValue($beta[$k] . '10', $value['fqnmaxmarks']);
			for($a=8;$a<11;$a++){
				$objPHPExcel->getActiveSheet()->getStyle($beta[$k].$a)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
			}
			$k++; 
		}
		$query4 = "SELECT fregno, GROUP_CONCAT(fqncode, '-', fqnco, '-', fqnmaxmarks, '-', fqnsecmarks ORDER BY fqncode SEPARATOR '|') AS marks
				   FROM markscopo WHERE fdegree = '{$degree}' AND fexamno = '{$examno}' AND fsubcode = '{$subcode}' 
				   AND fcsubcode = '{$fcsubcode}' AND ftest='{$test['ftest']}' GROUP BY fregno";
		$res4 = $aobj_context->mobj_db->GetAll($query4);
	
		$slno = 1;
		$rowIndex = 11;
		foreach ($res4 as $val) {
			$objPHPExcel->getActiveSheet()->setCellValue("A$rowIndex", $slno);
			$objPHPExcel->getActiveSheet()->setCellValue("B$rowIndex", $val['fregno']);
			$objPHPExcel->getActiveSheet()->getStyle("A$rowIndex")->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
			$objPHPExcel->getActiveSheet()->getStyle("B$rowIndex")->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);

			$split = explode("|", $val['marks']);
			foreach ($split as $v) {
				$splitagain = explode("-", $v);
				foreach ($res3 as $qn) {
					if ($qn['fqncode'] == $splitagain[0]) {
						$columnIndex = array_search($qn['fqncode'], array_column($res3, 'fqncode')) + ($k - $count);
						$objPHPExcel->getActiveSheet()->setCellValue($beta[$columnIndex] . $rowIndex, $splitagain[3]);
						$objPHPExcel->getActiveSheet()->getStyle($beta[$columnIndex] . $rowIndex, $splitagain[3])->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
					}
				}
			}
			$rowIndex++;
			$slno++;
		}
	}
	$sheetIndex++;
	$objPHPExcel->getActiveSheet()->getStyle('A1:'.$beta[$k-1] . ($rowIndex-1))->applyFromArray($styleArray);
	
}
	$objPHPExcel->createSheet();
    $objPHPExcel->setActiveSheetIndex($sheetIndex)->setTitle("IA CO");
	$objPHPExcel->getActiveSheet()->getStyle('1:10')->getFont()->setBold(true);
	$objPHPExcel->getActiveSheet()->getStyle('1:1')->getFont()->setSize(18);
	$objPHPExcel->getActiveSheet()->getStyle('2:2')->getFont()->setSize(18);
	$objPHPExcel->getActiveSheet()->getStyle('3:3')->getFont()->setSize(14);
	$objPHPExcel->getActiveSheet()->getStyle('4:4')->getFont()->setSize(13);
	$objPHPExcel->getActiveSheet()->getStyle('7:10')->getFont()->setSize(13);
	$objPHPExcel->getActiveSheet()->mergeCells('A9:B9');
	$objPHPExcel->getActiveSheet()->mergeCells('A10:B10');
	$objPHPExcel->getActiveSheet()->mergeCells('A11:B11');
	$objPHPExcel->getActiveSheet()->mergeCells('A12:B12');
	$objPHPExcel->getActiveSheet()->mergeCells('A13:B13');
	$objPHPExcel->getActiveSheet()->setCellValue('A1',"         ". $lobj_page_header_university['FUNIVNAME']);
	$objPHPExcel->getActiveSheet()->setCellValue('A2', "            College -".$res_coll_name['FCOLLNAME']." - ". $lobj_page_header_university['state']);
	$objPHPExcel->getActiveSheet()->setCellValue('A3', "            Degree -".$degree. "      Semester -".$examno );
	$objPHPExcel->getActiveSheet()->setCellValue('A4', "            Subject -".$result['fsubname']);
	$objPHPExcel->getActiveSheet()->setCellValue('A9', 'Course Outcomes');
	$objPHPExcel->getActiveSheet()->setCellValue('A10', 'Component No.');
	$objPHPExcel->getActiveSheet()->setCellValue('A11', 'Max. Marks In Each Componenet');
	$objPHPExcel->getActiveSheet()->setCellValue('A12', 'Target Marks');
	$objPHPExcel->getActiveSheet()->setCellValue('A13', 'Percentage Of Students Meeting The Target');

	$queryIA1 = "SELECT DISTINCT fqnco FROM markscopo 
	             WHERE fdegree='{$degree}' AND fcollcode='{$collcode}' AND fsubcode='{$subcode}' AND fexamno='{$examno}'";
    $resIA1 = $aobj_context->mobj_db->GetAll($queryIA1);
	$a=2;
	function numberToRoman($num) {
		$map = array(
			'I'    => 1, 'IV'   => 4, 'V'    => 5, 'IX'   => 9,
			'X'    => 10, 'XL'  => 40, 'L'   => 50, 'XC'  => 90,
			'C'    => 100, 'CD' => 400, 'D'  => 500, 'CM' => 900,
			'M'    => 1000
		);
		$result = '';
		foreach (array_reverse($map) as $roman => $value) {
			while ($num >= $value) {
				$result .= $roman;
				$num -= $value;
			}
		}
		return $result;
	}
	function roundUp($number, $decimalPlaces) {
		$factor = pow(10, $decimalPlaces);
		return ceil($number * $factor) / $factor;
	}
	$e=0;
	$g=count($resIA1)*3+2;
	$multArr = [];
	$max=[];
	foreach($resIA1 as $cono){
		$queryIA2="SELECT DISTINCT fiasubname FROM markscopo 
		           WHERE fqnco='{$cono['fqnco']}' AND fdegree='{$degree}' AND fcollcode='{$collcode}' AND fsubcode='{$subcode}' AND fexamno='{$examno}'";
		$resIA2 = $aobj_context->mobj_db->GetAll($queryIA2);
		$count = count($resIA2); 
		$startCell = $beta[$a] . '9';
		$endCell = $beta[$a + ($count - 1)] . '9';
		$objPHPExcel->getActiveSheet()->setCellValue($beta[$a] . '9', $cono['fqnco']);
		$objPHPExcel->getActiveSheet()->mergeCells("$startCell:$endCell");
		$objPHPExcel->getActiveSheet()->getStyle($startCell)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
		$objPHPExcel->getActiveSheet()->getStyle("$startCell:$endCell")->applyFromArray($headerStyle);

		$counter = 1;
		$d=0;
		foreach($resIA2 as $component){
			$romanNumber = numberToRoman($counter);
			$objPHPExcel->getActiveSheet()->setCellValue($beta[$a] . '10', $romanNumber);
			$objPHPExcel->getActiveSheet()->getStyle($beta[$a] . '10')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
			
			$queryIA3 = "SELECT DISTINCT fregno,GROUP_CONCAT(fqnco,'*',fiasubname,'*',fqnsecmarks ORDER BY fregno SEPARATOR '|') AS marks 
						 FROM markscopo WHERE fqnco='{$cono['fqnco']}' AND fdegree='{$degree}' AND fcollcode='{$collcode}' 
						 AND fsubcode='{$subcode}' AND fexamno='{$examno}' AND fiasubname='{$component['fiasubname']}'  GROUP BY fregno";
			$resIA3 = $aobj_context->mobj_db->GetAll($queryIA3);
			$slno = 1;
		    $rowIndex1 = 14;
			$highestSum=0;	
			$highestSumArray = [];
			$arrSum=[];
			$arrhighest = [];
		    foreach($resIA3 as $value){
				$objPHPExcel->getActiveSheet()->setCellValue("A$rowIndex1", $slno);
				$objPHPExcel->getActiveSheet()->setCellValue("B$rowIndex1", $value['fregno']);
				$objPHPExcel->getActiveSheet()->getStyle("A$rowIndex1")->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
				$objPHPExcel->getActiveSheet()->getStyle("B$rowIndex1")->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);

				$split = explode("|", $value['marks']);
				$sum=0;
				foreach ($split as $v) {
					$splitagain = explode("*", $v);
						if ($component['fiasubname'] == $splitagain[1]) {
							if (isset($splitagain[2])) {
								$sum += (int)$splitagain[2];
							}
						}
				}
				array_push($arrSum,$sum);
				if ($sum > $highestSum) {
					$highestSum = $sum;
				}
				// array_push($arrhighest,$highestSum);
				$objPHPExcel->getActiveSheet()->setCellValue($beta[$a] . $rowIndex1, $sum);
				$objPHPExcel->getActiveSheet()->getStyle($beta[$a] . $rowIndex1)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
				$slno++;
				$rowIndex1++;
				$highestSumArray[] = $highestSum;
		};
			$objPHPExcel->getActiveSheet()->setCellValue($beta[$a] . '11', max($highestSumArray));
		
		/*Target Marks */
			$array=[60,60,60,60,60];
				preg_match_all('/\d+/', max($highestSumArray), $matches);
				$maxArray = $matches[0];
				
			for ($d = 0; $d < count($maxArray); $d++) {
				if (isset($array[$d])) {
					$calculatedValue = ($maxArray[$d] *60) / 100;
				}
			} 
		
			
			  $objPHPExcel->getActiveSheet()->setCellValue($beta[$a] . '12', $calculatedValue);
			  $countAboveCalculatedValue=0;
			  foreach($resIA3 as $value){
				$split = explode("|", $value['marks']);
				$sum=0;
				foreach ($split as $v) {
					$splitagain = explode("*", $v);
						if ($component['fiasubname'] == $splitagain[1]) {
							if (isset($splitagain[2])) {
								$sum += (int)$splitagain[2];
							}
						}
				}
			/*Percentage Of Students Meeting The Target */
				if($sum>$calculatedValue){
					$countAboveCalculatedValue++;
				}
				for ($d = 0; $d < count($array); $d++) {
                   $cal=($countAboveCalculatedValue*100)/60;
				}
				
				$roundedValue = roundUp($cal, 1);
			}
				
			$maxValue = max($highestSumArray);
			array_push($arrhighest, $maxValue);
			array_push($max,$arrhighest[0]);
			
				$arr=[60,20,20,60,20,20,60,20,20,60,20,20,60,20,20];//this format correct
				$count2=count($arrSum);
				$f=$rowIndex1-$count2;
				$groupSize = count($resIA3);
				$groupedTotals = [];
				array_push($multArr, $arrSum);
				// $t=0;
				//  for($d=$t;$d<$count2;$d++){
				// 	$total=$arrSum[$d]*$arr[$e]/10;//instead of 10 its divided by that highest marks like 25
				// 	var_dump($arrSum, 'arrSum,', $arr, '$arr', $d, $e, $f, $g);
				// 	$objPHPExcel->getActiveSheet()->setCellValue($beta[$g]. $f, $total);
				// 		if($d==($count2-1)){
				// 			$g++;
				// 			$e++;
				// 		}
				// 		$f++;
				
				// 	$t++;
				//  }
				//  die();
			  $objPHPExcel->getActiveSheet()->setCellValue($beta[$a] . '13', $roundedValue);
			$a++;
		$counter++;
		}
	}
// var_dump($max);die();
	
	$y=0;
	$x=14;
	$w=1;
	$v=14;
	$z=0;
    $p=0;
	// for ($z=0; $z < count($multArr[0]); $z++) { 
	for ($i=0; $i < count($multArr[0]); $i++) { 
		foreach ($multArr as $key => $value) {
			// var_dump($multArr[$i][$key]);
				$total = ($multArr[$i][$key] * 60) / $max[$p] + ($multArr[$i+1][$key] * 20) /$max[$p+1] + ($multArr[$i+2][$key] * 20) /$max[$p+2] ;
				$grandtotal=roundUp($total, 1);
				$objPHPExcel->getActiveSheet()->setCellValue($beta[$g].$x, $grandtotal);
				$x++;
				$z++;
				$p+=count($resIA2);
		}
		$g++;
		$x = $v;
	}
	

	$b=$a;
	$count1 = 1;
	foreach($resIA2 as $component){
		$romanNumber = numberToRoman($count1);
		$objPHPExcel->getActiveSheet()->setCellValue($beta[$b] . '10', $romanNumber);
		$objPHPExcel->getActiveSheet()->setCellValue('R11', '0.60');
		$objPHPExcel->getActiveSheet()->setCellValue('S11', '0.20');
		$objPHPExcel->getActiveSheet()->setCellValue('T11', '0.20');
		$b++;
		$count1++;
	}
	$c=$a;
	foreach($resIA1 as $cono){
		$count = count($resIA1);
		$objPHPExcel->getActiveSheet()->setCellValue($beta[$c] . '13', $cono['fqnco']);
		$objPHPExcel->getActiveSheet()->mergeCells($beta[$a].'8:'.$beta[$a+($count-1)].'8');
		$objPHPExcel->getActiveSheet()->mergeCells($beta[$a].'9:'.$beta[$a+($count-1)].'9');
		$objPHPExcel->getActiveSheet()->mergeCells('A1:'.$beta[$a+($count-1)].'1');
		$objPHPExcel->getActiveSheet()->mergeCells('A2:'.$beta[$a+($count-1)].'2');
		$objPHPExcel->getActiveSheet()->mergeCells('A3:'.$beta[$a+($count-1)].'3');
		$objPHPExcel->getActiveSheet()->mergeCells('A4:'.$beta[$a+($count-1)].'4');
		$c++;
	}
	$objPHPExcel->getActiveSheet()->mergeCells('C8:'.$beta[$a-1] . '8');
	$objPHPExcel->getActiveSheet()->setCellValue('C8','IA Marks Of Individual Components');
	$objPHPExcel->getActiveSheet()->setCellValue($beta[$a] . '8','Overall CO Computation');
	$objPHPExcel->getActiveSheet()->setCellValue($beta[$a] . '9','Weights Assigned To Each Components');
	
	$objPHPExcel->getActiveSheet()->getStyle('C8')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
	$objPHPExcel->getActiveSheet()->getStyle($beta[$a] . '8')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
   $objPHPExcel->getActiveSheet()->getStyle($beta[$a] . '9')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
   for($z=0;$z<5;$z++){
	$objPHPExcel->getActiveSheet()->getStyle('A'.$z)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
   }
   $objPHPExcel->getActiveSheet()->getStyle('A1:'.$beta[$a+count($resIA1)-1].($rowIndex1-1))->applyFromArray($styleArray);
   $objPHPExcel->getActiveSheet()->getStyle('A1:'.$beta[$a+count($resIA1)-1].'13')->applyFromArray($headerStyle);

  getheaders($objPHPExcel, $fileName);

}

?>