<?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 `broker` LIKE N'%$searchTerm%'";
}

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

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

    $broker = $r['broker'];

    echo "<tr class=''>";
    echo "<td class='tdbroker'>$broker</td>";
    echo "</tr>";
}

?>