<?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"];
$manual = $_REQUEST["manualno"];

$qry = mysqli_query($conn, "SELECT  a.manualno,a.visano, a.broker, b.passport,b.submission_date, b.stampdate ,b.mofa_date,b.paxname,b.mofano,b.myvouch,b.memcash, b.releasedt,b.tremark, b.appdt, b.jobid, b.enno 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'],
    'broker' => $row['broker'],
    'enno' => $row['enno'],
    'jobid' => $row['jobid'],
    'appdt' => $row['appdt'],
    'mofano'   => $row['mofano'],
    'visano'   => $row['visano'],
    'mofa_date'   => $row['mofa_date'],
    'submission_date'=> $row['submission_date'],
    'stampdate'=> $row['stampdate'],
    'paxname' => $row['paxname'],
    'courdt' => $row['courdt'],
    'releasedt' => $row['releasedt'],
    'courier' => $row['courier'],
    'awbillno' => $row['awbillno'],
    'memcash' => $row['memcash'],
    'tremark' => $row['tremark'],
    'myvouch' => $row['myvouch'],
//    'paxname' => $row['paxname'],
];
$ctr2++;

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