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


Current Path : /proc/thread-self/root/var/www/html/mum/Report_details/
Upload File :
Current File : //proc/thread-self/root/var/www/html/mum/Report_details/report_bundle_dispatch.php

<?php
//require('code39.php');
require('rotation.php');
class BundleDispatch
{
	public $aobj_context;
	public $degree_code;
	public $print_per_page;
	public $sub_appearing_count;
	public $bundle_arr;
// university
	public $std_FUNIVNAME ;
	public $std_FUNIVCODE ;
	public $std_FTOWN;
	public $FEXAMCNTR;
	public $exam_center_name;
// college info	
	public $college_code;
	public $college_name;
	public $college_address;
// student info
	public $STD_CollCode;
	public $STD_Course;
// date 
	public $date_time;
	public $bundle_count;
	public $qpcode;
	public $qpcodename;
	public $qpdate ; 
	public $qpsession;
	function __construct($aobj_context)
    {
		$this->aobj_context=$aobj_context;
		$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
		session_start();
		$this->college_code = $_SESSION['collcode']; 
		$bth_flag=0;
	}
	
	function getUniversityDetails()
	{
		$page_header_university = "select FUNIVCODE, FUNIVNAME,FTOWN,FUNIVADD1,DATE_FORMAT(NOW(),'%d/%m/%Y %h:%i %p') as now_date  from control";		
		$lobj_page_header_university = $this->aobj_context->mobj_db->GetRow($page_header_university);		
		$this->std_FUNIVCODE = $lobj_page_header_university[FUNIVCODE];
		$this->std_FUNIVNAME = $lobj_page_header_university[FUNIVNAME];
		$this->std_FTOWN = $lobj_page_header_university[FTOWN];
		$this->std_FUNIVADD1 = $lobj_page_header_university[FUNIVADD1];
	    $this->date_time = $lobj_page_header_university[now_date];
	
	
	}	
	
