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


Current Path : /var/www/html/college/Report_details/
Upload File :
Current File : /var/www/html/college/Report_details/empty_report_admission_det.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);
ini_set('memory_limit','900M');
ini_set('max_execution_time',0);

class MYPDF extends TCPDF {
    public $aobj_context;
	
	public $fintake;
	
	public function setData($aobj_context)
	{
    	$this->aobj_context = $aobj_context;
    	$this->fromdeg = trim($aobj_context->mobj_data["degree_code"]);
		$this->db = trim($aobj_context->mobj_data["db"]);
		$this->fromcoll = $_SESSION['collcode']; 
		//$this->strAprtype = trim($aobj_context->mobj_data["appstatus"]);

		$query = "select fintake from colldeg where FDEGREE = '{$this->fromdeg}' and fcollcode = '{$this->fromcoll}'";
		$res = $this->aobj_context->mobj_db->GetRow($query);
		
		$this->fintake = $res['fintake'];
		$fintake = $res['fintake'];		

	}
	
    public function Header($head) {
        // get the current page break margin
        $bMargin = $this->getBreakMargin();
        // get current auto-page-break mode
        $auto_page_break = $this->AutoPageBreak;
        // disable auto-page-break
        $this->SetAutoPageBreak(false, 0);
        // set bacground image
		if($this->aobj_context->first !='strue')
			$this->SetMargins(10,35,20,true);	
		else
			$this->SetMargins(10,30,20,true);	

		$this->SetFillColor(248, 248 ,255);		
		$this->SetFont('Times','',10);
		
		
		//var_dump($img_path);
		

		$get_coll_name="select FUNIVNAME as 'FUNIVNAME',FUNIVCODE,
		FUNIVADD1 as 'state', pdf_logo_path,
		ifnull(FEXAMAPPREQ,'F') as FEXAMAPPREQ 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->FEXAMAPPREQ=$lobj_get_coll_name['FEXAMAPPREQ'];
		$this->FUNIVCODE=$lobj_get_coll_name['FUNIVCODE']; 
		
		$img_path = $this->aobj_context->main_src.'oasis/'.$this->db."/".$this->pdf_logo_path;
		//var_dump($img_path);
		//die();
		if(file_exists($img_path)) 
		{	
			if($this->db == 'ru')
			{
				$img_path = $this->aobj_context->main_src.'oasis/'.$this->db."/img/rur_log_report.jpg";
				$this->Image($img_path,65,4,75);
				$this->Ln(17);
			}
			else
				$this->Image($img_path,10,6,20,20);	
		}
		$img_path = $this->aobj_context->main_src."/img/logo2.jpg";
		if(file_exists($img_path)) 
			$this->Image($img_path,250,8,20,20);
		$this->SetFont('helvetica','B',17);
		$this->Ln(2);
		if($this->db != 'ru')
		$this->Cell(180,4,$this->FUNIVNAME,0,1,'C');

		$query   = "select concat(fdegree,' - ',fdescpn) as deg from degree where 
				   fdegree = '{$this->fromdeg}' and fexamno = 'A'";
		$results1 = $this->aobj_context->mobj_db->GetRow($query);

		$query   = "select concat(fcollcode,' - ',fcollname) as coll from college where 
				   fcollcode = '{$this->fromcoll}'";
		$results2 = $this->aobj_context->mobj_db->GetRow($query);

		
		

		$this->SetFont('Times','B',15);
		// $this->Cell(0,4,'Degree  - '.$results1['deg'],0,1,'C');
		$this->Cell(0,4,'College - '.$results2['coll'],0,1,'C');
        $this->SetFont('Times','B',12);
		$this->Cell(0,4,'UG Admission Fees Details',0,1,'C');
		//$this->Ln(2);
		// $this->SetFont('Times','B',13);
		// $this->Cell(0,6,'Approved Intake : '.$this->fintake,"0","1",L);
		//$this->Ln(2);
		
		$this->SetFont('Times','B',10);
		if($this->aobj_context->first !='strue')
		{
			
		}
        // restore auto-page-break status
        $this->SetAutoPageBreak($auto_page_break, $bMargin);
        // set the starting point for the page content    
    }

    public function Footer() 
    {
        $this->SetY(-15);
        $this->SetFont('helvetica', 'I', 8);
        $this->Cell(70, 10,'IP : '.$_SERVER["REMOTE_ADDR"], 0, 0, 'L');
        $this->Cell(90, 10,'Date : ' .$this->aobj_context->current_date, 0, 0, 'L');

        $this->Cell(30, 10,'Page ' .$this->getAliasNumPage().'/'.$this->getAliasNbPages(), 0, 1, 'R');
    }
}

