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.118.162.166
<?php
function getIAPendingDet($aobj_context){
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
// ini_set("memory_limit",-1);
// ini_set('max_execution_time',3300);
$Degree = $aobj_context->mobj_data["Degree"];
$deg = $aobj_context->mobj_data["deg"];
$exam = $aobj_context->mobj_data["exam"];
$rollNofrom = $aobj_context->mobj_data["rollNofrom"];
$rollNoto = $aobj_context->mobj_data["rollNoto"];
$fcollcode = $_SESSION['FCOLLCODE'];
$FCOLLNAME= $FDESCPN= $FEXAMNAME= $FEXAMDATE = "";
// var_dump($fcollcode);
$query = "SELECT stu.fregno,stu.fname,GROUP_CONCAT(sub.fsubshort ,'-',sub.fsubcode) AS subjects, c.fcollcode,c.fcollname, d.fdescpn,d.fexamname,d.fexamdate
FROM marks m
INNER JOIN student stu ON stu.fdegree= m.fdegree AND stu.fcollcode = m.fcollcode AND stu.fregno = m.fregno
INNER JOIN SUBJECT sub ON
sub.fdegree = m.fdegree AND m.fexamno = sub.fexamno AND sub.fcsubcode = m.fsubcode
INNER JOIN degree d ON m.fdegree = d.fdegree AND m.fexamno = d.fexamno
INNER JOIN college c ON stu.fcollcode = c.fcollcode
WHERE sub.fdegree = '${deg}' AND stu.fexamno = '${exam}' AND m.fmarks = '-1' AND c.fcollcode = '${fcollcode}'
GROUP BY fregno";
$result = $aobj_context->mobj_db->GetAll($query);
foreach ($result as $key => $value)
{
$FCOLLNAME = $value['fcollname'];
$FDESCPN = $value['fdescpn'];
$FEXAMNAME = $value['fexamname'];
$FEXAMDATE = $value['fexamdate'];
}
// var_dump($FCOLLNAME,$FDESCPN,$FEXAMNAME,$FEXAMDATE);
$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);
$pdf= new TCPDF();
head($pdf,$aobj_context,$FCOLLNAME,$FDESCPN,$FEXAMNAME,$FEXAMDATE);
tableHeader($pdf);
formdata($pdf,$result,$aobj_context);
// footer($pdf);
$pdf->Output("Student_Wise_IA_Marks_Pending.pdf","D");
}
function head($pdf,$aobj_context,$FCOLLNAME,$FDESCPN,$FEXAMNAME,$FEXAMDATE)
{
$pdf->SetMargins(10, 10);
$pdf->setPrintFooter(false);
$pdf->AddPage('P');
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$exam = $aobj_context->mobj_data["exam"];
$rollNofrom = $aobj_context->mobj_data["rollNofrom"];
$rollNoto = $aobj_context->mobj_data["rollNoto"];
$deg = $aobj_context->mobj_data["deg"];
$query = "SELECT pdf_logo_path,funivadd1,ftown,funivname,funivcode
FROM control";
$result = $aobj_context->mobj_db->GetRow($query);
$FUNIVNAME = $result['funivname'];
$FTOWN = $result['ftown'];
$FUNIVADD1 = $result['funivadd1'];
// $date = $result['DATE'];
$pdf_logo_path=$result['pdf_logo_path'];
// var_dump($FUNIVNAME,$FTOWN,$FUNIVADD1,$date,$pdf_logo_path);
$img_path=$aobj_context->main_src.$pdf_logo_path;
if(!empty($pdf_logo_path) && file_exists($img_path))
{
$pdf->Image($pdf_logo_path,20,20,20);//file x y w h
}
$pdf->SetFont('Times','B',16);
$pdf->setFontStretching(105);
$pdf->setFontSpacing(0.254);
$pdf->cell(0,7,$result['funivname'],"0",1,"C");
// reset font stretching
$pdf->setFontStretching(100);
// reset font spacing
$pdf->setFontSpacing(0);
$pdf->SetFont('Times','',12);
$pdf->Cell(0,7,"".$FUNIVADD1,"0",1,"C");
$pdf->SetFont('Times','BU',12);
$pdf->Cell(0,7,"Student Wise I.A. Marks Pending","0",1,"C");
$pdf->setFontSpacing(0.254);
$pdf->SetFont('Times','',12);
$pdf->Cell(0,6,$_SESSION['FCOLLCODE']." - ".$FCOLLNAME,"0",1,"C");
$pdf->Cell(0,6,"Exam: ".$FEXAMNAME." , ".$FEXAMDATE,"0",1,"C");
$pdf->Cell(0,6,"Degree: ".$deg." - ".$FDESCPN,"0",1,"C");
$pdf->setFontSpacing(0);
$pdf->SetFont('Times','',12);
$pdf->setCellHeightRatio(1);
$pdf->Cell(0,6,"Reg. No: ".$rollNofrom." to ".$rollNoto,"0",1,"C");
$pdf->setCellHeightRatio(0);
}
function Footer($pdf)
{
$pdf->SetY(-15);
$pdf->SetFont('helvetica', 'I', 8);
$pdf->Cell(50, 10,'IP : '.$_SERVER["REMOTE_ADDR"], 0, 0, 'L');
$pdf->Cell(80, 10,'Date : '.date("d-m-Y H:i:s"), 0, 0, 'C');
$pdf->Cell(70, 10,'Page ' .$pdf->getPageNumGroupAlias().'/'.$pdf->getPageGroupAlias(), 0, 1, 'R');
}
function tableHeader($pdf){
$pdf->SetFont('Times','B',10);
$pdf->Cell(10,6,"Sl. No.","LRT",0,"C");
$pdf->Cell(17,6,"Reg. No.","LRT",0,"C");
$pdf->Cell(60,6,"Student Name","LRT",0,"C");
$pdf->Cell(100,6,"Subject Code","LRT",1,"C");//w h txt brd pos align
}
function formdata($pdf, $result, $aobj_context){
$sl_no=0;
foreach ($result as $key => $value) {
$sl_no++;
$sub = explode(',', $value['subjects']);
$str1 = implode(',',array_splice($sub,0,4));
$str2 = implode(',',array_splice($sub,-5));
$name = ucwords(strtolower($value['fname']));
$pdf->SetFont('Times','',10);
$pdf->Cell(10,6,$sl_no,"LRT",0,"C");
$pdf->cell(17,6,$value['fregno'],"LRT",0,"C");
$pdf->cell(60,6,$name,"LRT",0,"L");
$pdf->cell(100,6,$str1,"LRT",1,"L");
if($str2){
if($pdf->getY() > 182){
// $pdf->cell(286,"","","T",1);
head($pdf,$aobj_context);
tableHeader($pdf);
}
$pdf->Cell(10,6,"","LRB",0);
$pdf->cell(17,6,"","LRB",0,"C");
$pdf->cell(60,6,"","LRB",0,"L");
$pdf->cell(100,6,$str2,"LRB",1,"L");
}else{
$pdf->cell(184,0,"","B",1,"L");
}
if($pdf->getY() > 250){
// $pdf->cell(286,"","","T",1);
//head($pdf,$aobj_context);
$FCOLLNAME = $value['fcollname'];
$FDESCPN = $value['fdescpn'];
$FEXAMNAME = $value['fexamname'];
$FEXAMDATE = $value['fexamdate'];
head($pdf,$aobj_context,$FCOLLNAME,$FDESCPN,$FEXAMNAME,$FEXAMDATE);
//$pdf->AddPage('P');
tableHeader($pdf);
}
}
}
?>
|