<?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;

$monthno = $_REQUEST['monthno'];
$vouchno = $_REQUEST['vouchno'];
$memno = $_REQUEST['memno'];
$memname = $_REQUEST['memname'];


$genrecp = mysqli_query($conn, "SELECT * FROM `widowpay` where `vouchno` != '$vouchno' and monthno ='$monthno' and (party = '$memno' or party ='$memname') ") or die(mysqli_error($conn));
if (mysqli_num_rows($genrecp) > 0) {
    $fetrecp = mysqli_fetch_assoc($genrecp);
    $mrecpno = $fetrecp['vouchno'];
    echo "$mrecpno";
}
?>