<?php
require("includes/check_auth_user.php");
require("includes/dbconnect.php");
include ('includes/function.php');

$zdb = $_SESSION["zdbyear_" . $dbname];
mysqli_select_db($conn, $zdb);

$passport = trim($_REQUEST["passport"]); 
$visano = trim($_REQUEST["visano"]); 
$mofano = trim($_REQUEST["mofano"]); 
$myvouch  = $_REQUEST["myvouch"]; 

$getvisamofa = mysqli_query($conn, "SELECT a.`passport`,a.`vouchdt` , b.`myvouch`, b.visano FROM visatran a , visamain b WHERE passport = '$passport' visano =  '$visano' and mofano = '$mofano' and myvouch != '$myvouch'  ") or die(mysqli_error($conn));

$r = mysqli_fetch_array($getvisamofa); 
     $passport = $r['passport']; 
     $myvouch = $r['myvouch'];
     $vouchdt = $r['vouchdt'];

header("Content-type: application\json");
echo json_encode($r);

?>