<?php
ob_start();

include('../db_con.php');
include 'methodlist.php';

session_start();

$id = intval($_REQUEST['appid']);

$result = @mysqli_query($con,"select paystatus from applicant_table where app_id='$id'");
$row=@mysqli_fetch_array($result);
$userid=get_session_user_id($con);

if($row["paystatus"]==0){
	
	$sql = "UPDATE applicant_table SET paystatus=1, paydoneby='$userid', `paydonetime` ='$now' WHERE app_id=$id";
	@mysqli_query($con,$sql);

	//$cresult = @mysqli_query($con,"select * from applicant_table where parent='$id'");
	
	//if(mysqli_num_rows($cresult)>0){
		
	//	while($crow=@mysqli_fetch_array($cresult)){

	//	$sql = "UPDATE applicant_table SET paystatus=1, paydoneby='$userid', `paydonetime` ='$now' WHERE app_id=$crow[app_id]";
	//	@mysqli_query($con,$sql);
	//	ver_update_history('Payment status updated from <b> Pending </b> to <b> Done </b> by', $crow[app_id], $con);
		
	//	}
	//}

	ver_update_history('Payment status updated from <b> Pending </b> to <b> Done </b> by', $id, $con);
}


//header("Location: verification.php");

?>