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.15.195.84


Current Path : /proc/thread-self/root/var/www/oasis/src/
Upload File :
Current File : //proc/thread-self/root/var/www/oasis/src/prientCodeStikers.php

<?php
$main_src=substr($_SERVER['SCRIPT_FILENAME'],0,strlen($_SERVER['SCRIPT_FILENAME'])-7);
//$pdf_writer_class =$main_src."/tarka_pdf/fpdf.php";
$pdf_writer_class =$main_src."/tcpdf/tcpdf.php";
require_once($pdf_writer_class);
// require_once("report_hall_ticket.php");	

class CodeStikers
{	

	function DefaultConstructor($aobj_context)
	{
		$this->aobj_context=$aobj_context;
		//$this->pdf=  new FPDF();
		//$this->pdf= new TCPDF();
		$this->pdf=$this;
		
		$this->subcodefrom = trim($this->aobj_context->mobj_data["subcodefrom"]);
		$this->subcodeto = trim($this->aobj_context->mobj_data["subcodeto"]);

		$this->regfrom = trim($this->aobj_context->mobj_data["regfrom"]);
		$this->regto = trim($this->aobj_context->mobj_data["regto"]);

		$this->batchfrom = trim($this->aobj_context->mobj_data["batchfrom"]);
		$this->batchto = trim($this->aobj_context->mobj_data["batchto"]);

		$this->distfrom = trim($this->aobj_context->mobj_data["distfrom"]);
		$this->distto = trim($this->aobj_context->mobj_data["distto"]);

		$this->sectionfrom = trim($this->aobj_context->mobj_data["sectionfrom"]);
		$this->sectionto = trim($this->aobj_context->mobj_data["sectionto"]);

		$this->ip=$_SERVER["REMOTE_ADDR"];

		$this->pdf= new TCPDF('R');
		$this->pdf->SetMargins(2,2);			
	}

	function formcolldata()
	{
		$get_coll_name="select FUNIVNAME as 'FUNIVNAME',FUNIVCODE,
		ftown as 'state', flogopath as pdf_logo_path, fadmname 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->pdf_logo_path=$lobj_get_coll_name['pdf_logo_path'];
		$this->FUNIVCODE=$lobj_get_coll_name['FUNIVCODE']; 
		$this->fadmname=$lobj_get_coll_name['fadmname']; 
	}
	
