<?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["ssearch"];
$searchcond = "";
if (!empty($searchTerm)){
    $searchcond = "and `sponsor` LIKE N'%$searchTerm%'";
}

$getsponsor = mysqli_query($conn, "SELECT `sponsor` FROM `visamain` WHERE sponsor != '' $searchcond group by sponsor order by sponsor ") or die(mysqli_error($conn));

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

    $sponsor = $r['sponsor'];

    echo "<tr class=''>";
    echo "<td class='tdsponsor'>$sponsor</td>";
    echo "</tr>";
}

?>