<?php

require("includes/check_auth_user.php");
require("includes/dbconnect.php");
include ('includes/function.php');
$zdb = $_SESSION["zdbyear_" . $dbname];
mysqli_select_db($conn,$zdb);
$admin = $_SESSION["admin_" . $dbname];

if ($_REQUEST["ctr"]) {

    $ctr = $_REQUEST["ctr"];
    $party = $_REQUEST["srchparty"];
    $partycond = "";
    if ($party != '') {
        $partycond = "and `name` LIKE '$party%'";
    }

    $getparty = mysqli_query($conn,"SELECT `accode`, `name` FROM `accmast` WHERE `accode`!='' $partycond order by name asc")or die(mysqli_error($conn));
    while ($fparty = mysqli_fetch_array($getparty)) {

        Echo "<tr>";
        Echo "<td><input type='text' name='disblsrchparty' class='form-control disblsrchparty' value='$fparty[name]'></td>";
        Echo "</tr>";
        $ctr++;
    }
} else {
    echo "ERROR";
}
?>