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


Current Path : /var/www/html/cuk/orms_wait/src_old/
Upload File :
Current File : //var/www/html/cuk/orms_wait/src_old/post.php

<?php

function savepost($aobj_context)
{
	session_start();
	$userid = $_SESSION['userid'];
	$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
	$post = trim($aobj_context->mobj_data["post"]);
	$subject = trim($aobj_context->mobj_data["subject"]);
	
	$appno = $userid.$post.$subject;
	
	$query = "insert into postdet values('{$userid}','{$post}','{$subject}','{$appno}')";
	$results  = $aobj_context->mobj_db->Execute($query);	
	
	if($results)
	{
		$query = "select md.fdegndesc,mc.fdescpn,p.fappno 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);
		
		/* $table ='<table class="table table-bordered" style="width:900px;" id="postdettable">';
		$table.='<thead>';
		$table.='<tr>'; 								
		$table.='<th style="width:50px;">Sl. No.</th>';		
		$table.='<th style="width:200px;">Post Applied for</th>';
		$table.='<th style="width:250px;">Department Name (subject)</th>'; 
		$table.='<th style="width:100px;">Application Number</th>';	
		$table.='<th style="width:50px;">Action</th>';									
		$table.='</tr></thead><tbody>'; */
		$i = 1;
		$table ='';
		foreach($results as $value)
		{
			
			$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='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><button  id='postapp_{$i}' class='form-control1'>Apply<button></td>";
			$table.='</tr>';
			$i++;
		}
									
	}		
		$rst['table'] = $table;
	echo $aobj_context->mobj_output->ToJSONEnvelope($rst,0,"success");
}
	
function loadapplieddetails($aobj_context)
{
	$userid = $_SESSION['userid'];
	$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
	
	
	
		$query = "select md.fdegndesc,mc.fdescpn,p.fappno 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);
		
		/* $table ='<table class="table table-bordered" style="width:900px;" id="postdettable">';
		$table.='<thead>';
		$table.='<tr>'; 								
		$table.='<th style="width:50px;">Sl. No.</th>';		
		$table.='<th style="width:200px;">Post Applied for</th>';
		$table.='<th style="width:250px;">Department Name (subject)</th>'; 
		$table.='<th style="width:100px;">Application Number</th>';	
		$table.='<th style="width:50px;">Action</th>';									
		$table.='</tr></thead><tbody>'; */
		$i = 1;
		$table ='';
		foreach($results as $value)
		{
			
			$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='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><button  id='postapp_{$i}' onclick = 'main_menu({$i});' class='form-control1'>Apply<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;  
}

?>