class AddmissionApproveList
{	
	function DefaultConstructor($aobj_context)
	{
		$this->aobj_context=$aobj_context;
		//$this->pdf=  new FPDF();
		$this->ip=$_SERVER["REMOTE_ADDR"];
		$get_date="select now() as now_date,funivname,pdf_logo_path from control";
		$obj=$this->aobj_context->mobj_db->GetRow($get_date);
		$this->aobj_context->main_src = realpath(__DIR__ . '/../..');
		$this->aobj_context->main_src = $this->aobj_context->main_src.'/';
		$this->aobj_context->current_date =  $obj['now_date'];
		$this->current_date = $obj['now_date'];
		$this->univ = $obj['funivname'];
		$this->pdf_logo_path = $obj['pdf_logo_path'];
		$this->pdf= new MYPDF('P');
		$this->pdf->setData($aobj_context);
		
		$this->fromdeg = trim($aobj_context->mobj_data["degree_code"]);
		

	}
 
	function formcolldata()
	{
		$get_coll_name="select FUNIVNAME as 'FUNIVNAME',FUNIVCODE,
		FUNIVADD1 as 'state', pdf_logo_path,
		ifnull(FEXAMAPPREQ,'F') as FEXAMAPPREQ 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->FEXAMAPPREQ=$lobj_get_coll_name['FEXAMAPPREQ'];
		$this->FUNIVCODE=$lobj_get_coll_name['FUNIVCODE']; 
	}

	function appData()
	{
		
		$this->fromcoll = $_SESSION['collcode']; 

		$get_app_query = "select ifnull(fname,'') as fname, 
        ifnull(ffatname, '') as ffatname, 
        ifnull(fmotname, '') as fmotname,
        date_format(fdob,'%d/%m/%Y') as fdob
        from studadm where fcollcode = '{$this->fromcoll}' and fdegree = '{$this->fromdeg}'
		and ifnull(fdeleted,'') <> 'T'";

		// var_dump($get_app_query);
		$this->results =$this->aobj_context->mobj_db->GetAll($get_app_query);

		$query = "select fintake from colldeg where FDEGREE = '{$this->fromdeg}' and fcollcode = '{$this->fromcoll}'";
		$res = $this->aobj_context->mobj_db->GetRow($query);
		
		$this->fintake = $res['fintake'];



		$query = "select FCATBIRTH,sum(if(fgender = 'Male',1,0))  as male,
				sum(if(fgender = 'Female',1,0))  as female, 
				sum(funivfee)  as fee
				from studadm where 
				fdegree = '{$this->fromdeg}' and fcollcode = '{$this->fromcoll}'
				and ifnull(fdeleted,'') <> 'T'
				group by fdegree,fcollcode,FCATBIRTH
				order by fdegree,fcollcode,FCATBIRTH";
		$this->ressum =$this->aobj_context->mobj_db->GetAll($query);

	}
	
		
	function writeApproveList($aobj_context)
	{
		//$this->printHeaders();

		//var_dump($this->results);
		$pdf=$this->pdf;

		

		$pdf->AddPage("P");
		
		$this->head	= true;
		$pdf->SetFont('TIMES','',10);

		
		
		$head = '<table cellpadding="8" cellspacing="0" border="0.3">';
		$table_body = '';
		$first = 1;
		$amtpaid = 0;
		$amttobepaid = 0;
		$j = 0;
        $table_head = '<table cellpadding="8" cellspacing="0" border="0.3">
			<tr nobr="true"><th width="45" align="center"><b>Sl. No.</b></th>
				<th width="80" align="center"><b>Date</b></th>
				<th width="100" align="center"><b>Bank</b></th>
				<th width="100" align="center"><b>Reference No.</b></th>
				<th width="130" align="center"><b>University Account No.</b></th>
				<th width="80" align="center"><b>Amount</b></th>
				
				
			</tr>
			</table>';
			// $this->pdf->ln(10.99);
			$this->pdf->writeHTML($table_head, false, true, false, false, 'C');
		for($i = 1; $i<=20; $i++) 
		{
			$table_body .= '<tr nobr="true">
				<td width="45" align="center"></td>
				<td width="80" align="left"> </td>
				<td width="100" align="left"> </td>
				<td width="100" align="left"> </td>
				<td width="130"> </td>
				<td width="80" align="left"> </td>
			</tr>';

          
			
                
				$table_body .= '</table>';
				$pdf->writeHTML($head.$table_body, false, true, false, false, 'C');
				$table_body = '';
			

			$j +=1;
			$amttobepaid += $value['ffeetobepaid'];
			$amtpaid += $value['fadmfee'];
			
			//var_dump($amttobepaid);
		}
		$this->pdf->ln(10);
        $this->pdf->SetFont('Times','',11);
        $this->pdf->Cell(0,4,'The College has paid to the Raichur University Rs__________ towards UG Admission of __________Students of our college',0,1,'L');
        $this->pdf->ln(10);
        $this->pdf->SetFont('Times','B',11);
        $this->pdf->Cell(180,4,'Principal',0,1,'R');
	}
		
	function SendOutput()
	{
		$this->pdf->Output("UG_Admission_Fees_Details_{$this->current_date}.pdf","D");
	}	 
}

function generateemptyadmdet($aobj_context)
{
	$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
	$class_obj = new AddmissionApproveList();
	$class_obj->DefaultConstructor($aobj_context);
	$class_obj->formcolldata();
	$class_obj->appData();
	$class_obj->writeApproveList($aobj_context);
	
	$class_obj->SendOutput();
}
?>