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 : 52.14.176.111
<?php
// error_reporting(E_ALL & ~E_NOTICE);
// ob_start();
$main_src = substr($_SERVER['SCRIPT_FILENAME'], 0, strlen($_SERVER['SCRIPT_FILENAME']) - 7);
$pdf_writer_class = $main_src . "/tcpdf/tcpdf.php";
require_once $pdf_writer_class;
ini_set('memory_limit', '900M');
ini_set('max_execution_time', 0);
class MYPDF extends TCPDF
{
public function Header()
{
// get the current page break margin
$bMargin = $this->getBreakMargin();
// get current auto-page-break mode
$auto_page_break = $this->AutoPageBreak;
// disable auto-page-break
$this->SetAutoPageBreak(false, 0);
$this->SetTitle("ApplicationReport");
// set bacground image
$this->SetFillColor(248, 248, 255);
$img_path = $this->aobj_context->main_src . "img/".$this->aobj_context->FUNIVCODE."_logo.jpg";
if (file_exists($img_path)) {
$this->Image($img_path, 6, 6, 20, 20);
}
$img_path1 = $this->aobj_context->main_src . "img/".$this->aobj_context->FUNIVCODE."_logo_2.jpeg";
//var_dump($img_path);
if (file_exists($img_path1)) {
$this->Image($img_path1, 182, 6, 20, 20);
}
$this->SetFont('Times', 'B', 13);
$this->SetY(5);
//var_dump($this->aobj_context->fmeritdesc);
$this->Cell(0, 4, $this->aobj_context->FUNIVNAME, 0, 1, 'C');
//state
$this->SetFont('Times', '', 11);
$this->Cell(0, 4, $this->aobj_context->s_state, 0, 1, 'C');
$this->SetFont('Times', 'BU', 12);
$this->Cell(0, 5, 'PG Admissions 2021-22', '0', 1, 'C');
$this->SetFont('Times', 'B', 12);
$this->Cell(0, 5, $this->aobj_context->fmeritdesc, '0', 1, 'C');
$this->ln(3);
$this->SetFont('Times', 'B', 12);
$this->SetAutoPageBreak($auto_page_break, $bMargin);
}
public function Footer()
{
$this->SetY(-20);
$this->SetFont('helvetica', 'I', 8);
// var_dump();
if($this->CurOrientation == 'P')
{
$this->Cell(60, 10, 'Date : ' . date("d-m-Y h:i:s A"), 0, 0, 'L');
$this->Cell(60, 10, 'Page ' . $this->getPageNumGroupAlias() . '/' . $this->getPageGroupAlias(), 0, 0, 'C');
$this->Cell(60, 10, 'Dept. Head Sign(with Seal) ', 0, 1, 'R');
$this->MultiCell(0,7,"The merit number allotted to the candidates whose hard copy of marks cards is not received by the Department is provisional and final ranking may vary based on verification of documents.",0,'L');
}
else {
$this->Cell(60, 10, 'Date : ' . date("d-m-Y h:i:s A"), 0, 0, 'L');
$this->Cell(60, 10, 'Page ' . $this->getPageNumGroupAlias() . '/' . $this->getPageGroupAlias(), 0, 0, 'C');
$this->Cell(60, 10, 'Dept. Head Sign(with Seal) ', 0, 1, 'R');
}
}
}
class ReprtObject
{
public function DefaultConstructor($aobj_context)
{
$this->aobj_context = $aobj_context;
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$this->ip = $_SERVER["REMOTE_ADDR"];
$get_date = "select DATE_FORMAT(now(), '%d/%m/%Y') as now_date";
$obj = $this->aobj_context->mobj_db->GetRow($get_date);
$this->reportType = $aobj_context->mobj_data["rtype"];
$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 = $this->aobj_context->mobj_db->GetRow($get_coll_name);
// var_dump($get_coll_name);
$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'];
$this->current_date = $obj['now_date'];
$deggrp = $this->aobj_context->mobj_data["deggrp"];
$this->pdf = new MYPDF('P');
$this->pdf->aobj_context = $aobj_context;
}
public function Header($pdf,$descpn,$degtype, $merit)
{
$pdf->SetFont('Times', 'B', 12);
if($merit == 'RC') {
$pdf->Cell(0, 5, 'RCU Students', '0', 1, 'C');
} else if($merit == 'AT' ){
$pdf->Cell(0, 5, 'RCU Student (Autonomous College)', '0', 1, 'C');
} else if($merit == 'KN' ){
$pdf->Cell(0, 5, 'Other University Students (Within Karnataka)', '0', 1, 'C');
} else if($merit == 'NK' ){
$pdf->Cell(0, 5, 'Other University Students (Outside Karnataka)', '0', 1, 'C');
}
// var_dump($degtype);
if($degtype =='T')
$pdf->Cell(0, 5, '(Merit List based on Core / Optional Aggregate)', '0', 1, 'C');
else
$pdf->Cell(0, 5, '(Merit List based on Total Aggregate)', '0', 1, 'C');
$pdf->Cell(0, 5, $descpn, '0', 1, 'C');
$pdf->ln(1);
$pdf->SetFont('Times', 'B', 10);
$pdf->Cell(10, 5, "Sl.", "LTR", 0, "C");
$pdf->Cell(10, 5, "Merit", "LTR", 0, "C");
$pdf->Cell(27, 5, "App. ", "LTR", 0, "C");
$pdf->Cell(65, 5, "Name", "LTR", 0, "C");
$pdf->Cell(18, 5, "DOB", "LTR", 0, "C");
$pdf->Cell(12, 5, "Cat.", "LRT", 0, "C");
if($this->fmeritopt == 'T') {
$pdf->Cell(12, 5, "Opt.", "LRT", 0, "C");
}else {
$pdf->Cell(12, 5, "Tot.", "LRT", 0, "C");
}
$pdf->Cell(43, 5, "Remarks", "LRT", 1, "C");
$pdf->Cell(10, 5, "No.", "LBR", 0, "C");
$pdf->Cell(10, 5, "No.", "LBR", 0, "C");
$pdf->Cell(27, 5, "Number", "LBR", 0, "C");
$pdf->Cell(65, 5, "", "LBR", 0, "C");
$pdf->Cell(18, 5, "", "LBR", 0, "C");
$pdf->Cell(12, 5, "", "LBR", 0, "C");
// $pdf->Cell(12, 5, "Agg. %", "LBR", 0, "C");
$pdf->Cell(12, 5, "Agg. %", "LBR", 0, "C");
$pdf->Cell(43, 5, "", "LBR", 1, "C");
}
public function Report($data, $merit)
{
$pdf = $this->pdf;
$pdf->SetMargins(07, 27);
$pdf->startPageGroup();
//$pdf->AddPage("P");
$pdf->SetFont('Times', '', 10);
$oldCode = "";
$newCode = "";
$sl_no = 1;
$first = true;
$j = 0;
$i = 0;
// $fmeritopt = $data[0]['fmeritopt'];
$this->fmeritopt = $data[0]['fmeritopt'];
// $this->fmerittype = $merit;
foreach ($data as $key => $value) {
$newCode = $value['fdegree'];
$degname = $value['fdescpn'];
$fmeritopt = $value['fmeritopt'];
if($oldCode != $newCode)
{
$pdf->AddPage("P");
//$pdf->SetMargins(07, 32);
$this->Header($pdf,$degname,$fmeritopt, $merit);
$sl_no = 1;
}
$pdf->SetFont('Times', '', 10);
$remarks = "";
if($value['fremarks'] != '' && $value['fstatus'] == 'Rejected')
$remarks = $value['fstatus']." (".$value['fremarks'].")";
else if($value['fremarks'] == '' && $value['fstatus'] == 'Rejected')
$remarks = $value['fstatus'];
else
$remarks = $value['fremarks'];
$y1 = $pdf->getY();
$x = $pdf->getX();
$pdf->setXY($x+154,$y1);
$pdf->MultiCell(43,7, $remarks, "1","L");
$y2 = $pdf->getY();
$h = ($y2-$y1);
//$h=10;
$pdf->setXY($x,$y1);
$pdf->Cell(10, $h, $sl_no, "1", 0, "C");
$pdf->Cell(10, $h, $value['frank'], "1", 0, "C");
$pdf->Cell(27, $h, $value['fappno'], "1", 0, "C");
$pdf->Cell(65, $h, $value['fname'], "1", 0, "L");
// $pdf->setXY($x+120,$y1);
$pdf->Cell(18, $h, $value['fdob'], "1", 0, "C");
$pdf->Cell(12, $h, $value['fcategory'], "1", 0, "C");
if($this->fmeritopt == 'T') {
$pdf->Cell(12, $h, $value['foptper'], "1", 1, "C");
}
else {
$pdf->Cell(12, $h, $value['ftotper'], "1", 1, "C");
}
$y1 = $pdf->getY();
$x = $pdf->getX();
$pdf->setXY($x,$y1);
//$pdf->Cell(22, $h, $value['fremarks'], "1", 1, "C");
$sl_no++;
$i++;
$oldCode = $value['fdegree'];
if(($i%20)==0)
{
$pdf->AddPage("P");
//$pdf->SetMargins(07, 32);
$this->Header($pdf,$degname,$fmeritopt, $merit);
$pdf->SetFont('Times', '', 10);
}
// var_dump($newCode,$oldCode);
}
//$table6 .= '</table>';
//$pdf->SetX(11);
//$pdf->writeHTML($table6, true, false, true, false, 'L');
}
public function SendOutput()
{
// ob_end_clean();
$this->pdf->Output("Merit_List.pdf", "D");
}
}
function Rcub_MeritList($aobj_context)
{
$fdegree = $aobj_context->mobj_data["fdegree"];
$query = "select fmeritdesc from entdeg where fdegree = '{$fdegree}'";
$res = $aobj_context->mobj_db->GetRow($query);
$fmeritdesc = $res['fmeritdesc'];
$aobj_context->fmeritdesc = $fmeritdesc;
$class_obj = new ReprtObject();
$class_obj->univcode = $univcode;
$class_obj->DefaultConstructor($aobj_context);
$query = "select concat(deg.fprefix,s.fappno) as fappno,d.fdegree,deg.fdescpn,left(s.fname,25) as fname,
DATE_FORMAT(s.fdob, '%d/%m/%Y') as fdob,
IF( IFNULL(fcategory,'') = '', 'GM', fcategory) as fcategory,
ifnull(fremarks,'') as fremarks,
d.fstatus,
d.ftotper,d.foptper,
d.frank,fstatus,deg.fmeritopt, d.fmerittype
from entstudadm s inner join entoptdeg d on d.fappno = s.fappno
inner join entdeg deg on d.fdegree = deg.fdegree
where IFNULL(fpaystatus,'') = 'success'
and d.fdegree = '{$fdegree}'
and ifnull(s.ffreez,'') <> 'T'
and ifnull(d.fstatus,'') <> ''
and ifnull(d.fmerittype,'') = 'RC'
order by d.fstatus,d.frank,s.fname";
// var_dump($query);
$result = $aobj_context->mobj_db->GetAll($query);
if (count($result) > 0) {
$class_obj->Report($result, 'RC');
}
$query = "select concat(deg.fprefix,s.fappno) as fappno,d.fdegree,deg.fdescpn,left(s.fname,25) as fname,
DATE_FORMAT(s.fdob, '%d/%m/%Y') as fdob,
IF( IFNULL(fcategory,'') = '', 'GM', fcategory) as fcategory,
ifnull(fremarks,'') as fremarks,
d.fstatus,
d.ftotper,d.foptper,
d.frank,fstatus,deg.fmeritopt, d.fmerittype
from entstudadm s inner join entoptdeg d on d.fappno = s.fappno
inner join entdeg deg on d.fdegree = deg.fdegree
where IFNULL(fpaystatus,'') = 'success'
and d.fdegree = '{$fdegree}'
and ifnull(s.ffreez,'') <> 'T'
and ifnull(d.fstatus,'') <> ''
and ifnull(d.fmerittype,'') = 'AT'
order by d.fstatus,d.frank,s.fname";
// var_dump($query);
$result = $aobj_context->mobj_db->GetAll($query);
if (count($result) > 0) {
$class_obj->Report($result, 'AT');
}
$query = "select concat(deg.fprefix,s.fappno) as fappno,d.fdegree,deg.fdescpn,left(s.fname,25) as fname,
DATE_FORMAT(s.fdob, '%d/%m/%Y') as fdob,
IF( IFNULL(fcategory,'') = '', 'GM', fcategory) as fcategory,
ifnull(fremarks,'') as fremarks,
d.fstatus,
d.ftotper,d.foptper,
d.frank,fstatus,deg.fmeritopt, d.fmerittype
from entstudadm s inner join entoptdeg d on d.fappno = s.fappno
inner join entdeg deg on d.fdegree = deg.fdegree
where IFNULL(fpaystatus,'') = 'success'
and d.fdegree = '{$fdegree}'
and ifnull(s.ffreez,'') <> 'T'
and ifnull(d.fstatus,'') <> ''
and ifnull(d.fmerittype,'') = 'KN'
order by d.fstatus,d.frank,s.fname";
// var_dump($query);
$result = $aobj_context->mobj_db->GetAll($query);
if (count($result) > 0) {
$class_obj->Report($result, 'KN');
}
$query = "select concat(deg.fprefix,s.fappno) as fappno,d.fdegree,deg.fdescpn,left(s.fname,25) as fname,
DATE_FORMAT(s.fdob, '%d/%m/%Y') as fdob,
IF( IFNULL(fcategory,'') = '', 'GM', fcategory) as fcategory,
ifnull(fremarks,'') as fremarks,
d.fstatus,
d.ftotper,d.foptper,
d.frank,fstatus,deg.fmeritopt, d.fmerittype
from entstudadm s inner join entoptdeg d on d.fappno = s.fappno
inner join entdeg deg on d.fdegree = deg.fdegree
where IFNULL(fpaystatus,'') = 'success'
and d.fdegree = '{$fdegree}'
and ifnull(s.ffreez,'') <> 'T'
and ifnull(d.fstatus,'') <> ''
and ifnull(d.fmerittype,'') = 'NK'
order by d.fstatus,d.frank,s.fname";
// var_dump($query);
$result = $aobj_context->mobj_db->GetAll($query);
if (count($result) > 0) {
$class_obj->Report($result, 'NK');
}
$class_obj->SendOutput();
// ob_start();
// ob_end_flush();
}
|