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.142.174.8
<?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 PrintChallanEntryDetails extends FPDF
{
function DefaultConstructor($aobj_context)
{
$this->aobj_context=$aobj_context;
$this->pdf= new FPDF();
$this->pdf=$this;
session_start();
$this->ip=$_SERVER["REMOTE_ADDR"];
$this->collcode=$_SESSION['collcode'];
$this->print_type=trim($this->aobj_context->mobj_data["print_type"]);
$this->doc_no=trim($this->aobj_context->mobj_data["doc_no"]);
if($this->print_type=="Univ")
{
$get_date="select FCOLLCODE from chaldet where FDOCNO='{$this->doc_no}'";
$obj=$this->aobj_context->mobj_db->GetRow($get_date);
$this->collcode=$obj['FCOLLCODE'];
}
$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];
}
function Header()
{
}
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().'',0,1,'R');// of {nb}
}
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_coll_name="SELECT FCOLLCODE,concat(FCOLLNAME,', ', FTOWN) AS FCOLLNAME
FROM college where FCOLLCODE='{$this->collcode}'";
$lobj_get_coll_name=$this->aobj_context->mobj_db->GetRow($get_coll_name);
$this->FCOLLCODE=$lobj_get_coll_name['FCOLLCODE'];
$this->FCOLLNAME=$lobj_get_coll_name['FCOLLNAME'];
}
function formData()
{
$this->pdf->SetMargins(6,12,10);
$this->pdf->AddPage();
$img_path=$this->aobj_context->main_src."/".$this->aobj_context->mobj_data["db"]."/".$this->pdf_logo_path;
if(!empty($this->pdf_logo_path) && file_exists($img_path))
{
$this->pdf->Image($img_path,10,10,20);
}
$this->pdf->SetFont('Times','B',15);
$this->pdf->cell(200,3,"".$this->FUNIVNAME,"0",1,"C");
$this->pdf->SetFont('Times','B',8);
$this->pdf->cell(200,6, $this->s_state,"0",1,"C");
$this->pdf->SetFont('Times','B',11);
$this->pdf->Cell(200,6,"Admission Challan Statement","0",1,"C");
$this->pdf->cell(200,6, $this->FCOLLCODE." - ".$this->FCOLLNAME,"0",1,"C");
$this->pdf->SetFont('Times','B',15);
$this->pdf->Cell(200,7,"Document Number : {$this->doc_no}","0",1,"C");
$this->pdf->ln(2);
$this->SetFillColor(10,9,9);
$this->Cell(200,0.30,"","T",1,'C',true);
$this->pdf->ln(8);
}
function GetFullQry()
{
$get_data="SELECT FAPPNO, FNAME, FEXAMNO, FDEGREE,
TOTAL_FEE,DATE_FORMAT(FLOGDATE,'%d/%m/%Y') AS FAPPDATE
FROM studadm
WHERE FCOLLCODE='{$this->collcode}' and FCHALNO ='{$this->doc_no}'";
//var_dump("Get Student Data".$get_data);
$this->lobj_get_get_data= $this->aobj_context->mobj_db->GetAll($get_data);
}
function WriteDocDetails()
{
$this->pdf->SetFont('Times','B',11);
$this->SetFillColor(62,63,63);
$this->pdf->SetTextColor(255,255,255);
$this->pdf->cell(200,5, "Payment Details","1",1,"L",true);
$this->pdf->SetTextColor(0,0,0);
$this->SetFillColor(219,217,217);
$this->pdf->ln(2);
$this->pdf->SetFont('Times','B',9);
$this->pdf->cell(25,7, "Document Date","1",0,"C",true);
$this->pdf->cell(25,7, "Challan No.","1",0,"C",true);
$this->pdf->cell(25,7, "Challan Date","1",0,"C",true);
$this->pdf->cell(25,7, "Challan Amount","1",0,"C",true);
$this->pdf->cell(25,7, "No. of Appl.","1",1,"C",true);
$get_challan_details="SELECT IFNULL(DATE_FORMAT(FCHALDATE,'%d/%m/%Y'),'')
AS FDOCDATE,
IFNULL(FRECNO,'') AS FCHALLANNO,
DATE_FORMAT(IFNULL(FCOLACKDATE,'0000-00-00'),'%d/%m/%Y') AS FCHALLANDATE,
IFNULL(FCHALAMT,0) AS FCHALLANAMOUNT,
IFNULL(FAPPCNT,'') FAPPCNT
FROM chaldet WHERE FCOLLCODE='{$this->collcode}' and FCHALNO='{$this->doc_no}'";
//var_dump("Get Challan Details ".$get_challan_details);
$lobj_get_get_challan_details = $this->aobj_context->mobj_db->GetRow($get_challan_details);
$height=5;
$sl_no=1;
$this->pdf->SetFont('Times','',9);
$this->pdf->cell(25,$height, $lobj_get_get_challan_details['FDOCDATE'],"1",0,"C");
$this->pdf->cell(25,$height, $lobj_get_get_challan_details['FCHALLANNO'],"1",0,"C");
$this->pdf->cell(25,$height, $lobj_get_get_challan_details['FCHALLANDATE'],"1",0,"C");
$this->pdf->cell(25,$height, $lobj_get_get_challan_details['FCHALLANAMOUNT'],"1",0,"C");
$this->pdf->cell(25,$height, $lobj_get_get_challan_details['FAPPCNT'],"1",1,"C");
$this->pdf->ln(8);
}
function GetQry()
{
$this->pdf->SetFont('Times','B',11);
$this->SetFillColor(62,63,63);
$this->pdf->SetTextColor(255,255,255);
$this->pdf->cell(200,5, "Applications","1",1,"L",true);
$this->pdf->SetTextColor(0,0,0);
$this->SetFillColor(219,217,217);
$this->pdf->ln(2);
$this->pdf->SetFont('Times','B',9);
$this->pdf->cell(10,7, "Sl. No.","1",0,"C",true);
$this->pdf->cell(25,7, "App. No.","1",0,"C",true);
$this->pdf->cell(21,7, "Applied. Date","1",0,"C",true);
$this->pdf->cell(75,7, "Student Name","1",0,"L",true);
$this->pdf->cell(10,7, "Exam","1",0,"C",true);
$this->pdf->cell(16,7, "Degree","1",0,"C",true);
$this->pdf->cell(16,7, "Fee Paid","1",1,"C",true);
$height=5;
$sl_no=1;
$this->pdf->SetFont('Times','',9);
/*$get_data="SELECT FAPPNO, FNAME, FEXAMNO, FDEGREE,
TOTAL_FEE,DATE_FORMAT(FLOGDATE,'%d/%m/%Y') AS FAPPDATE
FROM studadm
WHERE FCOLLCODE='{$this->collcode}' and FCHALNO ='{$this->doc_no}'";
$this->lobj_get_get_data = $this->aobj_context->mobj_db->GetAll($get_data);*/
foreach($this->lobj_get_get_data as $ak=>$av)
{
$sub_code=$ak;
$this->pdf->cell(10,$height, $sl_no,"1",0,"C");
$this->pdf->cell(25,$height, $av['FAPPNO'],"1",0,"C");
$this->pdf->cell(21,$height, $av['FAPPDATE'],"1",0,"C");
$this->pdf->cell(75,$height, $av['FNAME'],"1",0,"L");
$this->pdf->cell(10,$height, $av['FEXAMNO'],"1",0,"C");
$this->pdf->cell(16,$height, $av['FDEGREE'],"1",0,"C");
$this->pdf->cell(16,$height, $av['TOTAL_FEE'],"1",1,"C");
$sl_no++;
}
$this->pdf->SetFont('Times','B',11);
$this->pdf->ln(11);
$this->pdf->cell(200,5, "Signature of Principal","0",1,"R");
$this->pdf->SetTextColor(0,0,0);
}
function SendOutput()
{
$this->pdf->Output("challan_details_{$this->doc_no}.pdf","D");
}
}
function PrintAdmChallanEntryDetails($aobj_context)
{
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$class_obj=new PrintChallanEntryDetails();
$class_obj->AliasNbPages();
$class_obj->DefaultConstructor($aobj_context);
$class_obj->formcolldata();
$class_obj->GetFullQry();
$class_obj->formData();
$class_obj->WriteDocDetails();
$class_obj->GetQry();
$class_obj->SendOutput();
}
?>
|