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.139.87.151
<?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);
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->from_college_code = $aobj_context->mobj_data['from_college_code'];
$this->to_college_code = $aobj_context->mobj_data["to_college_code"];
$this->from_qp_code= $aobj_context->mobj_data["from_qp_code"] ;
$this->collcode=$_SESSION['collcode'];
$this->college_code = $_SESSION['collcode'];
$this->to_qp_code= $aobj_context->mobj_data["to_qp_code"] ;
$this->RunHeader();
$this->pdf= new FPDF();
$this->pdf=$this;
$get_date_time="SELECT DATE_FORMAT(now(),'%d-%b-%Y %H:%m %r') 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()
{
$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'];
$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->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->SetFont('Times','B',12);
$this->pdf->Cell(190,6,'Deviation Report',0,1,'C');
if(file_exists($this->pdf_logo_path))
{
$this->pdf->Image($this->pdf_logo_path,22,7,22);
}
}
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 GenerateDeviationReport()
{
$get_dev_marks="select ifnull(FDEVMARK,0) as FDEVMARK,FNOVAL
from masqp where FQPCODE>='{$this->from_qp_code}' and FQPCODE<='{$this->to_qp_code}'";
$lobj_get_dev_marks = $this->aobj_context->mobj_db->GetRow($get_dev_marks);
$FNOVAL=$lobj_get_dev_marks[FNOVAL];
$next_val=$lobj_get_dev_marks[FNOVAL]+1;
$val_cond=" and v{$FNOVAL} is not null ";
$last_val=$lobj_get_dev_marks[FNOVAL]+1;
$get_data="select s.FQPCODE,s.FPACKET,FDEVIATION,
GROUP_CONCAT(FDEVIATION,'->',lpad(s.FSLNO,2,0) order by lpad(s.FSLNO,2,0) separator ',') as FSLNO,
if(v{$next_val}>0,'Done','Pending') as dev_sts
from tabsummary s
inner join
(select distinct FQPCODE,FPACKET from tabhead where
FCOLLCODE>='{$this->from_college_code}' and FCOLLCODE<='{$this->to_college_code}'
and FQPCODE>='{$this->from_qp_code}' and FQPCODE<='{$this->to_qp_code}'
and FFREEZE='T'
) q
on s.FQPCODE=q.FQPCODE
where s.FQPCODE>='{$this->from_qp_code}' and s.FQPCODE<='{$this->to_qp_code}'
{$val_cond}
and q.FPACKET=s.FPACKET
group by s.FQPCODE,s.FPACKET
order by s.FQPCODE,
lpad(s.FPACKET,4,0),
lpad(s.FSLNO,2,0)
";
$lobj_get_data = $this->aobj_context->mobj_db->GetAll($get_data);
$this->pdf->SetFont('Times','',10);
$this->pdf->AddPage();
if(!empty($lobj_get_data))
{
$this->pdf->Ln(20);
$this->pdf->SetFont('Times','B',10);
$this->pdf->Cell(30,6,' ',0,0,'C');
$this->pdf->Cell(30,6,' QP Code',1,0,'C');
$this->pdf->Cell(20,6,'Packet ',1,0,'C');
$this->pdf->Cell(60,6,'Sl. No.',1,0,'C');
$this->pdf->Cell(25,6,"Val ( {$last_val} )",1,1,'C');
$this->pdf->SetFont('Times','',10);
}
else
{
$this->pdf->Ln(20);
$this->pdf->Cell(0,6,' No Deviations Found',0,0,'C');
}
$this->pdf->SetFont('Times','',10);
$prev_qp_code=$lobj_get_data[0][FQPCODE];
foreach($lobj_get_data as $key =>$val)
{
$FQPCODE=$val[FQPCODE];
$FPACKET=$val[FPACKET];
$FDEVIATION=$val[FDEVIATION];
$FSLNO=$val[FSLNO];
$explode_arr=explode(",",$FSLNO);
$final_arr=array();
foreach($explode_arr as $ek)
{
$explode_arr=explode("->",$ek);
$final_arr[$explode_arr[0]]=$final_arr[$explode_arr[0]]." ".$explode_arr[1];
}
$dev_sts=$val[dev_sts];
if(empty($final_arr['T']))
{
$FSLNO=" No Deviation";
$dev_sts=' - ';
}
else
{
$FSLNO=$final_arr['T'];
}
if($prev_qp_code!=$FQPCODE)
{
$this->pdf->Ln(12);
$this->pdf->SetFont('Times','B',10);
$this->pdf->Cell(30,6,' ',0,0,'C');
$this->pdf->Cell(30,6,' QP Code',1,0,'C');
$this->pdf->Cell(20,6,'Packet ',1,0,'C');
$this->pdf->Cell(60,6,'Sl. No.',1,0,'C');
$this->pdf->Cell(25,6,"Val ( {$last_val} )",1,1,'C');
$this->pdf->SetFont('Times','',10);
}
$x_pos=$this->pdf->GetX();
$y_pos=$this->pdf->GetY();
$this->pdf->SetXY($x_pos+80,$y_pos);
$this->pdf->MultiCell(60,5,$FSLNO,1,'C');
$x_pos1=$this->pdf->GetX();
$y_pos1=$this->pdf->GetY();
$hei=$y_pos1-$y_pos;
$this->pdf->SetXY($x_pos,$y_pos);
$this->pdf->Cell(30,$hei,'',0,0,'C');
$this->pdf->Cell(30,$hei,$FQPCODE,1,0,'C');
$this->pdf->Cell(20,$hei,$FPACKET,1,0,'C');
$this->pdf->SetXY($x_pos+140,$y_pos);
$this->pdf->Cell(25,$hei,$dev_sts,1,1,'C');
$prev_qp_code=$FQPCODE;
if($this->pdf->GetY()>240)
{
$this->pdf->Addpage();
}
}
$x_pos=0;
$y_pos=0;
$y_pos1=0;
$x_pos1=0;
$hei=0;
}
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 SendOutput()
{
$this->pdf->Output("deviation_report{$this->report_id}.pdf","D");
}
}
function GenerateDeviationReport($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->GenerateDeviationReport();
$class_obj->SendOutput();
}
?>
|