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.146.206.87
<?php
$main_src=substr($_SERVER['SCRIPT_FILENAME'],0,strlen($_SERVER['SCRIPT_FILENAME'])-7);
$pdf_writer_class =$main_src."/tarka_pdf_latest/fpdf.php";
require_once($pdf_writer_class);
ini_set('max_execution_time', 0);
class GenerateFeeSummaryReport extends FPDF
{
function DefaultConstructor($aobj_context)
{
include_once($aobj_context->main_src."/src/format.php");
$this->aobj_context=$aobj_context;
$this->pdf= new FPDF();
$this->pdf=$this;
session_start();
$this->collcode = $_SESSION['collcode'];
$this->univcode = $_SESSION['univcode'];
// var_dump($this->collcode);die();
$this->ip=$_SERVER["REMOTE_ADDR"];
$this->degree = $aobj_context->mobj_data["degree"];
$this->degexam = $aobj_context->mobj_data["degexam"];
$this->yearmode = $aobj_context->mobj_data["yearmode"];
$this->section = $aobj_context->mobj_data["section"];
$yearmode = explode("*",$this->yearmode);
$this->year = $yearmode[0];
$this->examtye = $yearmode[1];
$get_date= "select NOW() as now_date,
CONCAT('[',fcollcode,'] ', fcollname,', ',FTOWN) as college_name,
dg.fexamdate as fresexamdate, d.fdescpn, d.fexamname from college c, degree d, degexam dg
where fcollcode = '{$this->collcode}' and d.fdegree = '{$this->degree}'
and d.fdegree = dg.fdegree and d.fexamno = dg.fexamno
and d.fexamno = '{$this->degexam}'
and dg.fyear = '{$this->year}'
and dg.fexamtype = '{$this->examtye}'";
// var_dump($get_date);die();
$obj=$aobj_context->mobj_db->GetRow($get_date);
$this->current_date = $obj['now_date'];
$this->college_name = $obj['college_name'];
$this->fresexamdate = $obj['fresexamdate'];
$this->fdescpn = $obj['fdescpn'];
$this->fexamname = $obj['fexamname'];
$this->first = true;
}
function Header($section)
{
$img_path=$this->aobj_context->main_src."/".$this->aobj_context->mobj_data["db"]."/".$this->pdf_logo_path;
if(!empty($this->pdf_logo_path) && file_exists($img_path))
{
$this->pdf->Image($img_path,10,10,35);
}
if($this->funivcode=="052"){
$this->pdf->SetFont('Times','B',9);
$this->pdf->cell(0,7,""."JSS MAHAVIDYAPEETHA","0",1,"C");
}
$this->pdf->SetFont('Times','B',14);
$this->pdf->cell(0,7,"".$this->FUNIVNAME,"0",1,"C");
$this->pdf->SetFont('Times','',8);
$this->pdf->cell(0,4, $this->s_state,"0",0,"C");
$this->pdf->SetFont('Times','',10);
$this->pdf->Cell(-20,4,"Page {$this->pdf->PageNo()}/{nb}",0,1,'C');
$this->pdf->SetFont('Times','B',10);
$this->pdf->cell(0,7,"College: ".$this->college_name,"0",1,"C");
$this->pdf->cell(0,7,"SUBJECT WISE RESULT ANALYSIS - ".$this->fresexamdate ." EXAMINATION ","0",1,"C");
$this->pdf->cell(0,7,$this->fexamname." - ".$this->fdescpn,"0",1,"C");
}
function Footer()
{
$sign = $this->aobj_context->main_src.$this->aobj_context->mobj_data["db"]."/img/controler_sign.jpg";
$this->SetY(-30);
$y = -10;
$x = 145;
$size = 40;
$img_x=($this->pdf->getX()+$x);;
$img_y=$this->pdf->getY()+$y;
$this->pdf->SetFont('Times','B',10);
if($this->funivcode=="052"){
if(file_exists($sign))
$this->pdf->Image($sign,$img_x,$img_y,$size);
}
$this->pdf->Cell(185,4,"Controller of Examinations","",0,"R");
$this->SetY(-14);
$new_y=$this->pdf->GetY();
$this->pdf->Ln(2);
$this->Cell(140,5,'Printed: IP Address : '.$this->ip." Date ".$this->current_date,'0',0,'L');
}
function formcolldata()
{
$get_coll_name="select FUNIVNAME as 'FUNIVNAME',funivcode,
FUNIVADD1 as 'state', pdf_logo_path From control";
$lobj_get_coll_name=$this->aobj_context->mobj_db->GetRow($get_coll_name);
$this->FUNIVNAME=$lobj_get_coll_name['FUNIVNAME'];
$this->funivcode=$lobj_get_coll_name['funivcode'];
$this->s_state=$lobj_get_coll_name['state'];
$this->f_year=$lobj_get_coll_name['f_year'];
$this->pdf_logo_path=$lobj_get_coll_name['pdf_logo_path'];
}
function tableHeader(){
$query="SELECT r.fdegree,r.fexamno,r.fregno,r.fyear,r.fexamtype,
GROUP_CONCAT(DISTINCT CONCAT(IF(r.FSCHEME = 'CR',r.fgrade,(fthtot+fprtot)),'*',s.fsubshort)) AS subdet, r.fclass FROM resmarks r INNER JOIN `subject` s ON r.fsubcode = s.fsubcode
AND r.fdegree = s.fdegree AND r.fexamno = s.fexamno
WHERE r.fdegree='{$this->degree}' AND r.fexamno='{$this->degexam}' AND r.fyear='{$this->year}' AND r.fexamtype='{$this->examtye}'
GROUP BY fregno";
$results = $this->aobj_context->mobj_db->GetAll($query);
$this->SetY(55);
foreach ($results as $key => $value) {
$subres1=substr($value['subdet'],0);
$submarks=explode(",",$subres1);
$num_tags = count($submarks);
}
$this->pdf->SetFont('Times','B',9);
$this->pdf->Cell(8,5,"Sl.","LRT",0,"C");
$this->pdf->Cell(22,5,"Subject","LRT",0,"C");
$this->pdf->SetFont('Times','B',11 );
$this->pdf->Cell(75,10,"Subject Name","LRT",0,"C");
$this->pdf->SetFont('Times','B',9);
$this->pdf->Cell(23,10,"Appeared","LRTB",0,"C");
$this->pdf->Cell(23,10,"Passed","LRTB",0,"C");
$this->pdf->Cell(23,10,"Failed","LRTB",0,"C");
$this->pdf->Cell(17,5,"Pass","LRT",1,"C");
$this->pdf->SetFont('Times','B',9);
$this->pdf->Cell(8,5,"No.","LRB",0,"C");
$this->pdf->Cell(22,5,"Code","LRB",0,"C");
$this->pdf->Cell(75,0,"","",0,"C");
$this->pdf->Cell(23,0,"","",0,"C");
$this->pdf->Cell(23,0,"","",0,"C");
$this->pdf->Cell(23,0,"","",0,"C");
$this->pdf->Cell(17,5,"Percentage","LRB",1,"C");
}
function formdata()
{
if($this->section === "All"){
$secCond = "";
}else{
$secCond = "";
}
$qrySection = "select distinct fsection from student where ifnull(fsection, '') <> '' {$secCond} order by fsection";
$resSection = $this->aobj_context->mobj_db->GetAll($qrySection);
foreach($resSection as $value){
if($this->funivcode=="051"){
$query= "SELECT rs.fdegree,rs.fsubcode,su.fsubshort, CONCAT(su.fsubname,' - ',su.fssubname) AS fsubname, COUNT(rs.fregno) AS cnt,
SUM(IF(FTHPASSMTH = 'Pass',1,0)) AS passcnt, SUM(IF(FTHPASSMTH <> 'Pass',1,0)) AS failcnt
FROM resmarks rs INNER JOIN subject su ON
rs.fdegree = su.fdegree AND rs.fexamno = su.fexamno AND rs.fsubcode = su.fsubcode
INNER JOIN student st ON rs.fdegree = st.fdegree AND rs.fregno = st.fregno
WHERE rs.fdegree ='{$this->degree}' AND rs.fexamno ='{$this->degexam}'
AND fyear ='{$this->year}' AND fexamtype ='{$this->examtye}'
AND IFNULL(st.fsection,'') LIKE ''
GROUP BY rs.fdegree, rs.fsubcode,rs.fexamno
ORDER BY st.fsection, rs.fsubcode";
}else{
$query="SELECT r.fdegree,r.fsubcode,fsubshort,fsubname,COUNT(r.fregno) AS cnt,
SUM(IF(FTHPASSMTH = 'Pass',1,0)) AS passcnt,
SUM(IF(FTHPASSMTH <> 'Pass',1,0)) AS failcnt
FROM resmarks r
INNER JOIN `subject` s ON r.fsubcode = s.fsubcode
AND r.fdegree = s.fdegree AND r.fexamno = s.fexamno
inner join student st on r.fdegree = st.fdegree and r.fregno = st.fregno
WHERE r.fdegree='{$this->degree}' AND r.fexamno='{$this->degexam}'
AND r.fyear='{$this->year}' AND r.fexamtype = '{$this->examtye}'
AND IFNULL(s.fintass,'') = 'F'
AND IFNULL(s.fretain,'') = 'F'
and fsection='{$value['fsection']}' and s.fssubcode ='0'
GROUP BY r.fdegree,r.fexamno,r.fsubcode
order by st.fsection, fsubcode";
}
$results = $this->aobj_context->mobj_db->GetAll($query);
$count = count($results);
$this->pdf->SetMargins(8,8,2,2);
if($count > 0){
$this->pdf->AddPage("P");
$this->pdf->SetFont('Times','B',10);
if($this->funivcode !=="051"){
$this->pdf->cell(0,7,"Section - ". $value['fsection'],"0",1,"L");
}
$this->pdf->SetMargins(8,8,2,2);
$this->tableHeader($value['fsection']);
$i = 1;
foreach ($results as $key => $value)
{
if($this->pdf->getY() > 260)
{
$this->pdf->AddPage("P");
$this->pdf->SetMargins(8,8,2,2);
$this->tableHeader();
}
$total=substr($value['cnt'],0);
$passed=substr($value['passcnt'],0);
$percentage = ($passed / $total)*100;
$explode = explode(".", $percentage);
list($whole, $decimal) = explode('.',$percentage);
$totalperc= round($percentage, 2);
if(empty($name2))
{
$this->pdf->SetFont('Times','',8.5);
$this->pdf->Cell(8,9,"$i","LRB",0,"C");
$this->pdf->Cell(22,9,$value['fsubshort'],"LRB",0,"C");
$this->pdf->SetFont('Times','',8);
$this->pdf->Cell(75,9,$value['fsubname'],"LRBT ",0,"L");
$this->pdf->SetFont('Times','',9);
$this->pdf->Cell(23,9,$value['cnt'],"LRB",0,"C");
$this->pdf->Cell(23,9,$value['passcnt'],"LRB",0,"C");
$this->pdf->Cell(23,9,$value['failcnt'],"LRB",0,"C");
$this->pdf->Cell(17,9,$totalperc,"LRB",1,"C");
}
$i++;
}
}
}
}
function SendOutput()
{
$this->pdf->Output("Sub_Wise_Pass_Per.pdf","I");
}
}
function subwiseResultPdf($aobj_context){
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$class_obj=new GenerateFeeSummaryReport();
$class_obj->AliasNbPages();
$class_obj->DefaultConstructor($aobj_context);
$class_obj->Header();
$class_obj->formcolldata();
$class_obj->formdata();
$class_obj->SendOutput();
}
?>
|