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


Current Path : /var/www/html/orms-gug/src/
Upload File :
Current File : /var/www/html/orms-gug/src/payment_det1.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"]);
	
	$appno = $userid.$postappiled.$subjectapplied;
	//$_SESSION['appno'] = $appno;
	$query = "insert ingnore into postdet values('{$userid}','{$postappiled}','{$subjectapplied}','{$appno}','{$fvacancies}')";
	$results  = $aobj_context->mobj_db->Execute($query);

	if($results)
	{
		$query = "insert ignore into perdetl(fuserid) values('{$userid}')";
		$result  = $aobj_context->mobj_db->Execute($query);
	}
	//var_dump($query);
	if($results)
	{
		$query = "select md.fdegndesc,mc.fdescpn,p.fappno,p.fvacancies 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)
		{
			
			$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><button  id='postapp_{$i}' onclick = 'main_menu({$i});' class='form-control1'>Apply</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 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)
		{
			
			$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><button  id='postapp_{$i}' onclick = 'main_menu({$i});' class='form-control1'>Apply</button></td>";
			$table.="</tr>";
			$i++;
		}
		
		$rst['table'] = $table;
		echo $aobj_context->mobj_output->ToJSONEnvelope($rst,-1,"success");
	}		
	
}
	
function loadPaymentDetails($aobj_context)
{
	$userid = $_SESSION['userid'];
	$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
	
	$appno = trim($aobj_context->mobj_data["appno"]);
	$postname = trim($aobj_context->mobj_data["postname"]);
	$post_subject = trim($aobj_context->mobj_data["post_subject"]);
	$str = "";

	$sql = "select P.* from perdetl where fuserid = '{$userid}'";
	$res  = $aobj_context->mobj_db->getRow($sql);

	$query1 = "select * from perdetl where ifnull(fmobile,'') <> '' and ifnull(fdob,'')<> '' and ifnull(fage,'')<> ''
			and ifnull(fbirthplace,'') <> '' and ifnull(ffatname,'')<>'' and ifnull(fmotname,'')<>'' 
			and ifnull(fnational,'')<>''
			and ifnull(fcatcode,'') <> '' and ifnull(fmarstatus,'') <> '' and ifnull(fcomadd1,'') <> ''
			and ifnull(fcomadd2,'')<>''   and ifnull(fperadd1,'') <> ''   and ifnull(fperadd2,'') <> ''
			and ifnull(femailid,'') <> '' and ifnull(fmobile,'') <> ''    and ifnull(f371j,'') <> ''
			and fuserid = '{$userid}' ";
	$results1  = $aobj_context->mobj_db->getRow($query1);


	
	if($results1)
	{
		
	}else
	{
		$str.="<span style = 'color:red;'>Please Enter Personal Details</span><br>";
	}	
	
	$query2 = "select * from qualdetl where fuserid = '{$userid}'";
	$results2  = $aobj_context->mobj_db->getAll($query2);
	//var_dump($query2);
	if($results2)
	{
		
	}else
	{
		$str.="<span style = 'color:red;'>Please Enter Educational Details</span><br>";
	}
	
	$query3 = "select * from otherdet where ifnull(FPUNISHEDGC,'')<> '' and ifnull(FUNFIT,'')<> ''
			and ifnull(FCRIMINAL,'') <> '' and ifnull(FREFNAME1,'')<>'' and ifnull(FREFNAME2,'')<>'' 
			and ifnull(FREFINST1,'')<>'' and ifnull(FREFDESG1,'')<>'' and ifnull(FREFADD1,'')<>'' and ifnull(FREFMOBILE1,'')<>'' and ifnull(FREFEMAIL1,'')<>''
			and ifnull(FREFINST2,'')<>'' and ifnull(FREFDESG2,'')<>'' and ifnull(FREFADD2,'')<>'' and ifnull(FREFMOBILE2,'')<>'' and ifnull(FREFEMAIL2,'')<>''
			and fuserid = '{$userid}'  and fappno = '{$appno}'";	
	$results3  = $aobj_context->mobj_db->getAll($query3);
	
	if($results3)
	{
		
	}else
	{
		$str.="<span style = 'color:red;'>Please Enter Other Details</span><br>";
	}
	
	
	$query7 = "select * from upload where fuserid = '{$userid}' and fappno = '{$appno}' and ftype = 'photo'";
	$results7  = $aobj_context->mobj_db->getRow($query7);
	
	if($results7)
	{
		
	}else
	{
		$str.="<span style = 'color:red;'>Please Upload Photo</span><br>";
	}
	
	$query8 = "select * from upload where fuserid = '{$userid}' and fappno = '{$appno}' and ftype = 'signature'";
	$results8  = $aobj_context->mobj_db->getRow($query8);
	
	if($results8)
	{
		
	}else
	{
		$str.="<span style = 'color:red;'>Please Upload Signature</span><br>";
	}

	$sql = "select * from perdetl where fuserid = '{$userid}'";
	$res  = $aobj_context->mobj_db->getRow($sql);

	$query8 = "select * from upload where fuserid = '{$userid}' and fappno = '{$appno}' and ftype = '371j'";
	$results8  = $aobj_context->mobj_db->getRow($query8);
	
	if($results8)
	{
		
	}else
	{
		$str.="<span style = 'color:red;'>Please Upload Article 371J certificate</span><br>";
	}

	
	$query9 = "select * from upload where fuserid = '{$userid}' and fappno = '{$appno}' and ftype = '10'";
	$results9  = $aobj_context->mobj_db->getRow($query9);
	
	if($results9)
	{
		
	}else
	{
		$str.="<span style = 'color:red;'>Please Upload Matric/Secondary/High School (10th Class) Certificate</span><br>";
	}
	
	if($res['fcatcode'] != '11')
	{	
		$query9 = "select * from upload where fuserid = '{$userid}' and fappno = '{$appno}' and ftype = 'sc'";
		$results9  = $aobj_context->mobj_db->getRow($query9);
		
		if($results9)
		{
			
		}else
		{
			$str.="<span style = 'color:red;'>Please Upload SC/ST/PD/OBC Certificate </span><br>";
		}
	}

	if($res['frural'] == 'TRUE')
	{
		$query9 = "select * from upload where fuserid = '{$userid}' and fappno = '{$appno}' and ftype = 'rural'";
		$results9  = $aobj_context->mobj_db->getRow($query9);
		
		if($results9)
		{
			
		}else
		{
			$str.="<span style = 'color:red;'>Please upload rural certificate</span><br>";
		}
	}

	if($res['fexservice'] == 'TRUE')
	{
		$query9 = "select * from upload where fuserid = '{$userid}' and fappno = '{$appno}' and ftype = 'exservice'";
		$results9  = $aobj_context->mobj_db->getRow($query9);
		
		if($results9)
		{
			
		}else
		{
			$str.="<span style = 'color:red;'>Please upload ex-service certificate</span><br>";
		}
	}

	if($res['fph'] == 'T')
	{
		$query9 = "select * from upload where fuserid = '{$userid}' and fappno = '{$appno}' and ftype = 'pwd'";
		$results9  = $aobj_context->mobj_db->getRow($query9);
		
		if($results9)
		{
			
		}else
		{
			$str.="<span style = 'color:red;'>Please upload PWD certificate</span><br>";
		}
	}

	if($res['fkanmedium'] == 'TRUE')
	{
		$query9 = "select * from upload where fuserid = '{$userid}' and fappno = '{$appno}' and ftype = 'kan'";
		$results9  = $aobj_context->mobj_db->getRow($query9);
		
		if($results9)
		{
			
		}else
		{
			$str.="<span style = 'color:red;'>Please upload kannada medium certificate</span><br>";
		}
	}	
	
	if($str == '')
	{	
		$query = "SELECT p.fuserid,s.fname,p.fappno,p.fvacancies,s.fph,if('{$postname}' = 'ASSISTANT PROFESSOR',ifnull(c.famount,0),ifnull(c.fpamount,0)) as famount
				  FROM perdetl s INNER JOIN mascat c ON s.fcatcode  = c.fcatid
				  INNER JOIN postdet p ON s.fuserid = p.fuserid
				  where p.fuserid = '{$userid}' and p.fappno = '{$appno}'";
			
		$results  = $aobj_context->mobj_db->getRow($query);
		
		$appno = $results['fappno'];
	
		if($results['fph'] == 'T')
		{
			if($postname  == 'ASSISTANT PROFESSOR')
				$results['famount'] = "1000";
			else
				$results['famount'] = "1500";
		}	
	
		if($results['famount'] == 0)
		{	
			$cariavle ="<button class='btn btn_3 btn btn-info' onclick = 'Printapplication(\"{$appno}\")'>Submit</button>";
			
		}else
		{
			$cariavle ="<button class='btn btn_3 btn btn-info' onclick = 'MakeOnlinePayment(\"{$appno}\");' >Make Payment</button>";
		}	
		
		$table ='<p><span style = "color:red">Note:</span><b>Application Fee is non refundable</b></p><br><br>';
		$table.='<table class="table table-bordered" style="width:97%;" id="postdettable">';
		$table.='<thead>';
		$table.='<tr>'; 									
		$table.='<th style="width:25%; text-align:center">Name</th>';
		$table.='<th style="width:15%; text-align:center">Application Number</th>'; 
		$table.='<th style="width:20%; text-align:center">Post Applied for</th>';
		$table.='<th style="width:20%; text-align:center">Department</th>';
		$table.='<th style="width:10%; text-align:center">Amount</th>';		
		$table.='<th style="width:15%; text-align:center">Action</th>';									
		$table.='</tr></thead><tbody>';
		
		$table.="<tr style = 'height:25px;'>"; 										
		$table.="<td align='center'>{$results['fname']}</td>";
		$table.="<td align='center'>{$appno}</td>";
		$table.="<td align='center'>{$postname}</td>";
		$table.="<td align='center'>{$post_subject}</td>";
		$table.="<td align='center'>{$results['famount']}</td>";
		$table.="<td align='center'>{$cariavle}</td>";
		$table.="</tr>";
	}	
	if($results)
	{	
		$rst['table'] = $table;
		echo $aobj_context->mobj_output->ToJSONEnvelope($rst,0,"success");
	}else
	{
		$rst['table'] = $str;
		echo $aobj_context->mobj_output->ToJSONEnvelope($rst,-1,"Failure");
	}		
}

function makeOnlinepaymentdetails($aobj_context)
{
	$userid = $_SESSION['userid'];
	$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
	
	$appno = trim($aobj_context->mobj_data["appno"]);
	//$query = "update postdet set fappstatus = 'T' where fappno = '{$appno}' and fuserid = '{$userid}'";
	//$results  = $aobj_context->mobj_db->Execute($query);
	
	if(true)
	{	
		echo $aobj_context->mobj_output->ToJSONEnvelope($results,0,"success");
	}
}

function Printapplicationdetails($aobj_context)
{
	$userid = $_SESSION['userid'];
	$aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);
	
	$appno = trim($aobj_context->mobj_data["app_no"]);
	$query = "update postdet set fappstatus = 'T',fpaymentstatus = 'success' where fappno = '{$appno}' and fuserid = '{$userid}'";
	$results  = $aobj_context->mobj_db->Execute($query);
	//var_dump($query);
	if($results)
	{	
		echo $aobj_context->mobj_output->ToJSONEnvelope($results,0,"success");
	}
}

?>