	function getCollegeDetails()
	{
		$page_header_college = "select c.FCOLLCODE, c.FCOLLNAME, c.FEXAMCNTR,
								ec.FCOLLNAME AS exam_center_name,c.FTOWN,
								CONCAT(c.FCOLLADD1,SPACE(2), c.FTOWN,'\n',c.FEXAMCNTR) AS COLLEGE_ADRS 
								FROM control co, college c
								LEFT JOIN college ec ON ec.FCOLLCODE=c.FEXAMCNTR
								WHERE c.FCOLLCODE='{$this->college_code}'";
								//var_dump($page_header_college);
		$lobj_page_header_college = $this->aobj_context->mobj_db->GetRow($page_header_college);
		
		$this->college_code = $lobj_page_header_college['FCOLLCODE'];
		$this->FEXAMCNTR = $lobj_page_header_college['FEXAMCNTR'];
		$this->exam_center_name = $lobj_page_header_college['exam_center_name'];
		$this->college_name = $lobj_page_header_college['FCOLLNAME'];
		$this->college_address = $lobj_page_header_college['COLLEGE_ADRS'];
		$this->FTOWN = $lobj_page_header_college['FTOWN'];
	
	}//and ifnull(col.FDELETED,'F')='F'
	function getBundleDispatchDetails()
	{
		$this->qpcode =  $this->aobj_context->mobj_data['qpcode'];
		$this->qpdate =  $this->aobj_context->mobj_data['qpdate']; 
		$this->qpsession = $this->aobj_context->mobj_data['qpsession'];
		
		//$page_subject = "select FSUBNAME,FDEGREE from subject where FQPCODE = '{$this->qpcode}'";
		$page_subject = "select distinct s.FSUBNAME,s.FDEGREE from subject s 
						where FQPCODE = '{$this->qpcode}'
						order by s.fdegree desc";
						//var_dump($page_subject);

		$page_subject = "select distinct s.FSUBNAME,s.FDEGREE,
		GROUP_CONCAT(s.FDEGREE separator ', ') as degcode from subject s 
		where FQPCODE = '{$this->qpcode}' and  IFNULL(fdoe,'0000-00-00') <> '0000-00-00'
		group by fqpcode
		order by s.fdegree desc";

		$lobj_get_subject = $this->aobj_context->mobj_db->GetRow($page_subject);
		$this->qpcodename = $lobj_get_subject['FSUBNAME'];
		$this->degcode = $lobj_get_subject['degcode'];
		
		$page_degree = "select distinct FEXAMDATE,ifnull(fdeggrp,'') as fdeggrp from degree where fdegree = '{$lobj_get_subject['FDEGREE']}'";
		$lobj_get_subject = $this->aobj_context->mobj_db->GetRow($page_degree);
		$this->freshExamDate = $lobj_get_subject['FEXAMDATE'];
		$this->fdeggrp = $lobj_get_subject['fdeggrp'];
		
		$get_bundle_data= " select c.FBUNO, c.FCOLLCODE, c.FQPCODE, c.FTOTSCRIPT, co.FBNDRECADD1, co.FBNDRECADD2,
		co.FBNDRECADD3, co.FBNDRECADD4,
		DATE_FORMAT(c.FDOE,'%d/%m/%Y') as FDOE, c.FSESSION, r.FDESCPN 
		from colldesp c, reason r, control co
		where c.fsession = r.freasoncd and c.fqpcode = '{$this->qpcode}' 
		and c.fcollcode ='{$this->college_code}' 
		order by FBUNO";
		//var_dump($get_bundle_data);						
		
		$lobj_get_bundle_data = $this->aobj_context->mobj_db->GetAll($get_bundle_data);
		$this->bundle_count = count($lobj_get_bundle_data);
		 
		foreach($lobj_get_bundle_data as  $rek=>$rev)
		 {		
			$this->bundle_arr[$rev['FBUNO']]['FBUNO'] = $rev['FBUNO'];
			$this->bundle_arr[$rev['FBUNO']]['FCOLLCODE'] = $rev['FCOLLCODE'];
			$this->bundle_arr[$rev['FBUNO']]['FQPCODE'] = $rev['FQPCODE'];
			$this->bundle_arr[$rev['FBUNO']]['FTOTSCRIPT'] = $rev['FTOTSCRIPT'];
			$this->bundle_arr[$rev['FBUNO']]['FDOE'] = $rev['FDOE'];
			$this->bundle_arr[$rev['FBUNO']]['FSESSION'] = $rev['FDESCPN'];
			$this->bundle_arr[$rev['FBUNO']]['FBNDRECADD1'] = $rev['FBNDRECADD1'];
			$this->bundle_arr[$rev['FBUNO']]['FBNDRECADD2'] = $rev['FBNDRECADD2'];
			$this->bundle_arr[$rev['FBUNO']]['FBNDRECADD3'] = $rev['FBNDRECADD3'];
			$this->bundle_arr[$rev['FBUNO']]['FBNDRECADD4'] = $rev['FBNDRECADD4'];
			
		 } 	
		 
	}
	
}
function generateBundleDispatchQPWise($aobj_context)
{
	$class_obj=new BundleDispatch($aobj_context);
	
	ini_set("memory_limit",-1);
    ini_set('max_execution_time',3300);
	
	
	$main_src_obj=(explode("/",$_SERVER["REQUEST_URI"]));
	$main_src=$main_src_obj[1];
	
	$pdf_reader_class=$aobj_context->main_src."/maya-pdf/fpdi/FPDI_Protection.php";	
	$pdf_psw_function=$aobj_context->main_src."/maya-pdf/TarkaPDFEncryption.php";
	$root_pdf_file_download=$aobj_context->main_src."/Report_details/output/report_adm_ticket.pdf";

	include($pdf_writer_class);			
	$pdf=  new PDF_Code39();
	$pdf->SetMargins(20,2,15);	
	$pdf->aobj_context =$aobj_context ;
	$pdf->WhichReport = 'AdmissionTicket';
	$pdf->SetFillColor(248, 248 ,255);		
	$pdf->SetFont('Times','',10);
	
	$adm_details=$class_obj->getUniversityDetails();
	$adm_details=$class_obj->getCollegeDetails();
	$adm_details=$class_obj->getBundleDispatchDetails();
	
	$pdf->AddPage();
	$i=1;
	foreach($class_obj->bundle_arr as $reg_k=>$reg_v)
	{
		//$pdf->AddPage();
		if($ypos > 190)
			$pdf->AddPage();
		$pdf->Ln(3);	
		$pdf->SetLineWidth(0.01);
		$barcode = $class_obj->college_code.$reg_v['FQPCODE'].$reg_v['FBUNO'].str_pad($reg_v['FTOTSCRIPT'],3,0,STR_PAD_LEFT);
		$pdf->SetFont('Times','B',16);	
		$img_path=$aobj_context->main_src."/img/report_uni_logo.jpg";
		$ypos = $pdf->GetY();
		$xpos = $pdf->GetX();
		if(file_exists($img_path)) 
			$pdf->Image($img_path,$xpos,$ypos-10,30);
		$ypos = $pdf->GetY();
		$pdf->SetY($ypos-15);
		$pdf->Cell(0,4,$class_obj->std_FUNIVNAME,0,1,'C');
		$pdf->SetFont('Times','',8);
		$pdf->Cell(0,4,$class_obj->std_FUNIVADD1,0,1,'C');
		$pdf->SetFont('Times','B',14);
		$pdf->Cell(185,0,'Page No. : '.$i.' / '.$class_obj->bundle_count,0,1,'R'); 
		$pdf->Ln(2);
		$pdf->SetFont('Times','BU',15);
		$pdf->Cell(0,6,'BUNDLE SLIP' ,'0',1,'C'); 
		
		$pdf->SetFont('Times','B',13);
		$pdf->Ln(1);
		$pdf->Cell(0,4,$class_obj->freshExamDate.'  '.' EXAMINATION ' ,'0',0,'C'); 
		$pdf->SetFont('Times','B',20);
		$pdf->Cell(10,4,'QP Code : '.$reg_v['FQPCODE'] ,'0',1,'R'); 
		$pdf->Ln(2);
		
		$new_yl=$pdf->GetY();
		//$pdf->SetDash(1, .3);
		$pdf->SetFillColor(0,0,0);
		$pdf->Cell(0,3,$pdf->Code39($pdf->GetX()+40,$pdf->GetY(),$barcode,true,false,0.3,8,true,30),'0',1,'C');
		$pdf->Ln(1);
		
		$univname = strtolower($class_obj->std_FUNIVNAME);
		if($class_obj->std_FUNIVCODE == '003')
		{
			$pdf->Ln(10);
			$pdf->SetFont('Times','B',13);
			$pdf->Cell(0,6,'Insured (for 200 Rupees) Speed Post Article' ,'0',1,'C');
			$y = $pdf->GetY();
			$pdf->SetY($y-7);
		}
		$new_yl=$pdf->GetY()+10;
		$pdf->Line(10,$new_yl, 200,$new_yl);
		$pdf->Line(10,$new_yl+.5, 200,$new_yl+.5);
		$pdf->Ln(12);
		$pdf->SetFont('Times','B',16);	
		$pdf->Cell(0,6,'To,' ,'0',1,'L'); 
		if($class_obj->std_FUNIVCODE == '041')
		{ 
			$pdf->Cell(0,6,'Registrar (Evaluation),' ,'0',1,'L');
			$pdf->Cell(0,6,ucwords($univname).',','0',1,'L');  
		}
		$pdf->Cell(0,6,$reg_v['FBNDRECADD1'] ,'0',1,'L'); 
		$pdf->Cell(0,6,$reg_v['FBNDRECADD2'] ,'0',1,'L'); 
		$pdf->Cell(0,6,$reg_v['FBNDRECADD3'] ,'0',1,'L'); 
		$pdf->Cell(0,6,$reg_v['FBNDRECADD4'] ,'0',1,'L'); 
		// $pdf->Ln(2);
		$new_yl=$pdf->GetY()+2;
		$pdf->Line(10,$new_yl, 200,$new_yl);
		$pdf->Line(10,$new_yl+.5, 200,$new_yl+.5);

		$pdf->Ln(5);

		$pdf->SetFont('Times','B',20);	
		$pdf->Ln(2);
		
		if($class_obj->std_FUNIVCODE == '023' and $class_obj->fdeggrp == 'PG')
		{
			$pdf->Cell(60,3,'Bundle No.',0,0,'L');
			$pdf->Cell(5,3,':',0,0,'L');
			$pdf->Cell(25,3,''.$reg_v['FBUNO'],0,0,'L');
			$pdf->SetFont('Times','B',15);
			$pdf->Cell(0,3,'Degree : '.$class_obj->degcode,0,1,'L');
		}	
		else
		{	
			$pdf->Cell(60,3,'Bundle No.',0,0,'L');
			$pdf->Cell(5,3,':',0,0,'L');
			$pdf->Cell(0,3,''.$reg_v['FBUNO'],0,1,'L');

		}	
		$pdf->Ln(3);
		
		$pdf->SetFillColor(0,0,0);
		//$xpos=$pdf->GetX();
		//$ypos=$pdf->GetY();

		$pdf->SetFont('Times','B',14);
		$pdf->Cell(60,8,'Center Code & Name ',0,0,'L');
		$pdf->Cell(5,8,':',0,0,'L');
		$pdf->MultiCell(90,8,' '. $class_obj->college_code." - ".$class_obj->college_name.' , '.$class_obj->FTOWN,0,'L');
		$pdf->Ln(2);
		$pdf->Cell(60,8,'QP Code & Paper Name ',0,0,'L');
		$pdf->Cell(5,8,':',0,0,'L');
		$pdf->MultiCell(90,5,' '.$reg_v['FQPCODE'].' - '.$class_obj->qpcodename,0,'L');
		$pdf->Ln(2);
		$pdf->Cell(60,8,'No. of Scripts ',0,0,'L');
		$pdf->Cell(5,8,':',0,0,'L');
		$pdf->Cell(0,8,' '.$reg_v['FTOTSCRIPT'],0,1,'L');
		$pdf->Ln(2);
		$pdf->Cell(60,8,'Date & Session ',0,0,'L');
		$pdf->Cell(5,8,':',0,0,'L');
		$pdf->Cell(0,8,' '.$reg_v['FDOE'].'  '.$reg_v['FSESSION'],0,1,'L');
		if($class_obj->std_FUNIVCODE == '003')
		{
			$pdf->Ln(5);
			
			$pdf->Cell(80,8,'Bundle Prepared by ',0,0,'L');
			$pdf->Cell(0,8,'Principal / Chairman / Coordinator :',0,1,'L');
			$pdf->Ln(1);
			$pdf->SetFont('Times','',14);
			$pdf->Cell(80,6,'Name :................................',0,0,'L');
			$pdf->Cell(0,6,'Name :................................',0,1,'L');
			$pdf->Cell(80,6,'Mobile No :.........................',0,0,'L');
			$pdf->Cell(0,6,'Mobile No :.........................',0,1,'L');
			$pdf->Ln(10);
			$pdf->Cell(100,5,'','0',0,'L');
			$pdf->SetFont('Times','B',14);
		}
		//$reg_v['FBUNO']
		else
		{		
			$pdf->Ln(12);
			$pdf->SetFont('Times','B',14);
			$pdf->Cell(100,5,'Signature of Squad Member','0',0,'L');
		}
		$pdf->Cell(0,8,' Principal / Chief Superintendent',0,1,'L');
		$pdf->Cell(115,5,'','0',0,'L');
		$pdf->Cell(0,8,'(Signature with seal)',0,1,'L');
		$pdf->Rotate(270);		
		$pdf->Cell(0,3,$pdf->Code39($pdf->GetX()-78,$pdf->GetY()-180,$barcode,true,false,0.2,10,true,10),'0',1,'R');
		$pdf->Rotate(90);

		$pdf->Cell(0,3,$pdf->Code39($pdf->GetX()+20,$pdf->GetY()-15,$barcode,true,false,0.2,10,true,10),'0',1,'R');
		$pdf->Rotate(0);
		$pdf->Ln(-10); 
		$pdf->SetFont('Times','',13);
		$pdf->Cell(0,4,'Note: 1. Prepare individual bundle for each qp code.',0,1,'L');
		if($class_obj->std_FUNIVCODE == '003')
		{
			$pdf->Ln(1);
			$pdf->Cell(0,4,'          2. Send invigilators dairy along with bundle.',0,1,'L');
			$pdf->Ln(1);
			$pdf->Cell(0,4,'          3. Bundle Weight is compulsory.',0,1,'L');
		}
		$pdf->Ln(8);
		$pdf->SetFont('Times','B',14);
		$pdf->Cell(40,3,'Bundle Weight ',0,0,'L');
		$pdf->Cell(0,3,':  ____________',0,1,'L');
		$pdf->Ln(4);
		$pdf->Cell(0,3,$pdf->Code39($pdf->GetX()+40,$pdf->GetY(),$barcode,true,false,0.3,8,true,30),'0',1,'C');
		$pdf->Ln(6);
		$ip=$_SERVER["REMOTE_ADDR"];
		$pdf->SetFont('Times','',9);
		$new_yl=$pdf->GetY()+2;
		//$pdf->SetDash(1, .3);
		$pdf->Line(10,$new_yl+3, 200,$new_yl+3);
		$pdf->Line(10,$new_yl+3.5, 200,$new_yl+3.5);
		
		$pdf->Ln(5);
		$pdf->Cell(150,6,'Printed   : IP Address : '.$ip.", Date : ".$class_obj->date_time,'0',0,'L');
		$pdf->Ln(16);
		$ypos=$pdf->GetY();
		$i++;
		
  	    
	}		    
	$pdf->Output("report_bundle_report.pdf","D");
		 
}
function PrintFooter($pdf,$date)
{
	
}
?>