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.138.178.162
<?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);
$pdf_writer_class =$main_src."/tcpdf/tcpdf.php";
require_once($pdf_writer_class);
//require_once('admChallanEntryDetails.php');
require('rotation.php');
//require('code39.php');
class applicationFormReport
{
function DefaultConstructor($aobj_context)
{
$this->aobj_context=$aobj_context;
$this->pdf= new TCPDF();
//$this->pdf=$this;
session_start();
$this->collcode = $_SESSION['collcode'];
//var_dump($this->collcode);
$this->amount = trim($this->aobj_context->mobj_data["amount"]);
$this->totapp = trim($this->aobj_context->mobj_data["totapp"]);
$this->docno = trim($this->aobj_context->mobj_data["docno"]);
$this->FPAYMENTYPE = trim($this->aobj_context->mobj_data["FPAYMENTYPE"]);
//var_dump($this->FPAYMENTYPE.'--'.$this->docno.'--'.$this->totapp.'---'.$this->amount);
$this->ip=$_SERVER["REMOTE_ADDR"];
}
function formcolldata()
{
$get_coll_name="select FUNIVCODE, FUNIVNAME as 'FUNIVNAME',
FUNIVADD1 as 'state', pdf_logo_path,ifnull(FEXAMAPPREQ,'F') as FEXAMAPPREQ, concat('[',college.fcollcode,'] - ',college.fcollname,', ',college.ftown) as fcollname,
FSHORTUNIV From control, college where fcollcode = '{$this->collcode}'";
$lobj_get_coll_name=$this->aobj_context->mobj_db->GetRow($get_coll_name);
//var_dump($get_coll_name);
$this->FUNIVCODE = $lobj_get_coll_name['FUNIVCODE'];
$this->FUNIVNAME = $lobj_get_coll_name['FUNIVNAME'];
$this->FSHORTUNIV = $lobj_get_coll_name['FSHORTUNIV'];
$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'];
$this->FEXAMAPPREQ = $lobj_get_coll_name['FEXAMAPPREQ'];
$this->fcollname = $lobj_get_coll_name['fcollname'];
$this->pdf_Postlogo_path = "/img/post_logo.jpg";
}
function GetBankDetails()
{
$get_data="SELECT bank_name, acc_no, branch_name, branch_code,
ifsc_code, cheque_favour, place,bank_charge
FROM acc_mas where payment_type='{$this->FPAYMENTYPE}'";
$lobj_get_data= $this->aobj_context->mobj_db->GetRow($get_data);
$this->bank_name=$lobj_get_data['bank_name'];
$this->acc_no=$lobj_get_data['acc_no'];
$this->branch_name=$lobj_get_data['branch_name'];
$this->branch_code=$lobj_get_data['branch_code'];
$this->ifsc_code=$lobj_get_data['ifsc_code'];
$this->cheque_favour=$lobj_get_data['cheque_favour'];
$this->place=$lobj_get_data['place'];
$this->bank_charge=$lobj_get_data['bank_charge'];
}
function GetData()
{
$this->GetBankDetails();
}
function WriteRect()
{
$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);
require_once("getnumword.php");
$this->current_date=$obj[now_date];
//$this->pdf = new PDF_Rotate();
$this->pdf= new TCPDF();
$this->pdf->SetMargins(2,5,2);
$this->pdf->addPage('L');
$width=96;
$this->pdf->Rect(2,5,$width,200);
$this->pdf->Rect(2+$width+2,5,$width,200);
$this->pdf->Rect(2+$width+$width+4,5,$width,200);
if(!empty($this->pdf_logo_path))
{
$img_logo_path=$this->aobj_context->main_src."/".$this->aobj_context->mobj_data["db"]."/".$this->pdf_logo_path;
$this->pdf->Image($img_logo_path,4,7,13);
$this->pdf->Image($img_logo_path,$width+6,7,13);
$this->pdf->Image($img_logo_path,$width+$width+7,7,13);
}
$width=96;
$this->pdf->Rect(2,5,$width,200);
$this->pdf->Rect(2+$width+2,5,$width,200);
$this->pdf->Rect(2+$width+$width+4,5,$width,200);
if(!empty($this->pdf_Postlogo_path))
{
$img_logo_path=$this->aobj_context->main_src."/".$this->aobj_context->mobj_data["db"]."/".$this->pdf_Postlogo_path;
$this->pdf->Image($img_logo_path,80,7,13);
$this->pdf->Image($img_logo_path,$width+82,7,13);
$this->pdf->Image($img_logo_path,$width+$width+85,7,13);
}
$this->pdf->setY(5);
}
function formData($label)
{
$style = array(
'position' => 'right',
'align' => 'C',
'stretch' => false,
'fitwidth' => true,
'cellfitalign' => '',
'border' => false,
'hpadding' => 'auto',
'vpadding' => 'auto',
'fgcolor' => array(0,0,0),
'bgcolor' => false, //array(255,255,255),
'text' => true,
'font' => 'helvetica',
'fontsize' => 8,
'stretchtext' => 3
);
$line_height=5;
$width=96;
$x_pos=2;
if($this->pos==2)
$x_pos=2+$width+2;
if($this->pos==3)
$x_pos=2+$width+2+$width+2;
$jump_width=$width;
if($this->pos==2)
$jump_width=$width;
else if($this->pos==3)
$jump_width=$width;
$this->pdf->SetX($x_pos);
$this->old_y=$this->pdf->GetY();
$this->pdf->SetFont('Times','B',9);
if($this->FUNIVCODE=="032")
$this->pdf->multiCell($jump_width,3,$this->FUNIVNAME,0,"C");
else
$this->pdf->Cell($jump_width,$line_height,$this->FUNIVNAME,'0',1,'C');
$this->pdf->SetFont('Times','B',8);
$this->pdf->SetX($x_pos);
$this->pdf->Cell($jump_width,$line_height,$this->s_state,'0',1,'C');
$this->pdf->SetFont('Times','BU',9);
$this->pdf->SetX($x_pos);
$this->pdf->Cell($jump_width,$line_height,'Payment Challan - '.$label,'0',1,'C');
$this->pdf->Ln(2);
$this->pdf->SetFont('Times','B',9);
// Postal charges calculation.
if($this->FUNIVCODE=="003" || $this->FUNIVCODE=="008")
{
if($this->FTOTALFEE <= 1500)
$postal_charges = 20;
else if($this->FTOTALFEE >1500 && $this->FTOTALFEE <=5000)
$postal_charges = 30;
else if($this->FTOTALFEE >5000 && $this->FTOTALFEE <=10000)
$postal_charges = 40;
else if($this->FTOTALFEE >10000 && $this->FTOTALFEE <=15000)
$postal_charges = 50;
else
$postal_charges = 60;
}
else if($this->FUNIVCODE=="026" || $this->FUNIVCODE=="033" || $this->FUNIVCODE=="034")
{
$postal_charges = 20;
}
else if($this->FUNIVCODE == "017")
{
$postal_charges = 0;
}
if($this->FUNIVCODE=="033")
$biller = "Divisional Biller ID";
else
$biller = "Circle Biller ID";
if($this->screentype == 're')
{
$this->barcodeNo = $this->app_no.$this->fregno.str_pad($this->FTOTALFEE+$postal_charges,5, "0", STR_PAD_LEFT);
}else
{
$this->barcodeNo = $this->amount.$this->fslno.$this->college_code.str_pad($this->FTOTALFEE+$postal_charges,5, "0", STR_PAD_LEFT);
}
$this->barcodeNo = $this->docno.$this->fregno.str_pad($this->amount+$postal_charges,5, "0", STR_PAD_LEFT);
$this->pdf->SetX($x_pos+1);
$this->pdf->Cell(($jump_width-2)*.35,$line_height,"{$biller}",'1',0,'L');
$this->pdf->Cell(($jump_width-2)*.65,$line_height,"{$this->FSHORTUNIV}",'1',1,'L');
$this->pdf->SetX($x_pos+1);
$this->pdf->Cell(($jump_width-2)*.35,$line_height,"Reference No. ",'1',0,'L');
$this->pdf->Cell(($jump_width-2)*.65,$line_height,"{$this->docno}",'1',1,'L');
$this->pdf->SetX($x_pos+1);
$this->pdf->Cell(($jump_width-2)*.35,$line_height,"Total Application No.",'1',0,'L');
$this->pdf->Cell(($jump_width-2)*.65,$line_height,"{$this->totapp}",'1',1,'L');
$this->pdf->SetX($x_pos+1);
$this->pdf->Cell(($jump_width-2)*.35,$line_height,"Total Amount ",'1',0,'L');
$this->pdf->Cell(($jump_width-2)*.65,$line_height,"{$this->amount}/-",'1',1,'L');
$this->pdf->SetX($x_pos+1);
$this->pdf->Cell(($jump_width-2)*.35,$line_height,"College ",'1',0,'L');
$this->pdf->Cell(($jump_width-2)*.65,$line_height,"{$this->collcode}",'1',1,'L');
$this->pdf->Ln(2);
$this->pdf->SetX($x_pos+1);
$this->pdf->SetFont('Times','B',10);
if($this->FUNIVCODE !="017")
{
$tdd1_width=$jump_width*(0.25)-1;
$tdd2_width=($jump_width)*.25 ;
$tdd3_width=($jump_width)*.25 ;
$tdd4_width=($jump_width)*.25-1;
$this->pdf->Cell($tdd2_width,$line_height,"Course Fee",'1',0,'C');
$this->pdf->Cell($tdd3_width,$line_height,"Postal Charges",'1',0,'C');
$this->pdf->Cell($tdd4_width,$line_height,"Total",'1',1,'C');
$this->pdf->SetX($x_pos+1);
$this->pdf->Cell($tdd2_width,$line_height,"Rs {$this->amount}/-",'1',0,'C');
$this->pdf->Cell($tdd3_width,$line_height,"Rs {$postal_charges}/-",'1',0,'C');
$total=($this->amount+$postal_charges);
$this->pdf->Cell($tdd4_width,$line_height,"Rs {$total}/-",'1',1,'C');
}
$this->pdf->ln(30);
$this->pdf->SetX($x_pos+1);
$this->pdf->Cell($jump_width,$line_height,"Date Signature of Remitter",'0',1,'L');
$this->pdf->ln(20);
$this->pdf->SetX($x_pos+1);
$this->pdf->Cell($jump_width,$line_height,"Date & Seal Signature of Receiver",'0',1,'L');
$this->pdf->SetFont('Times','',9);
$this->pdf->Ln(5);
$this->pdf->SetX($x_pos+1);
if($this->FUNIVCODE=="026")
{
$this->pdf->MultiCell($jump_width-20,$line_height,'Note: 1. Payment accepted at all e payment Post Offices across the state.',0,"L");
}
else
{
$this->pdf->MultiCell($jump_width-20,$line_height,'Note: 1. Payment accepted at all e payment Post Offices in Karnataka only.',0,"L");
}
$this->pdf->Ln(1);
$this->pdf->SetX($x_pos+1);
$this->pdf->Cell(($jump_width-2)*.10,$line_height,"Date : ",'0',0,'L');
$this->pdf->Cell($jump_width*.80,$line_height,"{$this->fdate}",'0',1,'L');
$this->pdf->SetX($x_pos+5);
$this->pdf->write1DBarcode($this->barcodeNo, 'C39', '1', '173.9','100', 16, 0.22, $style, 'R');
$this->pdf->write1DBarcode($this->barcodeNo, 'C39', '100', '173.9','100', 16, 0.22, $style, 'R');
$this->pdf->write1DBarcode($this->barcodeNo, 'C39', '199', '173.9','100', 16, 0.22, $style, 'R');
$this->pdf->SetY($this->old_y);
$img_path = $this->aobj_context->main_src.$this->photo_path;
}
function WriteHallTicket()
{
$aobj_context=$this->aobj_context;
ini_set("memory_limit",-1);
ini_set('max_execution_time',3300);
//$pdf=$this->pdf;
//var_dump($query);
$this->pdf->SetMargins(20,5,20,5);
//$pdf->SetMargins(28,3);
$this->pdf->aobj_context =$aobj_context ;
$this->pdf->SetFillColor(248, 248 ,255);
$this->pdf->SetFont('Times','',10);
$this->pdf->AddPage("P");
$this->pdf->Rect(5,05,200,289);
$img_path = $aobj_context->main_src."/".$this->aobj_context->mobj_data["db"]."/img/logo.jpg";
if(file_exists($img_path))
$this->pdf->Image($img_path,15,6,20,20);
$this->pdf->SetFont('helvetica','B',15);
$this->pdf->Ln(2);
$this->pdf->Cell(180,4,$this->FUNIVNAME,0,1,'C');
$this->pdf->SetFont('Times','',12);
$this->pdf->Ln(2);
$this->pdf->Cell(180,4,'College : '.$this->fcollname,0,1,'C');
$this->pdf->SetFont('helvetica','B',12);
$this->pdf->Ln(2);
$this->pdf->Cell(180,4,'Application Details',0,1,'C');
$this->pdf->SetFont('Times','B',11);
$this->pdf->ln(8);
$this->pdf->SetTextColor(0,0,0);
$this->pdf->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,
FFEEPAID as TOTAL_FEE,DATE_FORMAT(FLOGDATE,'%d/%m/%Y') AS FAPPDATE
FROM studadm
WHERE FCOLLCODE='{$this->collcode}' and FCHALNO ='{$this->docno}'";
//var_dump("Get Student Data".$get_data);
$lobj_get_get_data= $this->aobj_context->mobj_db->GetAll($get_data);
foreach($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(180,5, "Date : ","0",1,"L");
$this->pdf->cell(180,5, "Signature of Principal","0",1,"R");
$this->pdf->SetTextColor(0,0,0);
}
function SendOutput()
{
$this->pdf->Output("application_letter_{$this->app_no}.pdf","I");
}
}
function PrintApplicationFormAdmPOSTOFFICE($aobj_context)
{
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
$class_obj=new applicationFormReport();
$class_obj->DefaultConstructor($aobj_context);
$class_obj->formcolldata();
$class_obj->GetData();
$class_obj->WriteRect();
$class_obj->pos=1;
$class_obj->formData("Post Office Copy");
$class_obj->pos=2;
$class_obj->formData("College Copy");
$class_obj->pos=3;
$class_obj->formData("Student Copy");
$class_obj->WriteHallTicket();
$class_obj->SendOutput();
}
?>
|