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


Current Path : /var/www/html/cuk/orms_wait/src/
Upload File :
Current File : //var/www/html/cuk/orms_wait/src/educationdet.php

<?php
function saveeducationaldetails($aobj_context)
{
	session_start();
	$userid = $_SESSION['userid'];
	$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);  
	include_once("/JSON.php");
	
	$json = new Services_JSON();
	$fieldarrvalue = stripslashes($aobj_context->mobj_data["fieldarrvalue"]);
	$appno = stripslashes($aobj_context->mobj_data["appno"]);
	$subject = stripslashes($aobj_context->mobj_data["subject"]);
	$pg = stripslashes($aobj_context->mobj_data["pg"]);
	$persnaldet = $json->decode($fieldarrvalue);
	$persarr = get_object_vars($persnaldet);
	
	$query1 = "delete from qualdetl
	where fuserid = '{$userid}' and fenttype <> 'oth'";
	$results1 =$aobj_context->mobj_db->Execute($query1);
	
	$med = 0;
	$bed = 0;	
	
	$pgpoint = 50;

	$query = "select fcatcode from perdetl where fuserid = '{$userid}'";
	$results =$aobj_context->mobj_db->getRow($query);

	$catcode = $results['fcatcode'];

	if($catcode ==  '11' || $catcode ==  '16')
		$pgpoint = 55;

	if($persarr['T47'] >= 45 && $persarr['T47'] <= 55)
		$ug = 5;
	if($persarr['T47'] >= 55 && $persarr['T47'] <= 60)
		$ug = 10;
	if($persarr['T47'] >= 60 && $persarr['T47'] <= 80) 
		$ug = 13;
	if($persarr['T47'] >= 80) 
		$ug = 15;
	
	if($persarr['T55'] >= $pgpoint && $persarr['T55'] <= 60)
		$pg = 20;
	if($persarr['T55'] >= 60 && $persarr['T55'] <= 80) 
		$pg = 23;
	if($persarr['T55'] >= 80) 
		$pg = 25;
	
	
	$persarr['T28'] = str_replace("'","`",$persarr['T28']);
	$persarr['T35'] = str_replace("'","`",$persarr['T35']);
	$persarr['T200'] = str_replace("'","`",$persarr['T200']);
	$persarr['T207'] = str_replace("'","`",$persarr['T207']);
	$persarr['T43'] = str_replace("'","`",$persarr['T43']);
	$persarr['T51'] = str_replace("'","`",$persarr['T51']);
	
	$query1 = "insert into qualdetl(fuserid, fdegree, funivname, fyear, fmaxmarks, fsecmarks , fpercentage, fdivision, fsubjects, fpoints, fenttype)
	values ('{$userid}', '10TH','{$persarr['T28']}','{$persarr['T29']}','{$persarr['T30']}','{$persarr['T31']}','{$persarr['T32']}','{$persarr['T33']}','{$persarr['T34']}','','10th')
	,('{$userid}', '12TH','{$persarr['T35']}','{$persarr['T36']}','{$persarr['T37']}','{$persarr['T38']}','{$persarr['T39']}','{$persarr['T40']}','{$persarr['T41']}','','12th')
	,('{$userid}', 'BE.d','{$persarr['T200']}','{$persarr['T201']}','{$persarr['T202']}','{$persarr['T203']}','{$persarr['T204']}','{$persarr['T205']}','{$persarr['T206']}','{$bed}','BEd')
	,('{$userid}', 'ME.d','{$persarr['T207']}','{$persarr['T208']}','{$persarr['T209']}','{$persarr['T210']}','{$persarr['T211']}','{$persarr['T212']}','{$persarr['T213']}','{$med}','MEd')
	,('{$userid}','{$persarr['T42']}','{$persarr['T43']}','{$persarr['T44']}','{$persarr['T45']}','{$persarr['T46']}','{$persarr['T47']}','{$persarr['T48']}','{$persarr['T49']}','{$ug}','bachelor')
	,('{$userid}','{$persarr['T50']}','{$persarr['T51']}','{$persarr['T52']}','{$persarr['T53']}','{$persarr['T54']}','{$persarr['T55']}','{$persarr['T56']}','{$persarr['T57']}','{$pg}','masters')";
	$result1 = $aobj_context->mobj_db->Execute($query1);	
	
	$query2 = "delete from phddetl
	where fuserid = '{$userid}'";
	$result2 =$aobj_context->mobj_db->Execute($query2);
	
	if($persarr['T62'] > 60)
		$mphil = 7;
	else if($persarr['T62'] != '')
		$mphil = 5;

	if($persarr['T67'] != '' || $persarr['T68'] != '')
		$phd = 30;
	
	//DATE_FORMAT(str_to_date('{$persarr['T58']}','%d/%m/%Y'),'%Y-%m-%d')
	$query2 = "insert into phddetl(fuserid, fdegree, fdor,fdos,fdoa,funivname,ftitle,fmarkstype,fpercent,fpoints,fenttype)
			   values('{$userid}','MPhil',DATE_FORMAT(str_to_date('{$persarr['T58']}','%d/%m/%Y'),'%Y-%m-%d'),DATE_FORMAT(str_to_date('{$persarr['T59']}','%d/%m/%Y'),'%Y-%m-%d'),DATE_FORMAT(str_to_date('{$persarr['T60']}','%d/%m/%Y'),'%Y-%m-%d'),'{$persarr['T61']}','{$persarr['T62']}','','{$persarr['T63']}','{$mphil}','mphil')
			   ,('{$userid}','PhD',DATE_FORMAT(str_to_date('{$persarr['T64']}','%d/%m/%Y'),'%Y-%m-%d'),DATE_FORMAT(str_to_date('{$persarr['T65']}','%d/%m/%Y'),'%Y-%m-%d'),DATE_FORMAT(str_to_date('{$persarr['T66']}','%d/%m/%Y'),'%Y-%m-%d'),'{$persarr['T67']}','{$persarr['T68']}','','{$persarr['T69']}','{$phd}','phd')";
	$result2 = $aobj_context->mobj_db->Execute($query2);
		
	if($persarr['T74'] != '')
		$jr = 7;
	if($persarr['T77'] != '')
		$net = 5;
	if($persarr['T80'] != '')
		$slet = 3;
	
	$query3  = "update perdetl set fjrpoints = '{$jr}',fjrfsub = '{$persarr['T74']}',fjrfcertno = '{$persarr['T75']}',fjrfpassmth = '{$persarr['T76']}', fnetsub = '{$persarr['T77']}',fnetcertno = '{$persarr['T78']}', 
				fnetpassmth = '{$persarr['T79']}',fnetpoints = '{$net}',fsletpoints = '{$slet}',fsletsub = '{$persarr['T80']}',fsletcertno = '{$persarr['T81']}',fsletpassmth = '{$persarr['T82']}',
				fjrstate = '{$persarr['T83']}',fnetstate = '{$persarr['T84']}',fsletstate = '{$persarr['T85']}'
				where fuserid = '{$userid}'";
	$result3 = $aobj_context->mobj_db->Execute($query3);
	
	
	if($result1)  
	{
			$arr='Updated Successfuly';
			echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success"); 
			return;
	}	
	else
	{
		$arr='Insertion Failed';					 
		echo $aobj_context->mobj_output->ToJSONEnvelope($arr,-1,"failure"); 
		return;
	}
}

