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.188.130.151
<?php
ini_set('max_execution_time', 300);
ini_set('memory_limit','1G');
$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');
// 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 error_data_ssp($aobj_context)
{
$univcode = $aobj_context->mobj_data["univcode"];
$fdeggrpfrom = $aobj_context->mobj_data["fdeggrpfrom"];
$fdeggrpto = $aobj_context->mobj_data["fdeggrpto"];
$fdegfrom = $aobj_context->mobj_data["fdegfrom"];
$fdegto = $aobj_context->mobj_data["fdegto"];
$fexamrange = $aobj_context->mobj_data["fexamrange"];
$fyear = $aobj_context->mobj_data["fyear"];
$fexamtype = $aobj_context->mobj_data["fexamtype"];
$fcollfrom = $aobj_context->mobj_data["fcollfrom"];
$fcollto = $aobj_context->mobj_data["fcollto"];
$objPHPExcel = new PHPExcel();
$fileName = 'SSP ERROR DATA';
$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 = "";
$j=4;
$objPHPExcel->getActiveSheet()->getStyle('1:1')->getFont()->setBold(true);
$objPHPExcel->getActiveSheet()->getStyle('1:1')->getFont()->setSize(12);
$objPHPExcel->getActiveSheet()->freezePane('A2');
$objPHPExcel->getActiveSheet()
->setCellValue('A1', "Sl. No.")
->setCellValue('B1', "Remarks")
->setCellValue('C1', "Year")
->setCellValue('D1', "University Name")
->setCellValue('E1', "funivsspcode")
->setCellValue('F1', "fregno")
->setCellValue('G1', "fname")
->setCellValue('H1', "Father Name")
->setCellValue('I1', "Mother Name")
->setCellValue('J1', "Gender")
->setCellValue('K1', "College Name")
->setCellValue('L1', "FSSPCOLLCODE")
->setCellValue('M1', "FCOLLTYPE")
->setCellValue('N1', "FSSPCOLLTYPE")
->setCellValue('O1', "fdistrictname")
->setCellValue('P1', "FSSPDISTCODE")
->setCellValue('Q1', "ftalukname")
->setCellValue('R1', "FSSPTALUKCODE")
->setCellValue('S1', "FSTUDYMODESSP")
->setCellValue('T1', "fdegreename")
->setCellValue('U1', "fdegree_ssp")
->setCellValue('V1', "fcombname")
->setCellValue('W1', "fcombcode")
->setCellValue('X1', "FSEATTYPESSP")
->setCellValue('Y1', "fayear");
$objPHPExcel->getActiveSheet()->getStyle('A1:Z1')->applyFromArray($styleArray);
$objPHPExcel->getActiveSheet()->getColumnDimension('1')->setAutoSize(true);
$objPHPExcel->getActiveSheet()->getRowDimension('1')->setRowHeight(35);
$objPHPExcel->getActiveSheet()->getStyle('A1:Y1')->getAlignment()->setWrapText(true);
$objPHPExcel->getActiveSheet()->getStyle('A1:Y1')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
$objPHPExcel->getActiveSheet()->getStyle('A1:Y1')->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
//$count=rtrim($count,", ");
$examnos = explode("','", $fexamrange);
$slNo = 2;
$tot = 0;
$tot_rep = 0;
$tot_reg = 0;
$query = "SELECT 'Gender Missing' as Remarks,s.* FROM tmp_ssp s WHERE IFNULL(gender,'') = ''
UNION
SELECT 'SSP talkuk code Missing' as Remarks,s.* FROM tmp_ssp s WHERE IFNULL(FSSPTALUKCODE,'') = ''
UNION
SELECT 'SSP college code Missing' as Remarks,s.* FROM tmp_ssp s WHERE IFNULL(FSSPCOLLCODE,'') = ''
UNION
SELECT 'SSP Dist. code Missing' as Remarks, s.* FROM tmp_ssp s WHERE IFNULL(FSSPDISTCODE,'') = ''
UNION
SELECT 'SSP Study mode code Missing' as Remarks, s.* FROM tmp_ssp s WHERE IFNULL(FSTUDYMODESSP,'') = ''
UNION
SELECT 'SSP Degree code Missing' as Remarks, s.* FROM tmp_ssp s WHERE IFNULL(fdegree_ssp,'') = ''
UNION
SELECT 'SSP combincation code Missing' as Remarks, s.* FROM tmp_ssp s WHERE IFNULL(fcombcode,'') = ''
UNION
SELECT 'SSP college Type Missing' as Remarks, s.* FROM tmp_ssp s WHERE IFNULL(FSEATTYPESSP,'') = ''";
// var_dump($query);
// die();
$result = $aobj_context->pobj_db->GetAll($query);
$tt = 0;
$A1 = 0;
$A2 = 0;
$A3 = 0;
$A4 = 0;
$A5 = 0;
$A6 = 0;
$A7 = 0;
foreach ($result as $key => $value) {
$tt = 0;
$tt += $value['Tot_sem_A'];
$tt += $value['Tot_sem_B'];
$tt += $value['Tot_sem_C'];
$tt += $value['Tot_sem_D'];
$tt += $value['Tot_sem_E'];
$tt += $value['Tot_sem_F'];
// $objPHPExcel->getActiveSheet()->getRowDimension('1')->setRowHeight(29);
$objPHPExcel->getActiveSheet()->setCellValue('A' . $slNo, $slNo -1)->getColumnDimension('A')->setwidth(10);
$objPHPExcel->getActiveSheet()->setCellValue('B' . $slNo, $value['Remarks'])->getColumnDimension('B')->setwidth(50);
$objPHPExcel->getActiveSheet()->setCellValue('C' . $slNo, $value['fyear'])->getColumnDimension('C')->setwidth(10);
$objPHPExcel->getActiveSheet()->setCellValue('D' . $slNo, $value['funivname'])->getColumnDimension('D')->setwidth(50);
$objPHPExcel->getActiveSheet()->setCellValue('E' . $slNo, $value['funivsspcode'])->getColumnDimension('E')->setwidth(10);
$objPHPExcel->getActiveSheet()->setCellValue('F' . $slNo, $value['fregno'])->getColumnDimension('F')->setwidth(10);
$objPHPExcel->getActiveSheet()->setCellValue('G' . $slNo, $value['fname'])->getColumnDimension('G')->setwidth(30);
$objPHPExcel->getActiveSheet()->setCellValue('H' . $slNo, $value['ffatname'])->getColumnDimension('H')->setwidth(30);
$objPHPExcel->getActiveSheet()->setCellValue('I' . $slNo, $value['fmotname'])->getColumnDimension('I')->setwidth(30);
$objPHPExcel->getActiveSheet()->setCellValue('J' . $slNo, $value['gender'])->getColumnDimension('J')->setwidth(10);
$objPHPExcel->getActiveSheet()->setCellValue('K' . $slNo, $value['fcollname'])->getColumnDimension('K')->setwidth(50);
$objPHPExcel->getActiveSheet()->setCellValue('L' . $slNo, $value['FSSPCOLLCODE'])->getColumnDimension('L')->setwidth(20);
$objPHPExcel->getActiveSheet()->setCellValue('M' . $slNo, $value['FCOLLTYPE'])->getColumnDimension('M')->setwidth(20);
$objPHPExcel->getActiveSheet()->setCellValue('N' . $slNo, $value['FSSPCOLLTYPE'])->getColumnDimension('N')->setwidth(10);
$objPHPExcel->getActiveSheet()->setCellValue('O' . $slNo, $value['fdistrictname'])->getColumnDimension('O')->setwidth(30);
$objPHPExcel->getActiveSheet()->setCellValue('P' . $slNo, $value['FSSPDISTCODE'])->getColumnDimension('P')->setwidth(10);
$objPHPExcel->getActiveSheet()->setCellValue('Q' . $slNo, $value['ftalukname'])->getColumnDimension('Q')->setwidth(30);
$objPHPExcel->getActiveSheet()->setCellValue('R' . $slNo, $value['FSSPTALUKCODE'] )->getColumnDimension('R')->setwidth(10);
$objPHPExcel->getActiveSheet()->setCellValue('S' . $slNo, $value['FSTUDYMODESSP'])->getColumnDimension('S')->setwidth(20);
$objPHPExcel->getActiveSheet()->setCellValue('T' . $slNo, $value['fdegreename'])->getColumnDimension('T')->setwidth(30);
$objPHPExcel->getActiveSheet()->setCellValue('U' . $slNo, $value['fdegree_ssp'])->getColumnDimension('U')->setwidth(15);
$objPHPExcel->getActiveSheet()->setCellValue('V' . $slNo, $value['fcombname'])->getColumnDimension('V')->setwidth(15);
$objPHPExcel->getActiveSheet()->setCellValue('W' . $slNo, $value['fcombcode'])->getColumnDimension('W')->setwidth(10);
$objPHPExcel->getActiveSheet()->setCellValue('X' . $slNo, $value['FSEATTYPESSP'])->getColumnDimension('X')->setwidth(10);
$objPHPExcel->getActiveSheet()->setCellValue('Y' . $slNo, $value['fayear'])->getColumnDimension('Y')->setwidth(10);
// $tot += $value['tot_app'];
// $tot_rep += $value['Total_Rep'];
// $tot_reg += $value['Total_Reg'];
$A1 += $value['Tot_sem_A'];
$A2 += $value['Tot_sem_B'];
$A3 += $value['Tot_sem_C'];
$A4 += $value['Tot_sem_D'];
$A5 += $value['Tot_sem_E'];
$A6 += $value['Tot_sem_F'];
$A7 += $tt;
$objPHPExcel->getActiveSheet()->getRowDimension($slNo)->setRowHeight(29);
//$objPHPExcel->getActiveSheet()->getColumnDimension('D')->setwidth(12);
$slNo += 1;
}
// $objPHPExcel->getActiveSheet()->setCellValue('E'.$slNo, moneyFormatIndia($A1));
// $objPHPExcel->getActiveSheet()->setCellValue('F'.$slNo, moneyFormatIndia($A2));
// $objPHPExcel->getActiveSheet()->setCellValue('G'.$slNo, moneyFormatIndia($A3));
// $objPHPExcel->getActiveSheet()->setCellValue('H'.$slNo, moneyFormatIndia($A4));
// $objPHPExcel->getActiveSheet()->setCellValue('I'.$slNo, moneyFormatIndia($A5));
// $objPHPExcel->getActiveSheet()->setCellValue('J'.$slNo, moneyFormatIndia($A6));
// $objPHPExcel->getActiveSheet()->setCellValue('K'.$slNo, moneyFormatIndia($A7));
// $objPHPExcel->getActiveSheet()->getStyle('A'.$slNo.':X'.$slNo)->getFont()->setBold(true);
// $objPHPExcel->getActiveSheet()->getStyle('A'.$slNo.':X'.$slNo)->getFont()->setSize(12);
// $objPHPExcel->getActiveSheet()->mergeCells('A'.$slNo.':D'.$slNo)->setCellValue('A'.$slNo, 'Total');
$objPHPExcel->getActiveSheet()->getRowDimension($slNo)->setRowHeight(29);
$objPHPExcel->getActiveSheet()->getStyle('A1:Z'. $slNo)->applyFromArray($styleArray);
$objPHPExcel->getActiveSheet()->getStyle('A1:Z'. $slNo) ->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
$objPHPExcel->getActiveSheet()->getStyle('A2:A' . $slNo )->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
$objPHPExcel->getActiveSheet()->getStyle('B2:B' . $slNo)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
$objPHPExcel->getActiveSheet()->getStyle('D2:D' . $slNo)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
$objPHPExcel->getActiveSheet()->getStyle('E2:E' . $slNo )->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
// $objPHPExcel->getActiveSheet()->getStyle('F2:F' . $slNo )->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
$objPHPExcel->getActiveSheet()->getStyle('G2:G' . $slNo )->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
$objPHPExcel->getActiveSheet()->getStyle('H2:H' . $slNo )->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
$objPHPExcel->getActiveSheet()->getStyle('I2:I' . $slNo )->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
// $objPHPExcel->getActiveSheet()->getStyle('J2:J' . $slNo )->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
$objPHPExcel->getActiveSheet()->getStyle('K2:K' . $slNo )->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
$objPHPExcel->getActiveSheet()->getStyle('L2:L' . $slNo )->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
$objPHPExcel->getActiveSheet()->getStyle('M2:M' . $slNo )->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
$objPHPExcel->getActiveSheet()->getStyle('N2:N' . $slNo )->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
$objPHPExcel->getActiveSheet()->getStyle('O2:O' . $slNo )->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
$objPHPExcel->getActiveSheet()->getStyle('P2:P' . $slNo )->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
$objPHPExcel->getActiveSheet()->getStyle('Q2:Q' . $slNo )->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
$objPHPExcel->getActiveSheet()->getStyle('R2:R' . $slNo )->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
$objPHPExcel->getActiveSheet()->getStyle('S2:S' . $slNo )->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
$objPHPExcel->getActiveSheet()->getStyle('T2:T' . $slNo )->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
$objPHPExcel->getActiveSheet()->getStyle('U2:U' . $slNo )->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
$objPHPExcel->getActiveSheet()->getStyle('V2:V' . $slNo )->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
$objPHPExcel->getActiveSheet()->getStyle('W2:W' . $slNo )->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
$objPHPExcel->getActiveSheet()->getStyle('X2:X' . $slNo )->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
$objPHPExcel->getActiveSheet()->getStyle('C2:C' . $slNo)->getAlignment()->setWrapText(true);
$objPHPExcel->getActiveSheet()->getStyle('F2:F' . $slNo)->getAlignment()->setWrapText(true);
$objPHPExcel->getActiveSheet()->getStyle('K2:K' . $slNo)->getAlignment()->setWrapText(true);
/*$objPHPExcel->getActiveSheet()->setTitle($fileName);
$objPHPExcel->getActiveSheet()->getPageSetup()
->setOrientation(PHPExcel_Worksheet_PageSetup::ORIENTATION_LANDSCAPE);
$get_coll_name = "select FUNIVNAME as 'FUNIVNAME',FUNIVCODE,
FUNIVADD1 as 'state', pdf_logo_path,
ifnull(FEXAMAPPREQ,'F') as FEXAMAPPREQ From control";
$lobj_get_coll_name = $aobj_context->pobj_db->GetRow($get_coll_name);
// $deggrp = $aobj_context->mobj_data["dgp"];
// $query = "select distinct concat(fexamdate,' ',' Examination') as fexamdate
// from deggrp where fdeggrp = '{$deggrp}'";
// $results = $aobj_context->pobj_db->GetRow($query);
$aobj_context->FUNIVNAME = $lobj_get_coll_name['FUNIVNAME'];
$aobj_context->s_state = $lobj_get_coll_name['state'];
$aobj_context->pdf_logo_path = $lobj_get_coll_name['pdf_logo_path'];
$aobj_context->FUNIVCODE = $lobj_get_coll_name['FUNIVCODE'];
// die();
// $objPHPExcel->getActiveSheet()->getHeaderFooter()->addImage($aobj_context->main_src.'img/'.$aobj_context->FUNIVCODE.'_logo.jpg', PHPExcel_Worksheet_HeaderFooter::IMAGE_HEADER_LEFT);
$objPHPExcel->getActiveSheet()->getHeaderFooter()->setOddHeader('&C&H&"-,Bold"&16' . $aobj_context->FUNIVNAME . "\n" . '&12' . $rtype);
$objPHPExcel->getActiveSheet()->getHeaderFooter()->setOddHeader('&C&H'.$deggrp);
$objPHPExcel->getActiveSheet()->getHeaderFooter()->setOddFooter('&RPage &P of &N');*/
// die();
getheaders($objPHPExcel, $fileName);
}
function ssp_status_report($aobj_context,$univcode)
{
$objPHPExcel = new PHPExcel();
$fileName = 'SSP STATUS REPORT';
$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 = "";
$j=4;
$objPHPExcel->getActiveSheet()->getStyle('1:1')->getFont()->setBold(true);
$objPHPExcel->getActiveSheet()->getStyle('1:1')->getFont()->setSize(12);
$objPHPExcel->getActiveSheet()->freezePane('A2');
$objPHPExcel->getActiveSheet()
->setCellValue('A1', "Sl. No.")
->setCellValue('B1', "FID")
->setCellValue('C1', "University_SSP_Code")
->setCellValue('D1', "COLLEGE_SSP_CODE")
->setCellValue('E1', "COURSE_CODE")
->setCellValue('F1', "Response");
$objPHPExcel->getActiveSheet()->getStyle('A1:F1')->applyFromArray($styleArray);
$objPHPExcel->getActiveSheet()->getColumnDimension('1')->setAutoSize(true);
$objPHPExcel->getActiveSheet()->getRowDimension('1')->setRowHeight(35);
$objPHPExcel->getActiveSheet()->getStyle('A1:F1')->getAlignment()->setWrapText(true);
$objPHPExcel->getActiveSheet()->getStyle('A1:F1')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
$objPHPExcel->getActiveSheet()->getStyle('A1:F1')->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
//$count=rtrim($count,", ");
$examnos = explode("','", $fexamrange);
$slNo = 2;
$tot = 0;
$tot_rep = 0;
$tot_reg = 0;
$query = "SELECT * FROM logisys3_comexam.ssp_bonafide_log where University_SSP_Code = '{$univcode}'";
$result = $aobj_context->pobj_db->GetAll($query);
// var_dump($result);
// die();
$tt = 0;
$A1 = 0;
$A2 = 0;
$A3 = 0;
$A4 = 0;
$A5 = 0;
$A6 = 0;
$A7 = 0;
foreach ($result as $key => $value) {
$tt = 0;
// $objPHPExcel->getActiveSheet()->getRowDimension('1')->setRowHeight(29);
$objPHPExcel->getActiveSheet()->setCellValue('A' . $slNo, $slNo -1)->getColumnDimension('A')->setwidth(10);
$objPHPExcel->getActiveSheet()->setCellValue('B' . $slNo, $value['fid'])->getColumnDimension('B')->setwidth(10);
$objPHPExcel->getActiveSheet()->setCellValue('C' . $slNo, $value['University_SSP_Code'])->getColumnDimension('C')->setwidth(25);
$objPHPExcel->getActiveSheet()->setCellValue('D' . $slNo, $value['COLLEGE_SSP_CODE'])->getColumnDimension('D')->setwidth(25);
$objPHPExcel->getActiveSheet()->setCellValue('E' . $slNo, $value['COURSE_CODE'])->getColumnDimension('E')->setwidth(15);
$objPHPExcel->getActiveSheet()->setCellValue('F' . $slNo, $value['fres'])->getColumnDimension('F')->setwidth(80);
$objPHPExcel->getActiveSheet()->getRowDimension($slNo)->setRowHeight(29);
//$objPHPExcel->getActiveSheet()->getColumnDimension('D')->setwidth(12);
$slNo += 1;
}
$objPHPExcel->getActiveSheet()->getRowDimension($slNo)->setRowHeight(29);
$objPHPExcel->getActiveSheet()->getStyle('A1:F'. $slNo)->applyFromArray($styleArray);
$objPHPExcel->getActiveSheet()->getStyle('A1:F'. $slNo) ->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
$objPHPExcel->getActiveSheet()->getStyle('A2:A' . $slNo )->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
$objPHPExcel->getActiveSheet()->getStyle('B2:B' . $slNo)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
$objPHPExcel->getActiveSheet()->getStyle('D2:D' . $slNo)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
$objPHPExcel->getActiveSheet()->getStyle('E2:E' . $slNo )->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
$objPHPExcel->getActiveSheet()->getStyle('C2:C' . $slNo )->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
// $objPHPExcel->getActiveSheet()->getStyle('C2:C' . $slNo)->getAlignment()->setWrapText(true);
getheaders($objPHPExcel, $fileName);
}
function moneyFormatIndia($num)
{
$explrestunits = "";
if (strlen($num) > 3) {
$lastthree = substr($num, strlen($num) - 3, strlen($num));
$restunits = substr($num, 0, strlen($num) - 3); // extracts the last three digits
$restunits = (strlen($restunits) % 2 == 1) ? "0" . $restunits : $restunits; // explodes the remaining digits in 2's formats, adds a zero in the beginning to maintain the 2's grouping.
$expunit = str_split($restunits, 2);
for ($i = 0; $i < sizeof($expunit); $i++) {
// creates each of the 2's group and adds a comma to the end
if ($i == 0) {
$explrestunits .= (int) $expunit[$i] . ","; // if is first value , convert into integer
} else {
$explrestunits .= $expunit[$i] . ",";
}
}
$thecash = $explrestunits . $lastthree;
} else {
$thecash = $num;
}
return $thecash; // writes the final format where $currency is the currency symbol.
}
|