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


Current Path : /proc/thread-self/root/var/www/html/gfgcg/src/
Upload File :
Current File : //proc/thread-self/root/var/www/html/gfgcg/src/attshort.php

<?php

function downloadAllStudentPhotosreport($aobj_context)
{
	session_start();
	$collcode=$_SESSION['collcode'];
	
	ini_set('memory_limit','300M');
	ini_set('max_execution_time',3300);
	
	$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
	$filename = 'university_qpcount.csv';
	$f = fopen('php://output', 'w'); 
	
	$qp_code_from = trim($aobj_context->mobj_data["qp_code_from"]);
	$qp_code_to = trim($aobj_context->mobj_data["qp_code_to"]);
	
	$cntr_from = trim($aobj_context->mobj_data["cntr_from"]);
	$cntr_to = trim($aobj_context->mobj_data["cntr_to"]);

	$date_from = trim($aobj_context->mobj_data["date_from"]);
	$date_to = trim($aobj_context->mobj_data["date_to"]);
	
	$centcode = trim($aobj_context->mobj_data["qpcount"]);
	

	if($centcode == 'summary')
	{
		$get_data ="SELECT DATE_FORMAT(s.FDOE,'%d/%m/%Y') AS Date_of_Exam, IF(IFNULL(s.FSESSION,'')<>'',
			IF(s.FSESSION = r.FREASONCD,r.FDESCPN,s.FSESSION),s.FSESSION) AS SESSION,s.FQPCODE AS Qp_Code, 
			CONCAT(s.FSUBNAME, ' ', s.FSSUBNAME) AS Subject_name, COUNT(c.FSUBCODE) AS CAPACITY FROM degree d 
			INNER JOIN subject 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 LEFT JOIN reason r ON r.FREASONCD = s.FSESSION
			WHERE IFNULL(FRECPTDATE,'0000-00-00') <> '0000-00-00' 
			AND c.FPRESENT = 'P' AND IFNULL(c.FPASSMTH,'') = '' and ifnull(m.FTOTALFEE,'') > 0
			and s.FDOE BETWEEN DATE_FORMAT(STR_TO_DATE('{$date_from}', '%d/%m/%Y'),'%Y-%m-%d')  
			AND DATE_FORMAT(STR_TO_DATE('{$date_to}', '%d/%m/%Y'),'%Y-%m-%d')
			and m.FCOLLCODE between '{$cntr_from}' and '{$cntr_to}' AND s.FQPCODE BETWEEN '{$qp_code_from}' 
			AND '{$qp_code_to}' GROUP BY s.FQPCODE ORDER BY s.FQPCODE";
			//var_dump($get_data);die();
	}
	else
	{
		$get_data ="SELECT  {$centcode} AS Center_Code ,DATE_FORMAT(s.FDOE,'%d/%m/%Y') AS Date_of_Exam, IF(IFNULL(s.FSESSION,'')<>'',
		IF(s.FSESSION = r.FREASONCD,r.FDESCPN,s.FSESSION),s.FSESSION) AS SESSION,s.FQPCODE AS Qp_Code, 
		CONCAT(s.FSUBNAME, ' ', s.FSSUBNAME) AS Subject_name, COUNT(c.FSUBCODE) AS CAPACITY FROM degree d 
		INNER JOIN subject 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 LEFT JOIN reason r ON r.FREASONCD = s.FSESSION
		WHERE IFNULL(FRECPTDATE,'0000-00-00') <> '0000-00-00' AND c.FPRESENT = 'P' 
		AND IFNULL(c.FPASSMTH,'') = '' and ifnull(m.FTOTALFEE,'') > 0
		and s.FDOE BETWEEN DATE_FORMAT(STR_TO_DATE('{$date_from}', '%d/%m/%Y'),'%Y-%m-%d')  
		AND DATE_FORMAT(STR_TO_DATE('{$date_to}', '%d/%m/%Y'),'%Y-%m-%d')
		and {$centcode} between '{$cntr_from}' and '{$cntr_to}' AND s.FQPCODE BETWEEN '{$qp_code_from}'
		AND '{$qp_code_to}' GROUP BY {$centcode},s.FQPCODE ORDER BY s.FQPCODE,{$centcode}";
				
	}
	//var_dump($get_data);die();
	$lobj_get_data = $aobj_context->mobj_db->GetAll($get_data);
	
	$arrW =0;
	$subjRow ='';
		
	if(!empty($lobj_get_data))
	{
		$e_data.="<table cellspacing='0' cellpadding='1' border='1' width = ''>";
		$e_data.="<tr>";
		$e_data.="<td style = 'text-align:center;font-weight: bold;row-height:40px;' >Sl. No.</td>";
		if($centcode == 'm.FCNTRCODE')
			$e_data.="<td style = 'text-align:center;font-weight: bold;row-height:40px;' >Center code</td>";
		else if($centcode == 'c.FCOLLCODE')
			$e_data.="<td style = 'text-align:center;font-weight:bold;row-height:40px;' >College code</td>";
		$e_data.="<td style = 'text-align:center;font-weight:bold;row-height:40px;'>Exam Date</td>";
		$e_data.="<td style = 'text-align:center;font-weight:bold;row-height:40px;'>Session</td>";
		$e_data.="<td style = 'text-align:center;font-weight:bold;row-height:40px;' >QP. Code</td>";
		$e_data.="<td style = 'text-align:center;font-weight:bold;row-height:40px;' >Subject Title</td>";
		$e_data.="<td style = 'text-align:center;font-weight:bold;row-height:40px;' >Count</td>";		
		$e_data.="</tr>";							
		$k=0;
		$id=0;
		$m=0;
		$filename = '';
		if($centcode == 'm.FCNTRCODE')
		{
			$filename = 'centerwiseqpcount';
		}
		if($centcode == 'm.FCOLLCODE')
		{
			$filename = 'collegeqpcount';
		}
		if($centcode == 'summary')
		{
			$filename = 'summaryqpcount';
		}
		$counter_degree = 1;
		foreach($lobj_get_data as $key=>$value)
		{
			if($k%2==0)
			{
				$class='tbl_row';
				$inp_class='tbl_row_input';
			}
			else
			{
				$input_class='tbl_row1'; 
				$inp_class='tbl_row1_input';
			}  
			
			$e_data.="<tr>";	
			$e_data.="<td style = 'text-align:center;' >{$counter_degree}</td>";	
			if($centcode != 'summary')			
				$e_data.="<td style = 'text-align:center;' >{$value['Center_Code']}</td>";
			$e_data.="<td style = 'text-align:center;' >{$value['Date_of_Exam']}</td>";
			$e_data.="<td style = 'text-align:left;' >{$value['SESSION']}</td>";
			$e_data.="<td style = 'text-align:center;' >{$value['Qp_Code']}</td>";
			$e_data.="<td style = 'text-align:left;' >{$value['Subject_name']}</td>";
			$e_data.="<td style = 'text-align:right;' >{$value['CAPACITY']}</td>";	
			$e_data.="</tr>";
			$k++;
			$id++;
			$m++;
			$counter_degree++;
		}
		$e_data.="</table>";
		//var_dump($e_data);die();
		$arr['total_count']= $m;						
		$arr['html']=$e_data;
		$arr['error']=0;
	}
	else
	{
		$arr['html'] = '<p> No record found </p>';
	}	
	header("Content-Type:application/xls");
	header("Content-Disposition: attachment; filename={$filename}.xls"); 
	echo $e_data;
}

function updateattshort($aobj_context)
{
	$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
		$exam_from = $aobj_context->mobj_data['exam_from'];
		$exam_to = $aobj_context->mobj_data['exam_to'];
	
		$degree_from = $aobj_context->mobj_data['degree_from'];
		$degree_to = $aobj_context->mobj_data['degree_to'];
		
		$get_studentInfo = "SELECT DISTINCT fcollcode, fdegree,fregno FROM attend 
						WHERE fdegree BETWEEN '{$degree_from}' AND '{$degree_to}'
						AND fexamno BETWEEN '{$exam_from}' AND '{$exam_to}'  and ifnull(fper,0) > 75
						ORDER BY fcollcode,fdegree,fexamno";
			$lobj_get_studentInfo = $aobj_context->mobj_db->getAll($get_studentInfo);
		if(count($lobj_get_studentInfo) > 0)
		{
			$arr = '';
			echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success");
		}
		else
		{
			$arr = '';
			echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"success");
		}
	
}

?>