function loadEducationalDetails($aobj_context)
{
	$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);  
	session_start();
	$userid = $_SESSION['userid'];
	$appno   = stripslashes($aobj_context->mobj_data["appno"]);
	
	$query1  = "SELECT * FROM qualdetl 
			   where fuserid = '{$userid}' order by fenttype";
	$result1 = $aobj_context->mobj_db->GetAll($query1);
	
	$query2  = "SELECT fdegree, date_format(fdor,'%d/%m/%Y') as fdor,date_format(fdos,'%d/%m/%Y') as fdos,
				date_format(fdoa,'%d/%m/%Y') as fdoa,funivname,ftitle,fmarkstype,fpercent,fenttype FROM phddetl 
			   where fuserid = '{$userid}' order by fenttype";
	$result2 = $aobj_context->mobj_db->GetAll($query2);
	
		
	$query3  = "SELECT fjrfsub,fjrfcertno,fjrfpassmth,fnetsub,fnetcertno,
			    fnetpassmth,fsletsub,fsletcertno,fsletpassmth,fjrstate,fnetstate,fsletstate FROM perdetl 
			    where fuserid = '{$userid}' ";
	$result3 = $aobj_context->mobj_db->GetAll($query3);
	
	$query = "select fslno,fuserid, qualdetl.fdegree,mascourse.fdescpn as fdegreename, funivname, fyear, fsecmarks, fmaxmarks, fpercentage, fdivision, fsubjects, fpoints, fenttype
				from qualdetl left join mascourse on qualdetl.fdegree = mascourse.fdegree 
				where fuserid = '{$userid}' and fenttype = 'oth'";
		$results  = $aobj_context->mobj_db->getAll($query);
	//var_dump($query);	
		$i = 2;
		$table ='';
		foreach($results as $value)
		{
			$slno = $value[fslno];
			
			$table.="<tr style = 'width:90%'>";  
			$table.="<td>";
			$table.="<input type = 'hidden'  value = '{$value[fslno]}' id='achid1_{$i}'/><input type='hidden'   style='width:90%;' disabled id = '{$i}TH90' value = '{$value[fdegree]}' /><input type='text'   style='width:90%;' disabled id = '{$i}T90' value = '{$value[fdegreename]}' />";
			$table.="</td>"; 
			$table.="<td>";
			$table.="<input type='text' style='width:90%;' disabled id = '{$i}T91' value = '{$value[funivname]}'/>";
			$table.="</td>"; 
			$table.="<td>";
			$table.="<input type='text'   style='width:90%;' disabled id = '{$i}T92' value = '{$value[fyear]}' />";
			$table.="</td>"; 
			$table.="<td><input type='text'   style='width:90%;' disabled id = '{$i}T93' value = '{$value[fmaxmarks]}' /></td>";
			$table.="<td><input type='text'   style='width:90%;' disabled id = '{$i}T94' value = '{$value[fsecmarks]}' /></td>";
			$table.="<td><input type='text'   style='width:90%;' disabled id = '{$i}T95' value = '{$value[fpercentage]}' /></td>";
			$table.="<td><input type='text'   style='width:90%;' disabled id = '{$i}T96' value = '{$value[fdivision]}' /></td>";
			$table.="<td><input type='text'   style='width:90%;' disabled id = '{$i}T97' value = '{$value[fsubjects]}' /></td>";
			$table.="<td><input type='submit' class='btn btn_3 btn btn-info' value = 'Edit' onclick = 'editxpoth(\"$slno\",\"$i\")' id='{$i}BT9' style='width:90%;' ><br><br><input type='submit' value = 'delete' class='btn btn_3 btn btn-danger' onclick = 'deletexpoth(\"$slno\",\"$i\")' id='{$i}BT10' style='width:90%;' ></td>";
			$table.="</tr>";
			$i++;
		}

			$arr['table'] = $table;
			$arr['qualdetl'] = $result1;
			$arr['phddetl'] = $result2;
			$arr['perdetl'] = $result3;
		echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success"); 
		
}

