<?php

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


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

$searchTerm = $_REQUEST["passport"];
$searchcond = "";
if (!empty($searchTerm)) {
    $searchcond = "and `passport` = '$searchTerm'";
}

$getsponsor = mysqli_query($conn, "SELECT manualno FROM `visamain` WHERE myvouch in (select myvouch from visatran where passport='$searchTerm') group by manualno order by manualno") or die(mysqli_error($conn));

while ($r = mysqli_fetch_array($getsponsor)) {

    echo "<option value='$r[manualno]'>$r[manualno]</option>";
}
?>