<?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];
$success = false;


if ($_REQUEST["autovouch"]) {
    $autovouch = $_REQUEST["autovouch"];

    $getsale = mysqli_query($conn, "Select party from salemain where vouchno = '$autovouch' ") or die(mysqli_error($conn));
    $fetsale = mysqli_fetch_array($getsale);

    $getpart = mysqli_query($conn, "Select oms from accmast where accode = '$fetsale[party]'") or die(mysqli_error($conn));
    $fetpart = mysqli_fetch_array($getpart);

    $oms = $fetpart['oms'];
    echo "$oms";
}
?>