function getdegree($aobj_context)
{
		$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
	
		$query4 = "SELECT fdegree AS internal_code, fdescpn AS value FROM mascourse 
		WHERE ffaculty = 'UG'";
		$result4 = $aobj_context->mobj_db->GetAll($query4);
		$arr['UG']=$result4;
		
		$query5 = "SELECT fdegree AS internal_code, fdescpn AS value FROM mascourse 
		WHERE ffaculty = 'PG'";
		$result5=$aobj_context->mobj_db->GetAll($query5);
		$arr['PG']=$result5;
		
		$query = "SELECT fdegree AS internal_code, fdescpn AS value FROM mascourse 
		WHERE ffaculty in('pg','ug','BEd','MEd')";
		$result=$aobj_context->mobj_db->GetAll($query);
		$arr['deg']=$result;

		echo $aobj_context->mobj_output->ToJSONEnvelope($arr,0,"success"); 
	
	
}

function saveexpoth($aobj_context)
{
	session_start();
	$userid = $_SESSION['userid'];
	$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
	$fdegree = trim($aobj_context->mobj_data["degree"]);
	$funivname = trim($aobj_context->mobj_data["funivname"]);
	$fyear = trim($aobj_context->mobj_data["fyear"]);
	$fmaxmarks = trim($aobj_context->mobj_data["fmaxmarks"]);
	$fsecmarks = trim($aobj_context->mobj_data["fsecuremarks"]);
	$fclass = trim($aobj_context->mobj_data["fclass"]);
	$fsub = trim($aobj_context->mobj_data["fsub"]);
	$fpercent = trim($aobj_context->mobj_data["percent"]);

	$ach = trim($aobj_context->mobj_data["ach"]); 
	$appno = trim($aobj_context->mobj_data["appno"]);

	if($ach == 'I')
	{
		$query = "insert into qualdetl(fuserid, fdegree, funivname, fyear, fsecmarks, fmaxmarks, fpercentage, fdivision, fsubjects, fenttype) 
				   values('{$userid}','{$fdegree}','{$funivname}','{$fyear}','{$fsecmarks}','{$fmaxmarks}','{$fpercent}','{$fclass}','{$fsub}','oth')";
		$results  = $aobj_context->mobj_db->Execute($query);	
	}
	else
	{
		$query = "update qualdetl set fdegree = '{$fdegree}',fyear = '{$fyear}',fsecmarks = '{$fsecmarks}',fmaxmarks = '{$fmaxmarks}',
			fpercentage = '{$fpercent}',fdivision = '{$fclass}',funivname = '{$funivname}',fsubjects = '{$fsub}'
			where fuserid = '{$userid}'  and fslno = '{$ach}'";
		$results  = $aobj_context->mobj_db->Execute($query);	
	}
	
	if($results)
	{
		$query = "select fslno,fuserid, qualdetl.fdegree,mascourse.fdescpn as fdegreename, funivname, fyear, fsecmarks, fmaxmarks, fpercentage, fdivision, fsubjects, fpoints, fenttype
				from qualdetl left join mascourse on qualdetl.fdegree = mascourse.fdegree 
				where fuserid = '{$userid}' and fenttype = 'oth'";
		$results  = $aobj_context->mobj_db->getAll($query);
		
		$i = 2;
		$table ='';
		foreach($results as $value)
		{
			$slno = $value[fslno];
			
			$table.="<tr style = 'width:90%'>";  
			$table.="<td>";
			$table.="<input type = 'hidden'  value = '{$value[fslno]}' id='achid1_{$i}'/><input type='hidden'   style='width:90%;' disabled id = '{$i}TH90' value = '{$value[fdegree]}' /><input type='text'   style='width:90%;' disabled id = '{$i}T90' value = '{$value[fdegreename]}' />";
			$table.="</td>"; 
			$table.="<td>";
			$table.="<input type='text' style='width:90%;' disabled id = '{$i}T91' value = '{$value[funivname]}'/>";
			$table.="</td>"; 
			$table.="<td>";
			$table.="<input type='text'   style='width:90%;' disabled id = '{$i}T92' value = '{$value[fyear]}' />";
			$table.="</td>"; 
			$table.="<td><input type='text'   style='width:90%;' disabled id = '{$i}T93' value = '{$value[fmaxmarks]}' /></td>";
			$table.="<td><input type='text'   style='width:90%;' disabled id = '{$i}T94' value = '{$value[fsecmarks]}' /></td>";
			$table.="<td><input type='text'   style='width:90%;' disabled id = '{$i}T95' value = '{$value[fpercentage]}' /></td>";
			$table.="<td><input type='text'   style='width:90%;' disabled id = '{$i}T96' value = '{$value[fdivision]}' /></td>";
			$table.="<td><input type='text'   style='width:90%;' disabled id = '{$i}T97' value = '{$value[fsubjects]}' /></td>";
			$table.="<td><input type='submit' class='btn btn_3 btn btn-info' value = 'Edit' onclick = 'editxpoth(\"$slno\",\"$i\")' id='{$i}BT9' style='width:90%;' ><br><br><input type='submit' value = 'delete' class='btn btn_3 btn btn-danger' onclick = 'deletexpoth(\"$slno\",\"$i\")' id='{$i}BT10' style='width:90%;' ></td>";
			$table.="</tr>";
			$i++;
		}

		$rst['table'] = $table;
		echo $aobj_context->mobj_output->ToJSONEnvelope($rst,0,"success");
			
	}else
	{
		$query = "select fslno,fuserid, qualdetl.fdegree,mascourse.fdescpn as fdegreename, funivname, fyear, fsecmarks, fmaxmarks, fpercentage, fdivision, fsubjects, fpoints, fenttype
				from qualdetl left join mascourse on qualdetl.fdegree = mascourse.fdegree 
				where fuserid = '{$userid}' and fenttype = 'oth'";
		$results  = $aobj_context->mobj_db->getAll($query);
		
		$i = 2;
		$table ='';
		foreach($results as $value)
		{
			$slno = $value[fslno];
			
			$table.="<tr style = 'width:90%'>";  
			$table.="<td>";
			$table.="<input type = 'hidden'  value = '{$value[fslno]}' id='achid1_{$i}'/><input type='hidden'   style='width:90%;' disabled id = '{$i}TH90' value = '{$value[fdegree]}' /><input type='text'   style='width:90%;' disabled id = '{$i}T90' value = '{$value[fdegreename]}' />";
			$table.="</td>"; 
			$table.="<td>";
			$table.="<input type='text' style='width:90%;' disabled id = '{$i}T91' value = '{$value[funivname]}'/>";
			$table.="</td>"; 
			$table.="<td>";
			$table.="<input type='text'   style='width:90%;' disabled id = '{$i}T92' value = '{$value[fyear]}' />";
			$table.="</td>"; 
			$table.="<td><input type='text'   style='width:90%;' disabled id = '{$i}T93' value = '{$value[fmaxmarks]}' /></td>";
			$table.="<td><input type='text'   style='width:90%;' disabled id = '{$i}T94' value = '{$value[fsecmarks]}' /></td>";
			$table.="<td><input type='text'   style='width:90%;' disabled id = '{$i}T95' value = '{$value[fpercentage]}' /></td>";
			$table.="<td><input type='text'   style='width:90%;' disabled id = '{$i}T96' value = '{$value[fdivision]}' /></td>";
			$table.="<td><input type='text'   style='width:90%;' disabled id = '{$i}T97' value = '{$value[fsubjects]}' /></td>";
			$table.="<td><input type='submit' class='btn btn_3 btn btn-info' value = 'Edit' onclick = 'editxpoth(\"$slno\",\"$i\")' id='{$i}BT9' style='width:90%;' ><br><br><input type='submit' value = 'delete' class='btn btn_3 btn btn-danger' onclick = 'deletexpoth(\"$slno\",\"$i\")' id='{$i}BT10' style='width:90%;' ></td>";
			$table.="</tr>";
			$i++;
		}

		$rst['table'] = $table;
		echo $aobj_context->mobj_output->ToJSONEnvelope($rst,0,"success");
	}
}

