<?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["vouchno"]) {
    $vouchno = $_REQUEST["vouchno"];
    $invno = $_REQUEST["invno"];
    $genrecp = mysqli_query($conn, "SELECT vouchno FROM `gstmain` WHERE vouchno != '$vouchno' AND  invno = '$invno' ") or die(mysqli_error($conn));
    $fetrecp = mysqli_fetch_array($genrecp);
    $mvouchno = $fetrecp['vouchno'];
    echo "$mvouchno";
}
