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


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

<?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);
include_once("stringspliter.php");
	
class report_ra_qp_wise_student_count  extends FPDF
{
		 
	function DefaultConstructor($aobj_context)
	{
		session_start();
		$this->aobj_context=$aobj_context;
		$this->pdf=  new FPDF();
		$this->pdf=$this;
		$this->exdate=trim($this->aobj_context->mobj_data["exdate"]);
		$this->session=trim($this->aobj_context->mobj_data["session"]);
		
		$this->ip=$_SERVER["REMOTE_ADDR"];
		$get_date="select date_format(now(),'%d/%m/%Y %h:%i %p') as now_date";
		// $get_date="select current_timestamp as now_date";
		$obj=$this->aobj_context->mobj_db->GetRow($get_date);
		$this->current_date=$obj['now_date'];	
		$this->collcode=$_SESSION['collcode'];	
	}
	 
	function Header()
	{
		session_start();
		$FUNIVCODE = $_SESSION['FUNIVCODE'];
		
		$img_path=$this->aobj_context->main_src.'/'.$this->aobj_context->mobj_data["db"]."/".$this->photo_path;
		if(!empty($this->photo_path) && file_exists($img_path)) 
		{			
			$this->pdf->Image($img_path,166,50,50);
		}
		$img_logo_path=$this->aobj_context->main_src.'/'.$this->aobj_context->mobj_data["db"]."/".$this->pdf_logo_path;	
		if(!empty($this->pdf_logo_path) && file_exists($img_logo_path))
		{
			$this->pdf->Image($img_logo_path,10,10,23,22);
		}
		$img_path2 = $this->aobj_context->main_src.'/'.$this->aobj_context->mobj_data["db"]."/img/logo2.jpg";
		if(file_exists($img_path2))
		{
			$this->pdf->Image($img_path2,170,6,23,23);
		}
		
		$this->pdf->SetFont('Times','B',12);
		$this->pdf->cell(180,3,$this->FUNIVNAME."","0",1,"C");
		$this->pdf->SetFont('Times','B',7);
		$this->pdf->cell(180,7, $this->s_state,"0",1,"C");
		$this->pdf->SetFont('Times','B',10);
		$this->pdf->cell(180,7, $this->college_details,"0",'1',"C");
		$this->pdf->SetFont('Times','B',10);
		$this->pdf->Cell(180,7,"Question Paper Packet Opening Certificate - ".$this->FEXAMDATE." Examination","0",1,"C");
		$this->pdf->Cell(70,7,"Exam Date : ".$this->exdate,"0",0,"L");
		if($this->session == 'M')
		{
			$session = "Morning Session";
		}
		else
		{
			$session = "After Noon Session";
		}
		$this->pdf->Cell(90,7,"Session : ".$session,"0",1,"R");
		$this->pdf->Ln(2);
		$this->pdf->SetFont('Times','',13);
		
	}
	
	function Footer()
	{
		 
		$this->SetY(-15);
		$this->pdf->SetFont('Times','B',8);
		$this->Cell(140,6,'Printed   : IP Address : '.$this->ip."           Date ".$this->current_date,'0',0,'L');
		// $this->Cell(50,6,'Page '.$this->PageNo().' of {nb}',0,1,'R');
	}
	
	function formcolldata()
	{
		$get_coll_name="select FUNIVNAME as 'FUNIVNAME',
						FUNIVADD1 as 'state', pdf_logo_path 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->f_year=$lobj_get_coll_name['f_year'];
		$this->pdf_logo_path=$lobj_get_coll_name['pdf_logo_path'];

		$get_data="SELECT c.FCOLLCODE,
			CONCAT(c.FCOLLCODE, ' - ', c.FCOLLNAME,', ',c.FTOWN) AS FCOLLNAME FROM college c
			where c.FCOLLCODE='{$this->collcode}'";
		 
		$obj_student=$this->aobj_context->mobj_db->GetRow($get_data); 

		$this->college_details=$obj_student['FCOLLNAME'];

		$this->degree_details=" College : {$this->FCOLLNAME}";		

	}

	function GetFullQry()
	{
		$reporttype = "";
		/*if($this->centerwise == 'cntr')
		{
			$reporttype = " and m.FCNTRCODE =  '{$this->collcode}' "; 
		}else
		{
			$reporttype = " and  c.FCOLLCODE =  '{$this->collcode}'";

			
		}*/

		$canddettmp = "canddet";
		$candsumttmp = "candsum"; 
		$degreetmp = "degree";
		$subjecttmp = "subject";

		if($_SESSION['fexamseparate'] == 'T')
		{
			$candsum = "examcandsum"; 
			$canddet = "examcanddet"; 
			$FEXAMDATE = "d.fexexamdate as FEXAMDATE";
		}else
		{
			$candsum = "candsum"; 
			$canddet = "canddet"; 
			$FEXAMDATE = "d.FEXAMDATE as FEXAMDATE";
		}	


		$get_data ="select {$FEXAMDATE}, s.FQPCODE, concat(s.fsubname, ' [', s.FSSUBNAME,']') as FSSUBNAME from {$degreetmp} d
		inner join {$subjecttmp} s on d.fdegree = s.fdegree and d.fexamno = s.fexamno
		inner join {$canddet} c on s.fdegree = c.fdegree 
		and s.fexamno = c.fexamno and s.fsubcode = c.fsubcode
		inner join {$candsum} m on c.fregno = m.fregno and c.fcollcode = m.fcollcode  and c.fdegree = m.fdegree
		where ifnull(frecptdate,'0000-00-00') <> '0000-00-00'
		and c.fpresent = 'P' and ifnull(c.fpassmth,'') = '' and ifnull(fintass,'') = 'F' 
		and ifnull(ftheory,'') = 'T' and ifnull(fsuspend,'F') = 'F'
		and fdoe = date_format(str_to_date('{$this->exdate}', '%d/%m/%Y'), '%Y-%m-%d') and m.fcntrcode = '{$this->collcode}'
		and s.fsession like '{$this->session}%'
		and INSTR(m.fhtenable,c.fexamno) >0 
		group by FQPCODE";
		//var_dump($get_data);
		$this->lobj_get_data = $this->aobj_context->mobj_db->GetAll($get_data);
		$this->FEXAMDATE = $this->lobj_get_data[0]['FEXAMDATE'];
	}
	
