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.144.4.50
<?php
$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);
include_once("stringspliter.php");
class qpreport extends TCPDF
{
function DefaultConstructor($aobj_context)
{
session_start();
$this->aobj_context=$aobj_context;
$this->pdf= new TCPDF();
$this->pdf=$this;
$this->centre_from=trim($this->aobj_context->mobj_data["centre_from"]);
$this->centre_to=trim($this->aobj_context->mobj_data["centre_to"]);
$this->qp_from=trim($this->aobj_context->mobj_data["qp_from"]);
$this->qp_to=trim($this->aobj_context->mobj_data["qp_to"]);
$this->startPageGroup();
}
function Header()
{
$bMargin = $this->getBreakMargin();
$auto_page_break = $this->AutoPageBreak;
$this->SetAutoPageBreak(false, 0);
$this->SetAutoPageBreak($auto_page_break, $bMargin);
}
function Footer()
{
$this->SetY(-15);
$this->pdf->SetFont('Times','B',8);
$this->Cell(140,6,'Entered : IP Address : '.$this->ip_address." Date ".$this->created_date,'0',0,'L');
// $this->Cell(50,6,'Page '.$this->PageNo().' of {nb}',0,1,'R');
$this->Cell(50, 6,'Page ' .$this->getPageNumGroupAlias().'/'.$this->getPageGroupAlias(), 0, 1, 'R');
}
function GetFullQry()
{
$get_data = "select fcntrcode, fcntrname, fqpcode, fsubname, fdoe, fcnt from tmpqpindsum order by fcntrcode, fqpcode";
$this->lobj_get_data = $this->aobj_context->mobj_db->GetAll($get_data);
}
function formcolldata()
{
$get_coll_name="select FUNIVNAME as 'FUNIVNAME',
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->s_state=$lobj_get_coll_name['state'];
$this->pdf_logo_path=$lobj_get_coll_name['pdf_logo_path'];
}
function logoheader()
{
$bMargin = $this->getBreakMargin();
$auto_page_break = $this->AutoPageBreak;
$this->SetAutoPageBreak(true, 1);
$this->SetFillColor(248, 248 ,255);
$img_path = $this->aobj_context->main_src."/img/logo.jpg";
if(file_exists($img_path))
$this->Image($img_path,6,6,20,20);
$this->SetFont('Times','B',13);
$this->SetY(5);
$this->Cell(0,4,$this->FUNIVNAME,0,1,'C');
$this->SetFont('Times','B',12);
$this->Cell(0,4,$this->s_state,0,1,'C');
$this->SetFont('Times','B',12);
$this->Cell(0,6,'Qp Count For Print',0,1,'C');
$this->SetFont('Times','',10);
$this->Cell(0,4,'Centre Range: '.$this->centre_from.' - '.$this->centre_to,0,1,'C');
$this->Cell(0,4,'QP Range: '.$this->qp_from.' - '.$this->qp_to,0,1,'C');
$this->Ln(1);
$this->SetAutoPageBreak($auto_page_break, $bMargin);
}
function tableHeader()
{
$this->pdf->SetFont('Times','B',10);
$this->pdf->Cell(10,5,'Sl.No',1,0,'C');
$this->pdf->Cell(20,5,'Centre Code',1,0,'C');
$this->pdf->Cell(100,5,'Centre Name',1,0,'C');
$this->pdf->Cell(18,5,'QP Code',1,0,'C');
$this->pdf->Cell(70,5,'Subject Name',1,0,'C');
$this->pdf->Cell(20,5,'Date',1,0,'C');
$this->pdf->Cell(18,5,'QP Indent',1,1,'C');
$bMargin = $this->getBreakMargin();
}
function formData()
{
session_start();
$FUNIVCODE = $_SESSION['FUNIVCODE'];
$this->pdf->SetMargins(10,7,2);
$this->pdf->AddPage('L');
$this->pdf->logoheader();
$this->pdf->SetFont('Times','',10);
$this->pdf->Ln(10);
$this->pdf->Cell(0,7,$this->lobj_get_data[0]['fcntrcode'].' - '.$this->lobj_get_data[0]['fcntrname'],'0',1,'C');
$this->tableHeader();
$i=0;
$this->pdf->SetFont('Times','',10);
$newcentrecode ='';
$oldcentrecode = $this->lobj_get_data[0]['fcntrcode'];
$bMargin = $this->getBreakMargin();
foreach($this->lobj_get_data as $key => $value)
{
$newcentrecode=$value['fcntrcode'];
if ($oldcentrecode != $newcentrecode)
{
$this->pdf->SetFont('Times','',10);
$this->pdf->Cell(0,12,$value['fcntrcode'].' - '.$value['fcntrname'],'0',1,'C');
$this->tableHeader();
$i = 0;
$this->pdf->SetFont('Times','',10);
$oldcentrecode=$newcentrecode;
}
$this->pdf->Cell(10,7,++$i,1,0,'C');
$this->pdf->Cell(20,7,$value['fcntrcode'],1,0,'C');
$this->pdf->Cell(100,7,$value['fcntrname'],1,0,'L');
$this->pdf->Cell(18,7,$value['fqpcode'],1,0,'C');
$this->pdf->Cell(70,7,$value['fsubname'],1,0,'L');
$this->pdf->Cell(20,7,$value['fdoe'],1,0,'C');
$this->pdf->Cell(18,7,$value['fcnt'],1,1,'C');
$y=$this->pdf->Gety();
if($y >270)
{
$this->pdf->AddPage('L');
$this->logoheader();
$this->pdf->SetFont('Times','',10);
$this->pdf->Ln(10);
$this->tableHeader();
$this->getBreakMargin();
}
}
}
function SendOutput()
{
$this->pdf->Output("QP Indent Report.pdf","D");
}
}
function Generateqpreport($aobj_context)
{
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$class_obj=new qpreport();
$class_obj->DefaultConstructor($aobj_context);
$class_obj->GetFullQry();
$class_obj->formcolldata();
$class_obj->formData();
$class_obj->SendOutput();
}
?>
|