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.119.19.219
<?php
class AdmissionTicket
{
public $aobj_context;
public $std_FUNIVNAME ;
public $std_FTOWN;
public $std_LOGO;
public $std_ADDRESS;
public $std_PHOTO;
public $std_NAME;
public $std_SUBJECT;
public $std_REGNO;
public $std_mobile_no;
public $std_paystatus;
function __construct($aobj_context)
{
$this->aobj_context=$aobj_context;
$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
session_start();
}
function getUniversityDetails()
{
$page_header_university ="select FUNIVNAME,FTOWN,FUNIVADD1,pdf_logo_path from control";
$lobj_page_header_university = $this->aobj_context->mobj_db->GetRow($page_header_university);
$this->std_FUNIVNAME = $lobj_page_header_university['FUNIVNAME'];
$this->std_FTOWN = $lobj_page_header_university['FTOWN'];
$this->std_LOGO = $lobj_page_header_university['pdf_logo_path'];
$this->std_ADDRESS = $lobj_page_header_university['FUNIVADD1'];
}
function getStudentDetails()
{
session_start();
$mob=$_SESSION['MOBILE'];
$this->app_no = trim($this->aobj_context->mobj_data["rappno"]);
$this->dob = trim($this->aobj_context->mobj_data["rdob"]);
//var_dump($mob);
$get_student_data="SELECT UPPER(p.fname) as fname,p.fpaystatus,d.fdescpn,p.fphotopath,p.fregno
FROM phdstudadm p INNER JOIN degree d ON d.fdegree=p.fdegree
WHERE p.fappno='{$this->app_no}' and ifnull(fappstatus,'') = 'T' and ifnull(fform,'') = 'A'
and fdob = date_format(str_to_date('{$this->dob}','%d/%m/%Y'),'%Y-%m-%d')
and ifnull(fpaystatus,'') = 'success'";
// var_dump($get_student_data);
$lobj_get_student_data = $this->aobj_context->mobj_db->GetRow($get_student_data);
// var_dump($lobj_get_student_data);
$this->std_PHOTO=$lobj_get_student_data['fphotopath'];
$this->std_NAME=$lobj_get_student_data['fname'];
$this->std_SUBJECT=$lobj_get_student_data['fdescpn'];
$this->std_REGNO=$lobj_get_student_data['fregno'];
return $lobj_get_student_data;
// $this->std_paystatus = $lobj_page_header_university['fpaystatus'];
}
}
function generatehallticket($aobj_context)
{
$class_obj=new AdmissionTicket($aobj_context);
ini_set("memory_limit",-1);
ini_set('max_execution_time',3300);
$main_src=substr($_SERVER['SCRIPT_FILENAME'],0,strlen($_SERVER['SCRIPT_FILENAME'])-7);
$pdf_writer_class =$main_src."/tcpdf/tcpdf.php";
include($pdf_writer_class);
$pdf= new TCPDF();
$pdf->SetFont('Times','',10);
$pdf->AddPage();
$pdf->Rect(10,5,190,110,'D');
$adm_details=$class_obj->getUniversityDetails();
$adm_details=$class_obj->getStudentDetails();
if(count($adm_details) == 0) {
$pdf->Output("report_adm_ticket.pdf","D");
}
$pdf->SetLineWidth(0.01);
$pdf->SetFont('Times','B',14);
$img_path=$aobj_context->main_src.$class_obj->std_LOGO;
//var_dump($img_path);
if(file_exists($img_path))
$pdf->Image($img_path,15,9,25);
$pdf->Cell(0,4,$class_obj->std_FUNIVNAME,'0',1,'C');
$pdf->SetFont('Times','',9);
$pdf->cell(0,4, $class_obj->std_ADDRESS,"0",1,"C");
$pdf->SetFont('Times','B',12);
$pdf->Cell(0,5,'ADMISSION TICKET TO Ph.D' ,'0',1,'C');
$pdf->SetFont('Times','B',11);
$pdf->Cell(0,5,'Entrance Examination - 2019' ,'0',1,'C');
$pdf->Ln(5);
$width = 124;
$nb =0;
$nb=max($nb,NbLines(50,$value,''));
$yH = 7*$nb;
$full_photo_path=$aobj_context->main_src.$class_obj->std_PHOTO;
//var_dump($full_photo_path);
if(file_exists($full_photo_path))
$pdf->Image($full_photo_path,168,43,25,27);
$pdf->Rect(10,35,190,80,'D');
$pdf->SetFont('Times','B',12);
$pdf->Cell(30,7,' Reg. No.','LRB',0,'L');/* $pdf->Cell(6,6,' : ',0,0,'L');*/
$pdf->SetFont('Times','',12);
$pdf->Cell(5,7,substr($class_obj->std_REGNO,0,1),'LRB',0,'C');
$pdf->Cell(5,7,substr($class_obj->std_REGNO,1,1),'LRB',0,'C');
$pdf->Cell(5,7,substr($class_obj->std_REGNO,2,1),'LRB',0,'C');
$pdf->Cell(5,7,substr($class_obj->std_REGNO,3,1),'LRB',0,'C');
$pdf->Cell(5,7,substr($class_obj->std_REGNO,4,1),'LRB',0,'C');
$pdf->Cell(5,7,substr($class_obj->std_REGNO,5,1),'LRB',0,'C');
$pdf->Cell(5,7,substr($class_obj->std_REGNO,6,1),'LRB',0,'C');
$pdf->Cell(5,7,substr($class_obj->std_REGNO,7,1),'LRB',0,'C');
$pdf->Cell(80,7,' ','LRB',1,'L');
//$pdf->Cell(0,6,'','1',1,'L');
$pdf->SetFont('Times','B',12);
$pdf->Cell(30,7,"Name","LRB",0,'L'); /*$pdf->Cell(6,6,' : ',0,0,'L');*/
$pdf->SetFont('Times','',12);
$pdf->Cell(120,7,$class_obj->std_NAME,'LRB',1,'L');
//$pdf->Cell(0,6,'',0,1,'L');
$pdf->SetFont('Times','B',12);
$pdf->Cell(30,7,"Subject",'LRB',0,'L'); /*$pdf->Cell(6,6,' : ',0,0,'L');*/
$pdf->SetFont('Times','',12);
$pdf->Cell(120,7,$class_obj->std_SUBJECT,'LRB',1,'L');
//$pdf->Cell(0,6,'',0,1,'L');
$pdf->SetFont('Times','B',12);
$pdf->Cell(30,7,"Centre",'LRT',0,'L');/* $pdf->Cell(6,6,' : ',0,0,'L');*/
$pdf->SetFont('Times','',12);
$pdf->Cell(120,4,"Central College Campus",'LR',1,'L');
$pdf->Cell(30,1,"",'LRB',0,'L');
$pdf->Cell(120,1,"Bengaluru Central University,Bengaluru",'LRB',1,'L');
$pdf->SetFont('Times','B',12);
$pdf->Cell(30,7,"Date of Exam",'LRB',0,'L'); /*$pdf->Cell(6,6,' : ',0,0,'L');*/
$pdf->SetFont('Times','',12);
$pdf->Cell(120,7,"14/07/2019 (Sunday) 11:00 AM to 01:00 PM",'LRB',1,'L');
$pdf->Cell(190,0,' ','T',1,'L');
$regeva_fascimelie = $aobj_context->main_src."/img/controler_sign.jpg";
$x = $pdf->GetX();
$y = $pdf->GetY();
$pdf->Image($regeva_fascimelie,$x+145,$y,30,15);
$pdf->Ln(15);
$pdf->SetFont('Times','B',12);
$pdf->Cell(140,5,' '.' '.'Signature of the Candidate','0',0,'L');
$pdf->Cell(60,5,'Registrar (Evaluation)','0',1,'L');
$pdf->Cell(130,5,'','0',0,'L');
$pdf->Cell(100,5,'Bengaluru Central University','0',1,'L');
$pdf->Output("report_adm_ticket.pdf","D");
}
function NbLines($w,$txt,$pdf)
{
//Computes the number of lines a MultiCell of width w will take
$cw=&$pdf->CurrentFont['cw'];
if($w==0)
$w=$pdf->w-$pdf->rMargin-$pdf->x;
$wmax=($w-2*$pdf->cMargin)*1000/$pdf->FontSize;
$s=str_replace("\r",'',$txt);
$nb=strlen($s);
if($nb>0 and $s[$nb-1]=="\n")
$nb--;
$sep=-1;
$i=0;
$j=0;
$l=0;
$nl=1;
while($i<$nb){
$c=$s[$i];
if($c=="\n"){
$i++;
$sep=-1;
$j=$i;
$l=0;
$nl++;
continue;
}
if($c==' ')
$sep=$i;
$l+=$cw[$c];
if($l>$wmax)
{
if($sep==-1){
if($i==$j)
$i++;
} else
$i=$sep+1;
$sep=-1;
$j=$i;
$l=0;
$nl++;
}
else
$i++;
}
return $nl;
}
?>
|