	function WriteHallTicket($aobj_context)
	{
		$aobj_context=$this->aobj_context;
				  	
		$pdf=$this->pdf; 	
		//var_dump($query);
		$pdf->SetMargins(5,2);	
		//$pdf->SetMargins(28,3);
		$pdf->aobj_context =$aobj_context ;
		
		$pdf->SetAutoPageBreak(true, 0);

        $pdf->SetFillColor(255, 255 ,255);	
		$pdf->SetFont('Times','',10);
		$pdf->AddPage("P");
		$pdf->Ln(5);

		$i = 1;

		$get_coll_name="select fregno from student limit 100";
		$lobj_get_coll_name = $aobj_context->mobj_db->GetAll($get_coll_name);
		
		
		$bot = '77';
            // define barcode style
            $style = array(
                'position' => '',
                'align' => 'C',
                'stretch' => false,
                'fitwidth' => true,
                'cellfitalign' => '',
                'hpadding' => 'auto',
                'vpadding' => 'auto',
                'fgcolor' => array(0,0,0),
                'bgcolor' => false, //array(255,255,255),
                'text' => false,
                'font' => 'helvetica',
                'fontsize' => 8,
                'stretchtext' => 4
            );

			
			$i =0;
			$x = 2;
			$a = 1;
			$cell = '30';
			foreach($lobj_get_coll_name as $val) 
			{ 

				if($a>4)
				{
					$a=1;
					$x=$x+21;
					$i++;
				}

				if($i>13)
				{
					$pdf->SetMargins(5,2);
					$pdf->SetAutoPageBreak(true, 0);
					$pdf->SetFillColor(255, 255 ,255);	
					$pdf->SetFont('Times','',10);
					$pdf->AddPage("P");
					$pdf->Ln(5);
					$x = 2;
					$i=0;
				}

				if($a=='1')
				{	
					$w = 5;
					
				}
				if($a=='2')
					$w = 56;
				if($a=='3')
					$w = 108;
				if($a=='4')
					$w = 159;
				
				$string = $val['fregno']."-".$val['fsubcode'];
				$string1 = $val['fsection']."-".$val['fdist_code']."-".$val['fregno'].'-'.$val['fsubcode']."(".$val['fbatch_code'].")";
				
				$pdf->write1DBarcode($string, 'C39', $w, $x,'45', 17, 0.3, $style, 'R');
				$pdf->setXY($w+1,$x+15);
				//$pdf->setY($x+10);
				$pdf->cell($cell, 6, $string1 , "0", 0, "L");
				$a++;

			}
			// 	if($i>13)
			// 	{
			// 		$pdf->SetMargins(5,2);
			// 		$pdf->SetAutoPageBreak(true, 0);
			// 		$pdf->SetFillColor(255, 255 ,255);	
			// 		$pdf->SetFont('Times','',10);
			// 		$pdf->AddPage("P");
			// 		$pdf->Ln(5);
			// 		$x = 2;
			// 		$i=0;
			// 	}

			// 	if($a=='1')
			// 		$w = 5;
			// 	if($a=='2')
			// 		$w = 56;
			// 	if($a=='3')
			// 		$w = 108;
			// 	if($a=='4')
			// 		$w = 159;


			// 	$string = "AS".$qpcode.str_pad($z,4,"0",STR_PAD_LEFT).str_pad($packtscripts,2,"0",STR_PAD_LEFT);
			// 	$pdf->write1DBarcode($string, 'C39', $w, $x,'45', 16, 0.3, $style, 'R');
			// 	$a++;
			
			// 	if($a=='1')
			// 		$w = 5;
			// 	if($a=='2')
			// 		$w = 56;
			// 	if($a=='3')
			// 		$w = 108;
			// 	if($a=='4')
			// 		$w = 159;
				

			// 	$string = "CS".$qpcode.str_pad($z,4,"0",STR_PAD_LEFT).str_pad($packtscripts,2,"0",STR_PAD_LEFT);
			// 	$pdf->write1DBarcode($string, 'C39', $w, $x,'45', 16, 0.3, $style, 'R');
			// 	$a++;
			// 	$x1 = $pdf->getX();
		
			// 	for ($c=1; $c <=$packtscripts; $c++) { 
					
			// 		if($a>4)
			// 		{
			// 			$a=1;
			// 			$x=$x+21;
			// 			$i++;
			// 		}

			// 		if($i>13)
			// 		{
			// 			$pdf->SetMargins(5,2);
			// 			$pdf->SetAutoPageBreak(true, 0);
			// 			$pdf->SetFillColor(255, 255 ,255);	
			// 			$pdf->SetFont('Times','',10);
			// 			$pdf->AddPage("P");
			// 			$pdf->Ln(5);
			// 			$x = 2;
			// 			$i=0;
			// 		}

			// 		$y = $pdf->getY();
					
			// 		if($a=='1')
			// 			$w = 5;
			// 		if($a=='2')
			// 			$w = 56;
			// 		if($a=='3')
			// 			$w = 108;
			// 		if($a=='4')
			// 			$w = 159;

			// 		$string = $qpcode.str_pad($z,4,"0",STR_PAD_LEFT).str_pad($c,2,"0",STR_PAD_LEFT);
			// 		$pdf->write1DBarcode($string, 'C39', $w, $x,'45', 16, 0.3, $style, 'R');
			// 		$a++;	

			// 		if($a=='1')
			// 			$w = 5;
			// 		if($a=='2')
			// 			$w = 56;
			// 		if($a=='3')
			// 			$w = 108;
			// 		if($a=='4')
			// 			$w = 159;

			// 		$string = $qpcode.str_pad($z,4,"0",STR_PAD_LEFT).str_pad($c,2,"0",STR_PAD_LEFT);
			// 		$pdf->write1DBarcode($string, 'C39', $w, $x,'45', 16, 0.3, $style, 'R');

			// 		$a++;	

			// 		if($a>4)
			// 		{
			// 			$a=1;
			// 			$x=$x+21;
			// 			$i++;
			// 		}
			// 	}
			// }


			
			
            
	}
		
	function SendOutput()
	{
		$this->pdf->Output("stiker_prienting_$this->qpcode.pdf","I");
	}	 
}

function printCodeStikers($aobj_context)
{
	$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
	$class_obj=new CodeStikers();
 	// var_dump($aobj_context);
    $class_obj->DefaultConstructor($aobj_context);
    $class_obj->formcolldata();
	$class_obj->WriteHallTicket($aobj_context);
	$class_obj->SendOutput();
}
?>