<?php

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

$maindb = 'visamain';
$trandb = 'visatran';

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

$passport = $_REQUEST["passport"];

$qry = mysqli_query($conn, "SELECT  a.manualno,b.passport,b.submission_date, b.stampdate ,b.mofa_date,b.paxname,b.mofano,b.myvouch FROM `$maindb` a , `$trandb` b where a.myvouch= b.myvouch and b.passport ='$passport' ") or die(mysqli_error($conn));
$rows = array();
$ctr2 = 0;
$pctr2 = 1;
$row = mysqli_fetch_array($qry);

$rows[] = ['success' => true,
    'manualno' => $row['manualno'],
    'passport' => $row['passport'],
    'mofano'   => $row['mofano'],
    'mofa_date'   => $row['mofa_date'],
    'submission_date'=> $row['submission_date'],
    'stampdate'=> $row['stampdate'],
    'paxname' => $row['paxname'],
    'courdt' => $row['courdt'],
    'courier' => $row['courier'],
    'awbillno' => $row['awbillno'],
    'myvouch' => $row['myvouch'],
//    'paxname' => $row['paxname'],
];
$ctr2++;

header("Content-type: application/json");
echo json_encode($rows);
?>