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 : 18.216.57.57
<?php
$main_src=substr($_SERVER['SCRIPT_FILENAME'],0,strlen($_SERVER['SCRIPT_FILENAME'])-7);
$pdf_writer_class =$main_src."/tarka_pdf/fpdf.php";
require_once($pdf_writer_class);
class practicalmarksmisc_report extends FPDF
{
function DefaultConstructor($aobj_context)
{
session_start();
$this->aobj_context=$aobj_context;
$this->pdf= new FPDF();
$this->pdf=$this;
$this->degree_code_from = trim($this->aobj_context->mobj_data["degree_code_from"]);
$this->degree_code_to = trim($this->aobj_context->mobj_data["degree_code_to"]);
$this->examno_from = trim($this->aobj_context->mobj_data["examno_from"]);
$this->examno_to = trim($this->aobj_context->mobj_data["examno_to"]);
$this->ip=$_SERVER["REMOTE_ADDR"];
$get_date="select date_add(date_add(now(),INTERVAL 13 hour),interval 30 minute) as now_date";
$obj=$this->aobj_context->mobj_db->GetRow($get_date);
$this->current_date=$obj[now_date];
$this->collcode=$_SESSION['collcode'];
}
function Header()
{
$img_path=$this->aobj_context->main_src."/".$this->aobj_context->mobj_data["db"]."/".$this->photo_path;
if(!empty($this->photo_path) && file_exists($img_path))
{
$this->pdf->Image($img_path,166,50,50);
}
$img_logo_path=$this->aobj_context->main_src."/".$this->aobj_context->mobj_data["db"]."/".$this->pdf_logo_path;
if(!empty($this->pdf_logo_path))
{
$this->pdf->Image($img_logo_path,10,10,20);
}
$img_path2 = $this->aobj_context->main_src."/".$this->aobj_context->mobj_data["db"]."/img/logo2.jpg";
if(file_exists($img_path2))
{
$this->pdf->Image($img_path2,170,6,23,23);
}
$this->pdf->SetFont('Times','B',15);
$this->pdf->cell(180,3,$this->FUNIVNAME."","0",1,"C");
$this->pdf->SetFont('Times','B',8);
$this->pdf->cell(180,7, $this->s_state,"0",1,"C");
$this->pdf->SetFont('Times','B',13);
// $this->pdf->cell(180,7, $this->degree_details,"0",1,"C");
//$this->pdf->cell(173,7,$this->exam_details,"0",1,"C");
$this->pdf->SetFont('Times','B',11);
$this->pdf->Ln(4);
$this->pdf->Cell(180,7,"Practical Marks Misc","0",1,"C");
//$this->pdf->SetFont('Times','B',15);
$this->pdf->Ln(2);
//$this->pdf->SetFont('Times','',13);
}
function Footer()
{
$this->SetY(-15);
$this->pdf->SetFont('Times','B',8);
$this->Cell(140,6,'Printed : IP Address : '.$this->ip." Date ".$this->current_date,'0',0,'L');
$this->Cell(50,6,'Page '.$this->PageNo().' of {nb}',0,1,'R');
}
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'];
$query="SELECT CONCAT(fdegree, ' - ', FDESCPN) AS fdegree FROM degree where fdegree='{$this->degree_code}'";
$result=$this->aobj_context->mobj_db->GetRow($query);
//$this->degree_details = $result['fdegree'];
$this->degree_details = " Degree : {$result['fdegree']}";
$this->exam_details = " Exam : ".$this->examno." Semister";
}
function GetFullQry()
{
$query2 = "select pr.FDEGREE, pr.FEXAMNO, pr.FCOLLCODE, pr.FOCOLLCODE, pr.FSUBCODE, pr.FREGNO, pr.FMARKS11, concat(pr.fsubcode,'-',FSUBNAME) as fsubname from marks_pr_misc pr, subject s
where s.fdegree = pr.FDEGREE and s.fexamno = pr.fexamno and pr.fsubcode = s.fcsubcode
and pr.fdegree between '{$this->degree_code_from}' and '{$this->degree_code_to}' and pr.fexamno between '{$this->examno_from}' and '{$this->examno_to}'";
$this->result2 = $this->aobj_context->mobj_db->GetAll($query2);
}
function formData()
{
$this->pdf->SetMargins(8,12,10);
$this->pdf->AddPage();
$this->pdf->Rect(2,05,200,280,'D');
$empty_cell_width=2;
$sl_no=1;
$k2 = 1;
$first = true;
foreach($this->result2 as $dk => $dv)
{
if($k2 > 30)
{
$this->pdf->AddPage();
$this->pdf->Rect(2,05,200,280,'D');
$k2 = 1;
}
if($first == true || $k2 == 1)
{
$this->pdf->SetFont('Times','B',10);
$this->pdf->cell(8,5, "Sl. ","LRT",0,"C");
$this->pdf->cell(20,5, "College","LRT",0,"C");
$this->pdf->cell(20,5, "Degree","LRT",0,"C");
$this->pdf->cell(10,5, "Exam","LRT",0,"C");
$this->pdf->cell(100,5, "Subject Name","LRT",0,"L");
$this->pdf->cell(20,5, "Reg. No.","LRT",0,"C");
$this->pdf->cell(12,5, "Marks","LRT",1,"C");
$this->pdf->cell(8,5, "No.","LRB",0,"C");
$this->pdf->cell(20,5, "Code","LRB",0,"C");
$this->pdf->cell(20,5, " ","LRB",0,"C");
$this->pdf->cell(10,5, "No.","LRB",0,"C");
$this->pdf->cell(100,5, " ","LRB",0,"L");
$this->pdf->cell(20,5, "","LRB",0,"C");
$this->pdf->cell(12,5, " ","LRB",1,"C");
$first = false;
}
$this->pdf->SetFont('Times','',9);
$this->pdf->cell(8,7, $sl_no,"1",0,"C");
$this->pdf->cell(20,7, $dv['FCOLLCODE'],"1",0,"C");
$this->pdf->cell(20,7, $dv['FDEGREE'],"1",0,"C");
$this->pdf->cell(10,7, $dv['FEXAMNO'],"1",0,"C");
$this->pdf->cell(100,7, $dv['fsubname'],"1",0,"L");
$this->pdf->cell(20,7, $dv['FREGNO'],"1",0,"C");
$this->pdf->cell(12,7, $dv['FMARKS11'],"1",1,"C");
$sl_no++;
$k2++;
}
}
function SendOutput()
{
$this->pdf->Output("Practical_marks_misc.pdf","D");
}
}
function practicalmarksmiscreport($aobj_context)
{
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$class_obj=new practicalmarksmisc_report();
$class_obj->AliasNbPages();
$class_obj->DefaultConstructor($aobj_context);
$class_obj->GetFullQry();
$class_obj->formcolldata();
$class_obj->formData();
$class_obj->SendOutput();
}
?>
|