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.61.142
<?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);
class MYPDF extends TCPDF
{
public $aobj_context;
public function setData($aobj_context)
{
$this->aobj_context = $aobj_context;
$this->fdate = $this->aobj_context->mobj_data["fdate"];
$this->univcode = $this->aobj_context->mobj_data["univcode"];
}
public function Header()
{
$bMargin = $this->getBreakMargin();
// get current auto-page-break mode
$auto_page_break = $this->AutoPageBreak;
// disable auto-page-break
$this->SetAutoPageBreak(false, 0);
// set bacground image
// $this->SetMargins(6,30,5,true);
$this->SetFillColor(248, 248, 255);
$img_path = $this->aobj_context->main_src . "/img/{$this->univcode}_logo.jpg";
if (file_exists($img_path))
$this->Image($img_path, 30, 6, 20, 20);
$this->SetFont('Times', 'B', 13);
$this->SetY(5);
$this->Cell(0, 4, $this->aobj_context->FUNIVNAME, 0, 1, 'C');
//state
$this->SetFont('Times', '', 11);
$this->Cell(0, 4, $this->aobj_context->s_state, 0, 1, 'C');
$this->SetFont('Times', 'BU', 12);
$this->Ln(1);
$cur_year = date("Y");
$this->SetFont('Times', '', 12);
$this->Cell(0, 5, 'Bundle Not Received', '0', 1, 'C');
// $this->Cell(0,6," Degree Group : ".$this->Deggrp,"0",1,"C");
$this->Cell(0,6," Exam Date : ".$this->fdate,"0",1,"C");
// restore auto-page-break status
$this->SetAutoPageBreak($auto_page_break, $bMargin);
// set the starting point for the page content
}
public function Footer()
{
$this->SetMargins(20, 40);
$this->SetY(-15);
$this->SetFont('helvetica', 'I', 8);
$this->Cell(40, 10, 'IP : ' . $_SERVER["REMOTE_ADDR"], 0, 0, 'L');
$this->Cell(80, 10, 'Date : ' . date("d-m-Y H:i:s"), 0, 0, 'C');
$this->Cell(70, 10, 'Page ' . $this->getPageNumGroupAlias() . '/' . $this->getPageGroupAlias(), 0, 1, 'R');
}
}
class BundRecvReport
{
function DefaultConstructor($aobj_context)
{
$this->aobj_context = $aobj_context;
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$this->ip = $_SERVER["REMOTE_ADDR"];
$get_date = "select DATE_FORMAT(now(), '%d/%m/%Y') as now_date";
$obj = $this->aobj_context->mobj_db->GetRow($get_date);
$get_coll_name = "select FUNIVNAME as 'FUNIVNAME',FUNIVCODE,
FUNIVADD1 as 'state', pdf_logo_path,
ifnull(FEXAMAPPREQ,'F') as FEXAMAPPREQ From control";
$lobj_get_coll_name = $this->aobj_context->pobj_db->GetRow($get_coll_name);
$aobj_context->FUNIVNAME = $lobj_get_coll_name['FUNIVNAME'];
$aobj_context->fexamdate = $fexamdate;
$aobj_context->s_state = $lobj_get_coll_name['state'];
$aobj_context->pdf_logo_path = $lobj_get_coll_name['pdf_logo_path'];
$aobj_context->FUNIVCODE = $lobj_get_coll_name['FUNIVCODE'];
// $this->Degree = $Deggrp;
// var_dump($this->Deggrp);
$this->current_date = $obj['now_date'];
$this->pdf = new MYPDF('L');
$this->pdf->setData($aobj_context);
}
function tableHeader($pdf)
{
$pdf->SetFont('Times', 'B', 11);
$pdf->Cell(8,6,"Sl.","LRT",0);
$pdf->Cell(10,6,"Colg","LRT",0,"C");
$pdf->Cell(79,6,"College","LRT",0,"C");
$pdf->Cell(10,6,"QP","LRT",0,"C");
$pdf->Cell(55,6,"Subject","LRT",0,"C");
$pdf->Cell(15,6,"Bundle","LRT",0,"C");
$pdf->Cell(15,6,"Total","LRT",1,"C");
$pdf->Cell(8,6,"No","LRB",0,"C");
$pdf->Cell(10,6,"Code","LRB",0,"C"); //w h txt brd pos align
$pdf->Cell(79,6,"Name","LBR",0,"C");
$pdf->Cell(10,6,"Code","LBR",0,"C");
$pdf->Cell(55,6,"Name","LBR",0,"C");
$pdf->Cell(15,6,"No.","LBR",0,"C");
$pdf->Cell(15,6,"Script","LBR",1,"C");
$pdf->SetFont('Times', '', 10);
}
function writeReport($BundNtRecv)
{
$pdf = $this->pdf;
$pdf->SetMargins(10, 39);
$pdf->startPageGroup();
$pdf->AddPage("P");
// $orientation = "P";
$pdf->SetFont('Times', '', 10);
$this->tableHeader($pdf);
$sl_no = 0;
foreach($BundNtRecv as $key=>$value){
$colname1 = substr($value['fcollname'],0,42);
$colname2 = substr($value['fcollname'],42);
$sl_no++;
$pdf->Cell(8, 6, $sl_no, "LRT", 0, 'C');
$pdf->Cell(10, 6, $value['fcollcode'], "LRT", 0, "C");
$pdf->Cell(79, 6, $colname1, "LRT", 0, "L");
$pdf->Cell(10, 6, $value['fqpcode'], "LRT", 0, "L");
$pdf->Cell(55, 6, $value['fsubname'], "LRT", 0, "L");
$pdf->Cell(15, 6, $value['fbuno'], "LRT", 0, "L");
$pdf->Cell(15, 6, $value['ftotscript'], "LRT", 1, "L");
if ($pdf->getY() > 260) {
$pdf->cell(192,1,'','T',1,'L');
$pdf->AddPage("P");
$this->tableHeader($pdf);
}
if($colname2)
{
$pdf->Cell(8,6,"","LBR",0);
$pdf->cell(10,6,"","LBR",0,"C");
$pdf->cell(79,6,$colname2,"LBR",0,"L");
$pdf->cell(10,6,"","LBR",0,"L");
$pdf->cell(55,6,"","LBR",0,"C");
$pdf->cell(15,6,"","LBR",0,"C");
$pdf->cell(15,6,"","LBR",1,"L");
// $pdf->cell(20,6,"","LBR",1,"R");
}
}
$pdf->cell(192,1,'','T',1,'L');
}
function SendOutput()
{
// ob_end_clean();
$this->pdf->Output("BundleNotReceivedReport_{$this->univcode}.pdf", "I");
}
}
function generateBundNotRecvRprt($aobj_context){
$fdate = $aobj_context->mobj_data["fdate"];
$univcode = $aobj_context->mobj_data["univcode"];
// var_dump($fdate,$univcode);
$date = str_replace('/', '-', $fdate);
$fdoe= date('Y-m-d', strtotime($date));
$query = "select concat(c.fcollname,',',c.ftown) as fcollname,d.fcollcode,d.fqpcode,fbuno,s.fsubname,ftotscript from colldesp d
inner join college c on c.fcollcode = d.fcollcode
inner join masqp s on s.fqpcode = d.fqpcode
where date_format(d.fdoe,'%Y-%m-%d')='$fdoe' and frecstatus is null
order by fcollcode";
// var_dump($query);
$result = $aobj_context->pobj_db->GetAll($query);
// var_dump($result);
$class_obj = new BundRecvReport();
$class_obj->univcode = $univcode;
$class_obj->DefaultConstructor($aobj_context);
$class_obj->writeReport($result);
$class_obj->SendOutput();
}
?>
|