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 : 18.118.93.61


Current Path : /var/www/oasis/Report_details/
Upload File :
Current File : /var/www/oasis/Report_details/daterange.php

<?php

function getdatedetails($aobj_context)
{
	$fdaterange = trim($aobj_context->mobj_data["fdaterange"]);
	$fdeggrp = trim($aobj_context->mobj_data["fdeggrp"]);
	$college_code_from = trim($aobj_context->mobj_data["college_code_from"]);
	$college_code_to = trim($aobj_context->mobj_data["college_code_to"]);
	$degree_code_from = trim($aobj_context->mobj_data["degree_code_from"]);
	$degree_code_to = trim($aobj_context->mobj_data["degree_code_to"]);
	$Examno_from = trim($aobj_context->mobj_data["Examno_from"]); 
	$Examno_to = trim($aobj_context->mobj_data["Examno_to"]);
	$db = trim($aobj_context->mobj_data["db"]);
	
	if($fdaterange == 'adm' )
	{
		$fileds = "FADMFROM,FADMTO";
		
	}else if( $fdaterange == 'exam' )
	{
		$fileds = "FAPPFROM,FAPPTO";
	
	}else if($fdaterange ==  'ht')
	{
		$fileds = "FHTFROM,FHTTO";
	
	}else if($fdaterange == 'iam')
	{
		$fileds = "FIAFROM,FIATO";
	
	}else if($fdaterange == 'prm')
	{
		$fileds = "FPRFROM,FPRTO";
	}
	else if($fdaterange == 'su')
	{
		$fileds = "fsubcrfrom,fsubcrto";
	}
	else if($fdaterange == 'ra')
	{
		$fileds = "frafrom,frato";
	}
	else if($fdaterange == 'at')
	{
		$fileds = "FATTFROM,FATTTO";
	}
	else if($fdaterange == 'tt')
	{
		$fileds = "FTTFROM,FTTTO";
	}
	else if($fdaterange == 'cnv')
	{
		$fileds = "FCNVFROM,FCNVTO";
	}

	$deggrp_cond = "";
	if($db == 'ssc') {
		$deggrp_cond = "";
	} else {
		$deggrp_cond = "and fdegree in(select distinct fdegree from degree where fdeggrp = '{$fdeggrp}')";
	}
	
	$query = "select fcollcode,fdegree,fexamno,{$fileds} from collexam 
			where fcollcode between '{$college_code_from}' and '{$college_code_to}'
			and fdegree between '{$degree_code_from}' and '{$degree_code_to}'
			and fexamno between '{$Examno_from}' and '{$Examno_to}'
			{$deggrp_cond}
			order by fcollcode,fdegree,fexamno";
	
	$result = $aobj_context->mobj_db->getAll($query);
	$table.="<table id ='ftable1' align='left'  cellpadding='2' cellspacing='0'  border='1'>";
	foreach($result as $key => $value)
	{      			
			$table.="<tr style='font-size:12px;  height:24px;'>";
			$table.="<td  align='center' style='width:120px;' >{$value['fcollcode']}</td>";			
			$table.="<td  align='center' style='width:120px;' >{$value['fdegree']}</td>";
			$table.="<td  align='center' style='width:120px;' >{$value[fexamno]}</td>";
			$table.="<td  align='center' style='width:150px;' >{$value[3]}</td>";
			$table.="<td  align='center' style='width:150px;' >{$value[4]}</td>";
			$table.="</tr>";
	}
	$table.="</table>";
	if($result)
	{
		$arr['table'] = $table;
		echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success");	
		return; 
	}
	
}