function deletexpoth($aobj_context)
{
	session_start();
	$userid = $_SESSION['userid'];
	$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
	
	$appno = trim($aobj_context->mobj_data["appno"]);
	$slno = trim($aobj_context->mobj_data["slno"]);
	
	$query = "delete from qualdetl where fuserid = '{$userid}'  and fslno = '{$slno}' and fenttype = 'oth'";
	$results  = $aobj_context->mobj_db->Execute($query);	
	if($results)
	{
		$query = "select fslno,fuserid, qualdetl.fdegree,mascourse.fdescpn as fdegreename, funivname, fyear, fsecmarks, fmaxmarks, fpercentage, fdivision, fsubjects, fpoints, fenttype
				from qualdetl left join mascourse on qualdetl.fdegree = mascourse.fdegree 
				where fuserid = '{$userid}' and fenttype = 'oth'";
		$results  = $aobj_context->mobj_db->getAll($query);
		
		$i = 2;
		$table ='';
		foreach($results as $value)
		{
			$slno = $value[fslno];
			
			$table.="<tr style = 'width:90%'>";  
			$table.="<td>";
			$table.="<input type = 'hidden'  value = '{$value[fslno]}' id='achid1_{$i}'/><input type='hidden'   style='width:90%;' disabled id = '{$i}TH90' value = '{$value[fdegree]}' /><input type='text'   style='width:90%;' disabled id = '{$i}T90' value = '{$value[fdegreename]}' />";
			$table.="</td>"; 
			$table.="<td>";
			$table.="<input type='text' style='width:90%;' disabled id = '{$i}T91' value = '{$value[funivname]}'/>";
			$table.="</td>"; 
			$table.="<td>";
			$table.="<input type='text'   style='width:90%;' disabled id = '{$i}T92' value = '{$value[fyear]}' />";
			$table.="</td>"; 
			$table.="<td><input type='text'   style='width:90%;' disabled id = '{$i}T93' value = '{$value[fmaxmarks]}' /></td>";
			$table.="<td><input type='text'   style='width:90%;' disabled id = '{$i}T94' value = '{$value[fsecmarks]}' /></td>";
			$table.="<td><input type='text'   style='width:90%;' disabled id = '{$i}T95' value = '{$value[fpercentage]}' /></td>";
			$table.="<td><input type='text'   style='width:90%;' disabled id = '{$i}T96' value = '{$value[fdivision]}' /></td>";
			$table.="<td><input type='text'   style='width:90%;' disabled id = '{$i}T97' value = '{$value[fsubjects]}' /></td>";
			$table.="<td><input type='submit' class='btn btn_3 btn btn-info' value = 'Edit' onclick = 'editxpoth(\"$slno\",\"$i\")' id='{$i}BT9' style='width:90%;' ><br><br><input type='submit' value = 'delete' class='btn btn_3 btn btn-danger' onclick = 'deletexpoth(\"$slno\",\"$i\")' id='{$i}BT10' style='width:90%;' ></td>";
			$table.="</tr>";
			$i++;
		}

		$rst['table'] = $table;
		echo $aobj_context->mobj_output->ToJSONEnvelope($rst,0,"success");
	}
}
?>