	function formData()
	{

		$this->pdf->SetMargins(20,12,10);		
		$this->pdf->AddPage();
		$empty_cell_width=2;
		$sl_no=1;
		$k2 = 1;
		$first = true;
		foreach($this->lobj_get_data as $dk => $dv)
		{
			if($k2 > 20)
			{
				$this->pdf->AddPage();
				$k2 = 1;
			}
			
			if($first == true || $k2 == 1)
			{
				$this->pdf->SetFont('Times','B',11);
				$this->pdf->cell($empty_cell_width,7, ""," ",0,"C");
				$this->pdf->cell(12,7, "Sl. No.","1",0,"C");
				$this->pdf->cell(18,7, "QP Code","1",0,"C");
				$this->pdf->cell(130,7, "Paper Title","1",1,"C");
				$this->pdf->SetFont('Times','',9);
				$first = false;
			}
			
			$subname = trim($dv['FSSUBNAME']);
			$subnamearr = str_splitf($subname,60);
			
			$this->pdf->cell($empty_cell_width,7, ""," ",0,"C");
			$this->pdf->cell(12,7, $sl_no,"LRT",0,"C");
			$this->pdf->cell(18,7, $dv['FQPCODE'],"LRT",0,"C");
			$this->pdf->SetFont('Times','',10);
			$this->pdf->cell(130,7, $subnamearr[0],"LRT",1,"L");
			$this->pdf->SetFont('Times','',10);
			if($k2 == 29)
			{	
				$this->pdf->cell($empty_cell_width,7, "","",0,"C");
				$this->pdf->cell(180,1, "","T",0,"C");
			}
			if($subnamearr[1] != '')
			{
				$this->pdf->cell($empty_cell_width,7, ""," ",0,"C");
				$this->pdf->cell(12,4,'',"LRB",0,"C");
				$this->pdf->cell(18,4,'',"LRB",0,"C");
				$this->pdf->cell(20,4,'',"LRB",0,"C");
				// $this->pdf->cell(30,4,'',"LRB",0,"L");
				$this->pdf->SetFont('Times','',10);
				$this->pdf->cell(130,4, $subnamearr[1],"LRB",1,"L");
				$this->pdf->SetFont('Times','',10);
				// $this->pdf->cell(10,4,'',"LRB",1,"C");
				if($k2 == 30)
				{	
					$this->pdf->cell($empty_cell_width,7, "","",0,"C");
					$this->pdf->cell(180,1, "","T",0,"C");
				}	
			}
			$sl_no++;
			$k2++;
		}
		$this->pdf->cell($empty_cell_width,7, "","",0,"C");
		$this->pdf->cell(160,1, "","T",1,"C");
		$this->pdf->SetFont('Times','B',9);
		if(count($this->lobj_get_data) > 0)
		{
			$this->pdf->MultiCell(150, 5, "Certified that the seal of question paper packet for the above mentioned QP Codes were intact. They were opened in the presence of the undersigned and the contents were found to be correct", 0, 'C');
			$this->pdf->cell(160,1, "","T",1,"C");

			$this->pdf->cell(160,8, "Witnesses : ",0,1,"L");
			// $this->pdf->Ln(4);
			$this->pdf->cell(160,8, "1. ................................................................................... ",0,1,"L");
			$this->pdf->cell(160,8, "Chief Superintendent",0,1,"R");
			$this->pdf->cell(100,8, "2. ................................................................................... ",0,0,"L");
			$this->pdf->cell(160,8, "Date :  ",0,1,"L");
			$this->pdf->cell(100,8, "",0,0,"L");
			$this->pdf->cell(160,8, "Time :  ",0,1,"L");

			// $this->pdf->cell(160,1, "","T",1,"C");
			$this->pdf->cell(160,10, "Note : This form shall be retained in the college office for a period of six months from the date of Examnination ",'TB',1,"L");
			// $this->pdf->cell(160,1, "","T",1,"C");
		}
	}
			 
	function SendOutput()
	{
		$this->pdf->Output("QPCertificate.pdf","I");
	}
	
}

function GenerateQpIssue($aobj_context)
{
	$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);

	$class_obj=new report_ra_qp_wise_student_count();
	$class_obj->AliasNbPages();
	$class_obj->DefaultConstructor($aobj_context);

	$class_obj->GetFullQry();
	 $class_obj->formcolldata();
	$class_obj->formData();
	 
	$class_obj->SendOutput();
}

?>