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.137.198.181
<?php
$main_src=substr($_SERVER['SCRIPT_FILENAME'],0,strlen($_SERVER['SCRIPT_FILENAME'])-7);
$this->pdf_writer_class =$main_src."/tarka_pdf/fpdf.php";
require_once($this->pdf_writer_class);
class evaluation_report extends FPDF
{
public $aobj_context;
public $college_name;
public $town;
public $address;
public $Degree_name;
function Default_construstor($aobj_context)
{
require_once($aobj_context->main_src.'src/format.php');
$this->aobj_context=$aobj_context;
include($this->pdf_writer_class);
session_start();
$this->report_id = $aobj_context->mobj_data["report_id"];
$this->pdf= new FPDF();
$this->pdf->SetFont('Times','',10);
$this->pdf->SetMargins(15,15);
$this->pdf->AliasNbPages();
$this->pdf->Ln(3);
$this->collcode=$_SESSION['collcode'];
$this->college_code = $_SESSION['collcode'];
$this->qp_code= $aobj_context->mobj_data["evaluation_qp_code"] ;
$this->packet_no= $aobj_context->mobj_data["evaluation_packet_no"] ;
$this->val_no= $aobj_context->mobj_data["evaluation_val_no"] ;
$this->RunHeader();
$this->pdf= new FPDF();
$this->pdf=$this;
$get_date_time="SELECT DATE_FORMAT(now(),'%d-%b-%Y %H:%m') as dt";
$ob_dt = $this->aobj_context->mobj_db->GetRow($get_date_time);
$this->date_time=$ob_dt[dt];
}
function RunHeader()
{
$page_header_college ="select concat(FTOWN,', ',FUNIVADD1) as address,FUNIVNAME as college_name ,
pdf_logo_path as pdf_logo_path from control ";
//echo $page_header_college;die();
$lobj_page_header_college = $this->aobj_context->mobj_db->GetRow($page_header_college);
$this->coll_name = $lobj_page_header_college['college_name'];
$this->address = $lobj_page_header_college['address'];
$this->pdf_logo_path = $this->aobj_context->main_src."/".$lobj_page_header_college['pdf_logo_path'];
}
function Header()
{
$page_header_college ="select concat(FTOWN,', ',FUNIVADD1) as address,FUNIVNAME as college_name ,
pdf_logo_path as pdf_logo_path from control ";
//echo $page_header_college;die();
$lobj_page_header_college = $this->aobj_context->mobj_db->GetRow($page_header_college);
$this->coll_name = $lobj_page_header_college['college_name'];
$this->address = $lobj_page_header_college['address'];
$this->pdf_logo_path = $this->aobj_context->main_src."/".$lobj_page_header_college['pdf_logo_path'];
$get_college_name="select FCOLLNAME as col_name from college where FCOLLCODE='{$this->collcode}'";
$this->lobj_get_college_name = $this->aobj_context->mobj_db->GetRow($get_college_name);
$this->col_name=$this->lobj_get_college_name['col_name'];
$get_exam_date="select FEXAMDATE as exam_date,FEXAMNAME from degree where FDEGREE='{$this->degree}'";
$this->lobj_get_exam_date = $this->aobj_context->mobj_db->GetRow($get_exam_date);
$this->exam_date=$this->lobj_get_exam_date['exam_date'];
$this->FEXAMNAME=$this->lobj_get_exam_date['FEXAMNAME'];
$this->pdf->SetFont('Times','B',14);
$this->pdf->Cell(190,4,$this->coll_name,0,1,'C');
$this->pdf->SetFont('Times','',8);
$this->pdf->Cell(180,4,$this->address,0,0,'C');
$this->pdf->SetFont('Times','B',12);
$this->pdf->Cell(-20,4,"Page {$this->pdf->PageNo()}/{nb}",0,1,'C');
$this->pdf->Ln(2);
$this->pdf->SetFont('Times','B',12);
$this->pdf->Cell(190,4,"College : ".$this->collcode." ".$this->col_name,0,1,'C');
$this->pdf->Ln(2);
$this->pdf->Cell(190,6,"Subject : {$this->subject_code} - {$this->subject} (Max. : {$this->FMAXMARKS} Marks)",0,1,'C');
$this->pdf->Ln(1);
$this->pdf->Cell(190,6,"Packet : {$this->packet_no} - Valuation #{$this->val_no}",0,1,'C');
$this->pdf->SetFont('Times','BU',12);
$this->pdf->Cell(190,6," Marks List {$this->FFREEZE}",0,1,'C');
if(file_exists($this->pdf_logo_path))
{
$this->pdf->Image($this->pdf_logo_path,15,7,22);
}
}
function GenerateEvaluationReport()
{
$page_qp_details = "select FSUBNAME as sub,FQPCODE as qp,FMAXMARKS
from masqp where FQPCODE='{$this->qp_code}' ";
//echo $page_qp_details;die();
$lobj_page_qp_details = $this->aobj_context->mobj_db->GetRow($page_qp_details);
$this->subject_code = $lobj_page_qp_details['qp'];
$this->subject = $lobj_page_qp_details['sub'];
$this->FMAXMARKS = $lobj_page_qp_details['FMAXMARKS'];
$page_staff_details = "select FTEACHCODE as teach_code,FCHKNO as checkno,FPACKET as packet,FQPCODE as qp,
FVALNO as valno,
if(ifnull(FFREEZE,'F')='F',' (Verification Pending)','(Verified)') as FFREEZE
from tabhead where FCOLLCODE = '{$this->college_code}'
and FQPCODE='{$this->qp_code}' && FPACKET = '{$this->packet_no}' ";
$lobj_page_staff_details = $this->aobj_context->mobj_db->GetRow($page_staff_details);
//echo $page_staff_details;die();
$this->packet = $lobj_page_staff_details['packet'];
$this->FFREEZE = $lobj_page_staff_details['FFREEZE'];
$valno = $lobj_page_staff_details['valno'];
$qp = $lobj_page_staff_details['qp'];
$this->teach_code = $lobj_page_staff_details['teach_code'];
//echo $this->teach_code;die();
$checkno = $lobj_page_staff_details['checkno'];
$page_teach_name = "select FTEACHNAME as name
from masteach where FTEACHCODE = '{$this->teach_code}'";
//echo $page_teach_name;die();
$lobj_page_teach_name = $this->aobj_context->mobj_db->GetRow($page_teach_name);
$name = $lobj_page_teach_name['name'];
$page_total_marks = "select FQPCODE,
lpad(FPACKET,4,'0') as FPACKET,
lpad(FVALNO,2,'0') as FVALNO,
lpad(FSLNO,2,'0') as FSLNO,
case when FTOTMARKS is null
then ''
when FTOTMARKS=0
then '0'
when FTOTMARKS =-1
then ''
when FTOTMARKS =-3
then 'MP'
else
round(FTOTMARKS)
end as total
from tabdetl where FCOLLCODE = '{$this->college_code}'
and FQPCODE='{$this->qp_code}' && FPACKET = '{$this->packet_no}'
and FVALNO='{$this->val_no}'
group by FQPCODE,FPACKET,FSLNO order by FQPCODE,FPACKET, lpad(FSLNO,2,'0')";
$lobj_page_total_marks = $this->aobj_context->mobj_db->GetAll($page_total_marks);
//echo $page_total_marks;die();
$this->pdf->AddPage();
$this->pdf->SetFont('Times','B',10);
$this->pdf->Ln(06);
/* $this->pdf->Cell(30,6,' ',0,0,'L');
$this->pdf->Cell(20,6,'Packet : ',0,0,'L');
$this->pdf->Cell(10,6,$this->packet_no,0,0,'L');
$this->pdf->Cell(50,6,'',0,0,'C');
$this->pdf->Cell(40,6,'Teacher: '.$name."-".$this->teach_code,0,1,'L');
$this->pdf->Ln(2);
$this->pdf->Cell(30,6,' ',0,0,'L');
$this->pdf->Cell(20,6,'Check No : ',0,0,'L');
$this->pdf->Cell(10,6,$checkno,0,0,'L');
$this->pdf->Cell(50,6,'',0,0,'C');
$this->pdf->Cell(40,6,' ',0,1,'L');$this->pdf->Ln(2);
$this->pdf->Cell(30,6,'',0,0,'C');
$this->pdf->Cell(20,6,'','LRT',0,'C');
$this->pdf->Cell(100,6,'Marks','1',1,'C');
$this->pdf->Cell(20,6,$this->pdf->FTOWN,0,0,'C'); */
$this->pdf->Cell(45,6,' ',0,0,'C');
$this->pdf->Cell(20,6,'Sl. No.','1',0,'C');
$this->pdf->Cell(25,6,'In Figures','1',0,'C');
$this->pdf->Cell(55,6,'In Words','1',1,'C');
$this->pdf->SetFont('Times','',10);
$arr=array();
$cnt=0;
$num=0;
$total=0;
$final_value=0;
foreach($lobj_page_total_marks as $key =>$val)
{
$total=$val[total];
$first_col_tot=$val[total];
if(empty($first_col_tot) && $first_col_tot!=0)
$first_col_tot=" - ";
$FPACKET=$val[FPACKET];
$FVALNO=$val[FVALNO];
if($total>=0)
$marks_inwords=$this->GetNumWord($total);
else if(empty($total) && $total!=0 && $total!="MP")
$marks_inwords=" - ";
else
$marks_inwords=$total;
if($total=="MP")
$marks_inwords="Mal - Practice";
$this->pdf->Cell(45,6, "","",0,'C');
$this->pdf->Cell(20,6,$val[FSLNO],1,0,'C');
$this->pdf->Cell(25,6,$first_col_tot,1,0,'C');
$this->pdf->Cell(55,6,$marks_inwords,1,1,'L');
}
$this->WriteFooter();
}
function WriteFooter()
{
$this->pdf->Ln(6);
$this->pdf->SetFont('Arial','',8);
$this->pdf->Cell(50,3,"Marks Entered Date & Time: ",'0',0,'L');
$this->pdf->Ln(9);
$this->pdf->Cell(50,3,'Signature of the Chief Suptdt.','0',0,'L');
$this->pdf->Cell(120,3,'Signature of the Examiner','0',1,'R');
$this->pdf->Ln(5);
}
function GetNumWord($num)
{
$ones = array(
"0"=>"Zero",
"1"=>"One",
"2"=>"Two",
"3"=>"Three",
"4"=>"Four",
"5"=>"Five",
"6"=> "Six",
"7"=>"Seven",
"8"=>"Eight",
"9"=>"Nine");
$final_val="";
for($i=0;$i<strlen($num);$i++)
{
$split_num=substr($num,$i,1);
$final_val.=$ones[$split_num]." ";
}
return $final_val;
}
function Footer()
{
$this->SetY(-20);
//echo $this->FCSUBCODE;die();
$this->SetFont('Arial','I',8);
$this->pdf->Cell(90,3,'Date Time: '.$this->date_time,'0',0,'L');
//$this->Cell(0,3,'Absent On This Page : '.$this->page_absent_count,'0',1,'C');
//$this->Cell(0,3,' Total Absent : '.$this->ii_details_arr[$this->FCSUBCODE],'0',1,'C');
}
function SendOutput()
{
$this->pdf->Output("evaluation_report{$this->report_id}.pdf","D");
}
}
function GenerateEvaluationReport($aobj_context)
{
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$class_obj=new evaluation_report();
$class_obj->AliasNbPages();
$class_obj->Default_construstor($aobj_context);
$class_obj->GetNumWord();
$class_obj->GenerateEvaluationReport();
$class_obj->SendOutput();
}
?>
|