<?php

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

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


if (isset($_REQUEST["party"])) {
    $party = $_REQUEST["party"];
//browse($party);

    $getdata = mysqli_query($conn, "SELECT `ledgfrom`, `ledgto` FROM `accmast` WHERE accode='$party'")or die(mysqli_error($conn));
    $data1 = mysqli_fetch_array($getdata);

    echo $data1['ledgto'];
}
if (isset($_REQUEST["broker"])) {
    $broker = $_REQUEST["broker"];
//browse($party);

    $getdata = mysqli_query($conn, "SELECT `agentcc` FROM `accmast` WHERE accode='$broker'")or die(mysqli_error($conn));
    $data1 = mysqli_fetch_array($getdata);

    echo $data1['agentcc'];
}
?>