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.145.45.223
<?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 teacher_report extends TCPDF
{
function DefaultConstructor($aobj_context)
{
session_start();
$this->aobj_context=$aobj_context;
$this->pdf= new TCPDF();
$this->pdf=$this;
$this->coll_from=trim($this->aobj_context->mobj_data["coll_from"]);
$this->coll_to=trim($this->aobj_context->mobj_data["coll_to"]);
$this->board_from=trim($this->aobj_context->mobj_data["board_from"]);
$this->board_to=trim($this->aobj_context->mobj_data["board_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->getPageNumGroupAlias().'/'.$this->getPageGroupAlias(), 0, 1, 'R');
}
function GetFullQry()
{
$get_data = "select ifnull(fboardcode,'NA') as fboard1, ifnull(fboardname,'Not Available') as fboardname,
mt.fcollcode, fcollname, ftown, mt.fteachcode, fteachname,
mt.fmobile, lcase(mt.femail) as femail
from masteach mt left join teachsub ts on mt.fteachcode = ts.fteachcode
left join masqp mq on ts.fqpcode = mq.fqpcode left join
masboard mb on mq.fboard = mb.fboardcode
inner join college cl on mt.fcollcode = cl.fcollcode
where mt.fcollcode between '{$this->coll_from}' and '{$this->coll_to}'
and ifnull(fboardcode,'000000') between '{$this->board_from}' and '{$this->board_to}'
group by fteachcode
order by mt.fcollcode, fboardcode, fteachcode";
$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."/".$this->aobj_context->mobj_data["db"]."/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',11);
$this->Cell(0,4,$this->s_state,0,1,'C');
$this->SetFont('Times','B',12);
$this->Cell(0,4,'Techers Report College Wise List ',0,1,'C');
$this->SetFont('Times','',10);
$this->Cell(0,4,'College Range: '.$this->coll_from.' - '.$this->coll_to,0,1,'C');
$this->Cell(0,4,'Board Range: '.$this->board_from.' - '.$this->board_to,0,1,'C');
$this->Ln(1);
$this->SetAutoPageBreak($auto_page_break, $bMargin);
}
function tableHeader()
{
$this->pdf->SetFont('Times','B',10);
$this->pdf->Cell(8,5,'Sl.','LRT',0,'C');
$this->pdf->Cell(10,5,'Board','LRT',0,'C');
$this->pdf->Cell(30,5,'Board Name','LRT',0,'C');
$this->pdf->Cell(15,5,'Teacher','LRT',0,'C');
$this->pdf->Cell(50,5,'Teacher Name','LRT',0,'C');
$this->pdf->Cell(20,5,'Mobile No.','LRT',0,'C');
$this->pdf->Cell(60,5,'Email Id','LRT',1,'C');
$this->pdf->Cell(8,5,'No','LRB',0,'C');
$this->pdf->Cell(10,5,'Code','LRB',0,'C');
$this->pdf->Cell(30,5,'','LRB',0,'C');
$this->pdf->Cell(15,5,'Code','LRB',0,'C');
$this->pdf->Cell(50,5,'','LRB',0,'C');
$this->pdf->Cell(20,5,'','LRB',0,'C');
$this->pdf->Cell(60,5,'','LRB',1,'C');
$this->pdf->SetFont('Times','',10);
$bMargin = $this->getBreakMargin();
}
function formData()
{
session_start();
$FUNIVCODE = $_SESSION['FUNIVCODE'];
$this->pdf->SetMargins(5,5,5);
/*$this->headeractive = true;*/
$this->pdf->AddPage();
$this->logoheader();
$this->pdf->SetFont('Times','B',10);
$this->pdf->Ln(10);
$this->pdf->Cell(0,7,$this->lobj_get_data[0]['fcollcode'].' - '.$this->lobj_get_data[0]['fcollname'].', '.$this->lobj_get_data[0]['ftown'],'0',1,'C');
$this->tableHeader();
$i=0;
$this->pdf->SetFont('Times','',10);
$newcollcode ='';
$oldcollcode = $this->lobj_get_data[0]['fcollcode'];
$bMargin = $this->getBreakMargin();
foreach($this->lobj_get_data as $key => $value)
{
$newcollcode=$value['fcollcode'];
if ($oldcollcode != $newcollcode) {
$this->pdf->SetFont('Times','B',10);
$this->pdf->Cell(0,12,$value['fcollcode'].' - '.$value['fcollname'].', '.$value['ftown'],'0',1,'C');
$this->tableHeader();
$i = 0;
$this->pdf->SetFont('Times','',10);
$oldcollcode=$newcollcode;
}
$this->pdf->Cell(8,7,++$i,1,0,'C');
$this->pdf->Cell(10,7,$value['fboard1'],1,0,'C');
$this->pdf->Cell(30,7,$value['fboardname'],1,0,'L');
$this->pdf->Cell(15,7,$value['fteachcode'],1,0,'C');
$this->pdf->Cell(50,7,$value['fteachname'],1,0,'L');
$this->pdf->Cell(20,7,$value['fmobile'],1,0,'C');
$this->pdf->Cell(60,7,$value['femail'],1,1,'L');
$y=$this->pdf->Gety();
if($y >250)
{
$this->pdf->AddPage();
$this->logoheader();
$this->pdf->SetFont('Times','',10);
$this->pdf->Ln(10);
$this->tableHeader();
$this->getBreakMargin();
}
}
}
function SendOutput()
{
$this->pdf->Output("TeacherReportLsys.pdf","D");
}
}
function GenerateTeacherReportLsys($aobj_context)
{
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$class_obj=new teacher_report();
$class_obj->DefaultConstructor($aobj_context);
$class_obj->GetFullQry();
$class_obj->formcolldata();
$class_obj->formData();
$class_obj->SendOutput();
}
?>
|