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.135.186.233
<?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);
include_once("stringspliter.php");
class report_ra_qp_wise_student_count extends FPDF
{
function DefaultConstructor($aobj_context)
{
session_start();
$this->aobj_context=$aobj_context;
$this->pdf= new FPDF();
$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->deg_from = trim($this->aobj_context->mobj_data["deg_from"]);
$this->deg_to = trim($this->aobj_context->mobj_data["deg_to"]);
$this->exam_from=trim($this->aobj_context->mobj_data["exam_from"]);
$this->exam_to=trim($this->aobj_context->mobj_data["exam_to"]);
$this->cat_from = trim($this->aobj_context->mobj_data["cat_from"]);
$this->cat_to = trim($this->aobj_context->mobj_data["cat_to"]);
$this->reg_from = trim($this->aobj_context->mobj_data["reg_from"]);
$this->reg_to = trim($this->aobj_context->mobj_data["reg_to"]);
$this->lowfee = trim($this->aobj_context->mobj_data["lowfee"]);
$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->photo_path;
if(!empty($this->photo_path) && file_exists($img_path))
{
$this->pdf->Image($img_path,166,50,50);
}
if(!empty($this->pdf_logo_path))
{
$img_logo_path=$this->aobj_context->main_src.$this->pdf_logo_path;
$this->pdf->Image($img_logo_path,10,10,20);
}
$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->college_details,"0",1,"C");
$this->pdf->cell(180,7, $this->degree_detials,"0",1,"C");
$this->pdf->SetFont('Times','B',11);
$this->pdf->Cell(180,7,"Fee Details","0",1,"C");
$this->pdf->SetFont('Times','B',15);
$this->pdf->Ln(2);
$empty_cell_width=2;
$this->pdf->SetFont('Times','',13);
$this->pdf->SetFont('Times','B',10);
$this->pdf->cell($empty_cell_width,7, ""," ",0,"C");
$this->pdf->cell(12,7, "Sl. No.","1",0,"C");
$this->pdf->cell(18,7, "Reg. No.","1",0,"C");
$this->pdf->cell(80,7, "Name","1",0,"L");
$this->pdf->cell(18,7, "Category","1",0,"C");
$this->pdf->cell(20,7, "App. No.","1",0,"C");
$this->pdf->cell(20,7, "Amount","1",0,"C");
$this->pdf->cell(30,7, "Date","1",1,"C");
$this->pdf->SetFont('Times','',9);
}
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',1,'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->f_year=$lobj_get_coll_name['f_year'];
$this->pdf_logo_path=$lobj_get_coll_name['pdf_logo_path'];
$get_data="SELECT c.FCOLLCODE,
CONCAT(c.FCOLLCODE, ' - ', c.FCOLLNAME,', ',c.FTOWN) AS FCOLLNAME FROM college c
where c.FCOLLCODE='{$this->collcode}'";
$obj_student=$this->aobj_context->mobj_db->GetRow($get_data);
$this->college_details=$obj_student[FCOLLNAME];
$this->degree_details=" College : {$this->FCOLLNAME}";
}
function GetFullQry()
{
$reporttype = "";
if($this->lowfee == 'T')
{
$reporttype = " and ac.FFEETYPE = 'Low Income' and FCATEGORY in('ST','SC')";
}else
{
$reporttype = "";
}
$get_data ="select GROUP_CONCAT(ac.fregno,'->',s.fname,'->',ac.FCATEGORY,'->',ac.appno,'->',ac.ftotalfee,'->',ac.frecptdate order by ac.fregno) as app,
ac.fdegree,ac.fcollcode,SUM(ac.ftotalfee) as amount
from appcandsum ac,student s
where s.fregno = ac.fregno and s.fdegree = ac.fdegree and ac.fcollcode = s.fcollcode
and IFNULL(ac.frecptdate,'0000-00-00') <> '0000-00-00' and IFNULL(ac.ftotalfee,'') <> ''
and ac.fcollcode between '{$this->coll_from}' and '{$this->coll_to}'
and ac.fregno between '{$this->reg_from}' and '{$this->reg_to}'
and ac.fdegree between '{$this->deg_from}' and '{$this->deg_to}' and ac.fexamno between '{$this->exam_from}' and '{$this->exam_to}' and ac.FCATEGORY between '{$this->cat_from}' and '{$this->cat_to}'
{$reporttype} and FPAYMENTCONFIRM = 'success'
group by ac.fcollcode,ac.fdegree
order by ac.fcollcode,ac.fdegree,ac.fexamno,ac.fregno";
//var_dump($get_data);
//$this->lowfee = trim($this->aobj_context->mobj_data["lowfee"]);
$this->lobj_get_data = $this->aobj_context->mobj_db->GetAll($get_data);
$this->FEXAMDATE=$this->lobj_get_data[0]['FEXAMDATE'];
}
function formData()
{
$this->pdf->SetMargins(8,12,10);
//$this->pdf->AddPage();
$empty_cell_width=2;
$sl_no=1;
$k2 = 1;
$first = true;
$degreenew = '';
$degreeold = '';
$collnew = '';
$collold = '';
foreach($this->lobj_get_data as $dk => $dv)
{
$degreenew = $dv['fdegree'];
$collnew = $dv['fcollcode'];
$query = "select distinct concat(fdegree,' - ',fdescpn) as degree from degree where fdegree = '{$degreenew}'";
$result = $this->aobj_context->mobj_db->GetRow($query);
$this->degree_detials = $result['degree'];
$query ="SELECT CONCAT(c.FCOLLCODE, ' - ', c.FCOLLNAME,', ',c.FTOWN) AS FCOLLNAME FROM college c
where c.FCOLLCODE='{$collnew}'";
$obj_student =$this->aobj_context->mobj_db->GetRow($query);
$this->college_details = $obj_student['FCOLLNAME'];
//var_dump($result['degree']);
$sl_no=1;
$k2 = 1;
if($k2 > 50)
{
$this->pdf->AddPage();
$k2 = 1;
}
if($degreenew != $degreeold || $collnew != $collold)
{
$this->pdf->AddPage();
$degreeold = $degreenew;
$collold = $collnew;
$first = true;
}
$data = explode(',',$dv['app']);
for($i=0;$i<count($data);$i++)
{
$feedet = explode('->',$data[$i]);
if($feedet[4] != NULL)
{
$this->pdf->cell($empty_cell_width,7, ""," ",0,"C");
$this->pdf->cell(12,7, $sl_no,"1",0,"C");
$this->pdf->cell(18,7, $feedet[0],"1",0,"C");
$this->pdf->cell(80,7, $feedet[1],"1",0,"L");
$this->pdf->cell(18,7, $feedet[2],"1",0,"C");
$this->pdf->SetFont('Times','',8);
$this->pdf->cell(20,7, $feedet[3],"1",0,"L");
$this->pdf->SetFont('Times','',9);
$this->pdf->cell(20,7, $feedet[4],"1",0,"C");
$this->pdf->cell(30,7, $feedet[5],"1",1,"C");
//if($this->pdf->GetY() > 270)
//var_dump($this->pdf->GetY());
$sl_no++;
$k2++;
}
}
$this->pdf->cell($empty_cell_width,7, ""," ",0,"C");
$this->pdf->cell(148,7,'Total Amount',"1",0,"C");
$this->pdf->cell(50,7, $dv['amount'],"1",1,"L");; //178
}
$this->pdf->cell(188,1, "","T",0,"C");
}
function SendOutput()
{
$this->pdf->Output("Fee_Details.pdf","D");
}
}
function Generateappfeedetails($aobj_context)
{
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$class_obj=new report_ra_qp_wise_student_count();
$class_obj->AliasNbPages();
$class_obj->DefaultConstructor($aobj_context);
$class_obj->GetFullQry();
$class_obj->formcolldata();
$class_obj->formData();
$class_obj->SendOutput();
}
?>
|