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

$getbroker = mysqli_query($conn, "SELECT `name` FROM `accmast` WHERE grpcode = '040' $searchcond group by `name` order by `name` ") or die(mysqli_error($conn));

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

    $broker = $r['name'];

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

?>