<?php
session_start();
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Methods: GET, POST');
header("Access-Control-Allow-Headers: X-Requested-With");
header('Content-Type: application/json; charset=utf-8');


if(isset($_POST['user_id']) && isset($_POST['app_id']))
{
    
include 'config.php';
$user_id=$_POST['user_id'];
$app_id=$_POST['app_id'];

$user_id=stripslashes($user_id);
$user_id=mysqli_escape_string($con, $user_id);

$app_id=stripslashes($app_id);
$app_id=mysqli_escape_string($con, $app_id);



$date_t = date("d-m-Y");
$date_t2 = date("m/d/Y");
$date_t2 = strtotime($date_t);



           $sql="SELECT * FROM applications	 where application_id = '$app_id' AND user_id = '$user_id'";
           $resulta = mysqli_query($con,$sql) or die(mysqli_error($con));
           $rowa = mysqli_fetch_array($resulta);
           $passport = $rowa['passport'];
           $intl_pass = $rowa['intl_pass'];

       if($intl_pass == "" || $passport == "")
       {
       
$status = false;
$suc = "Incomplete Doc";
}
else
{
$status = true;
$suc = "Uploaded";
}

$output = array('status' => $status, 'success'=>$suc, 'user_id' => $user_id, 'app_id'=> $app_id);
echo json_encode($output); //output JSON data

}
else
{
$status = false;
$suc = "Incomplete Parameters";

$output = array('status' => $status, 'success'=>$suc);
echo json_encode($output); //output JSON data

}

?>