function SaveDateRange($aobj_context)
{
	$fdaterange = trim($aobj_context->mobj_data["fdaterange"]);
	$fdeggrp = trim($aobj_context->mobj_data["fdeggrp"]);
	$college_code_from = trim($aobj_context->mobj_data["college_code_from"]);
	$college_code_to = trim($aobj_context->mobj_data["college_code_to"]);
	$degree_code_from = trim($aobj_context->mobj_data["degree_code_from"]);
	$degree_code_to = trim($aobj_context->mobj_data["degree_code_to"]);
	$Examno_from = trim($aobj_context->mobj_data["Examno_from"]); 
	$Examno_to = trim($aobj_context->mobj_data["Examno_to"]);
	$fdate = trim($aobj_context->mobj_data["fdate"]); 
	$tdate = trim($aobj_context->mobj_data["tdate"]);
	
	if($fdaterange == 'adm' )
	{
		$fileds = "FADMFROM = DATE_FORMAT(str_to_date('{$fdate}','%d/%m/%Y'),'%Y-%m-%d') , FADMTO  = DATE_FORMAT(str_to_date('{$tdate}','%d/%m/%Y'),'%Y-%m-%d')";
		
	}else if( $fdaterange == 'exam' )
	{
		$fileds = "FAPPFROM =  DATE_FORMAT(str_to_date('{$fdate}','%d/%m/%Y'),'%Y-%m-%d'), FAPPTO  = DATE_FORMAT(str_to_date('{$tdate}','%d/%m/%Y'),'%Y-%m-%d')";
	
	}else if($fdaterange ==  'ht')
	{
		$fileds = "FHTFROM = DATE_FORMAT(str_to_date('{$fdate}','%d/%m/%Y'),'%Y-%m-%d') , FHTTO  = DATE_FORMAT(str_to_date('{$tdate}','%d/%m/%Y'),'%Y-%m-%d')";
	
	}else if($fdaterange == 'iam')
	{
		$fileds = "FIAFROM = DATE_FORMAT(str_to_date('{$fdate}','%d/%m/%Y'),'%Y-%m-%d'), FIATO  = DATE_FORMAT(str_to_date('{$tdate}','%d/%m/%Y'),'%Y-%m-%d')";
	
	}else if($fdaterange == 'prm')
	{
		$fileds = "FPRFROM = DATE_FORMAT(str_to_date('{$fdate}','%d/%m/%Y'),'%Y-%m-%d') , FPRTO  = DATE_FORMAT(str_to_date('{$tdate}','%d/%m/%Y'),'%Y-%m-%d')";

	}else if($fdaterange == 'su')
	{
		$fileds = "fsubcrfrom = DATE_FORMAT(str_to_date('{$fdate}','%d/%m/%Y'),'%Y-%m-%d') , fsubcrto  = DATE_FORMAT(str_to_date('{$tdate}','%d/%m/%Y'),'%Y-%m-%d')";

	}else if($fdaterange == 'ra')
	{
		$fileds = "frafrom = DATE_FORMAT(str_to_date('{$fdate}','%d/%m/%Y'),'%Y-%m-%d') , frato  = DATE_FORMAT(str_to_date('{$tdate}','%d/%m/%Y'),'%Y-%m-%d')";
	}else if($fdaterange == 'at')
	{
		$fileds = "FATTFROM = DATE_FORMAT(str_to_date('{$fdate}','%d/%m/%Y'),'%Y-%m-%d') , FATTTO  = DATE_FORMAT(str_to_date('{$tdate}','%d/%m/%Y'),'%Y-%m-%d')";
	}else if($fdaterange == 'tt')
	{
		$fileds = "FTTFROM = DATE_FORMAT(str_to_date('{$fdate}','%d/%m/%Y'),'%Y-%m-%d') , FTTTO  = DATE_FORMAT(str_to_date('{$tdate}','%d/%m/%Y'),'%Y-%m-%d')";
	}else if($fdaterange == 'cnv')
	{
		$fileds = "FCNVFROM = DATE_FORMAT(str_to_date('{$fdate}','%d/%m/%Y'),'%Y-%m-%d') , FCNVTO  = DATE_FORMAT(str_to_date('{$tdate}','%d/%m/%Y'),'%Y-%m-%d')";
	}
	
	$deggrp_cond = "";
	if($db == 'ssc') {
		$deggrp_cond = "";
	} else {
		$deggrp_cond = "and fdegree in(select distinct fdegree from degree where fdeggrp = '{$fdeggrp}')";
	}

		$query = "update collexam set
					{$fileds}
					where fdegree between '{$degree_code_from}' and '{$degree_code_to}' 
					and   fexamno between '{$Examno_from}' and '{$Examno_to}'  
					and  fcollcode between '{$college_code_from}' and '{$college_code_to}'
					{$deggrp_cond}";
		//var_dump($query);
		$lobj_update = $aobj_context->mobj_db->Execute($query); 
	if($lobj_update)	
	{	$arr = "updated success";
		echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success"); 
	}
	else
	{
		$error_msg = "updation failed";
		echo $aobj_context->mobj_output->ToJSONEnvelope($error_msg,-1,"success"); 
	}
}

function loaddeggrp($aobj_context)
{

	$query = "select distinct fdeggrp as code,fdescpn as value from deggrp order by fdeggrp";
	$result = $aobj_context->mobj_db->getAll($query);

	if($result)	
	{	
		echo $aobj_context->mobj_output->ToJSONEnvelope($result,0,"success"); 
	}
	else
	{
		$error_msg = "Degree group details not found";
		echo $aobj_context->mobj_output->ToJSONEnvelope($error_msg,-1,"success"); 
	}

	return;
}

?>