0xV3NOMx
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.147.76.250


Current Path : /var/www/html/phdadm/pgetadm/
Upload File :
Current File : /var/www/html/phdadm/pgetadm/hallticket.php

<?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);

		$query = "update pgstudadm set fhtstatus = 'T'
		where fmobileno = '{$mob}'";
		$results = $this->aobj_context->mobj_db->Execute($query);

		$get_student_data="select d.fpgqpcode, d.fdegree, d.fdescpn, 
		concat(date_format(d.fpgdate,'%d/%m/%Y'),' [',dayname(d.fpgdate),']') as fdoe, fpgsession, 
		dt.fcntr, concat(cl.fcollcode, ' ', cl.fcollname, ', ', cl.ftown, ', ', cl.fcolladd1) as fcollege,
		sa.fappno, ucase(sa.fname) as fname, sa.fdob, sa.fphotopath from pgstudadm sa inner join pgstuddeg dt 
		on sa.fappno = dt.fappno inner join degree d on dt.fdegree = d.fdegree 
		and d.fexamno = 'A' inner join college cl on dt.fcntr = cl.fcollcode
		where ifnull(d.fpgqpcode,'') <> ''
		and sa.fmobileno = '{$mob}'
		and ifnull(fpaystatus,'') = 'success'
		group by sa.fappno, d.fpgqpcode
		order by d.fpgdate, fpgsession";
		//var_dump($get_student_data);
		$lobj_get_student_data = $this->aobj_context->mobj_db->GetAll($get_student_data);
		// var_dump($lobj_get_student_data['fphotopath']);
		$this->std_PHOTO=$lobj_get_student_data[0]['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(); 	
			
	
	$adm_details=$class_obj->getStudentDetails();

	// if(count($adm_details) == 0) {
	// 	$pdf->Output("report_adm_ticket.pdf","D");
	// }
	
	foreach($adm_details as $k => $v) {

		$pdf->SetFont('Times','',10);
		$pdf->AddPage();
		
		$pdf->Rect(10,5,190,110,'D');
		$class_obj->getUniversityDetails();

		$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' ,'0',1,'C'); 
		$pdf->SetFont('Times','B',11);
		$pdf->Cell(0,6,'POST GRADUATE 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,172,40,25,30);				
		$pdf->Rect(10,36,190,79,'D');

		$pdf->SetFont('Times','B',12); 

		$pdf->Cell(40,7,' Application. No.','LRB',0,'L');/* $pdf->Cell(6,6,' :  ',0,0,'L');*/

		$pdf->SetFont('Times','B',12);
		
		$pdf->Cell(5,7,substr($v['fappno'],0,1),'LRB',0,'C');
		$pdf->Cell(5,7,substr($v['fappno'],1,1),'LRB',0,'C');
		$pdf->Cell(5,7,substr($v['fappno'],2,1),'LRB',0,'C');
		$pdf->Cell(5,7,substr($v['fappno'],3,1),'LRB',0,'C');
		$pdf->Cell(5,7,substr($v['fappno'],4,1),'LRB',0,'C');
		$pdf->Cell(5,7,substr($v['fappno'],5,1),'LRB',0,'C');
		$pdf->Cell(5,7,substr($v['fappno'],6,1),'LRB',0,'C');
		$pdf->Cell(5,7,substr($v['fappno'],7,1),'LRB',0,'C');
		$pdf->Cell(5,7,substr($v['fappno'],8,1),'LRB',0,'C');
		$pdf->Cell(5,7,substr($v['fappno'],9,1),'LRB',0,'C');
		$pdf->Cell(5,7,substr($v['fappno'],10,1),'LRB',0,'C');

		$pdf->Cell(40,7,'QP Code','LRB',0,'C');

		$pdf->Cell(5,7,substr($v['fpgqpcode'],0,1),'LRB',0,'C');
		$pdf->Cell(5,7,substr($v['fpgqpcode'],1,1),'LRB',0,'C');
		$pdf->Cell(5,7,substr($v['fpgqpcode'],2,1),'LRB',0,'C');
		$pdf->Cell(5,7,substr($v['fpgqpcode'],3,1),'LRB',0,'C');
		$pdf->Cell(5,7,substr($v['fpgqpcode'],4,1),'LRB',1,'C');


		// $pdf->Cell(15,7,' ','LRB',1,'L');

		//$pdf->Cell(0,6,'','1',1,'L');
		$pdf->SetFont('Times','B',12);
		$pdf->Cell(40,7,"Candidate Name","LRB",0,'L'); /*$pdf->Cell(6,6,' :  ',0,0,'L');*/
		$pdf->SetFont('Times','',12);
		$pdf->Cell(120,7,$v['fname'],'LRB',1,'L');

		//$pdf->Cell(0,6,'',0,1,'L');
		$pdf->SetFont('Times','B',12);
		$pdf->Cell(40,7,"Subject",'LRB',0,'L'); /*$pdf->Cell(6,6,' :  ',0,0,'L');*/
		$pdf->SetFont('Times','',12);
		$pdf->Cell(120,7,$v['fdescpn'],'LRB',1,'L');

		//$pdf->Cell(0,6,'',0,1,'L');

		$x = $pdf->GetX();
		$y = $pdf->GetY();
		$pdf->SetFont('Times','',12);
		$pdf->SetX($x + 40);
		$pdf->MultiCell(120, 6, $v['fcollege'], "LRB","L");
		$y1 = $pdf->GetY();
		$h = $y1 - $y;    
		$pdf->SetXY($x, $y);
		// $pdf->SetFont('Times','',12);
		// $pdf->Cell(120,4,$v['fcollege'],'LRB',1,'L'); 

		$pdf->SetFont('Times','B',12);			 
		$pdf->Cell(40,$h,"Centre",'LRB',1,'L');/* $pdf->Cell(6,6,' :  ',0,0,'L');*/
		
		
		
		$pdf->SetFont('Times','B',12);
		$pdf->Cell(40,7,"Date of Exam",'LRB',0,'L'); /*$pdf->Cell(6,6,' :  ',0,0,'L');*/
		$pdf->SetFont('Times','',12);
		$pdf->Cell(120,7,$v['fdoe'].' '.$v['fpgsession'],'LRB',1,'L'); 
		$pdf->Cell(190,0,' ','T',1,'L');
		$regeva_fascimelie = $aobj_context->main_src."/img/controler_sign.png";
		$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(150,5,' '.' '.'Signature of the Candidate','0',0,'L');

		$pdf->Cell(60,5,'Registrar','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;
 }
?>