<?php

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

$zdb = $_SESSION["zdbyear_$dbname"];
mysqli_select_db($conn, $zdb);
$fseries = $_SESSION["series_" . $dbname];

$invno = $_REQUEST["invno"];
$invdt = $_REQUEST["vouchdt"];
$vouchno = $_REQUEST["vouchno"];
$code = $_REQUEST["party"];

$getprate = mysqli_query($conn, "SELECT `invno`, `vouchdt`,`vouchno`, `party` FROM `salemain` WHERE  
                                             `invno`= '$invno' and `vouchdt`= '$invdt' and `vouchno` != '$vouchno' and series = '$fseries'")or die(mysqli_error($conn));

if (!empty($getprate)) {
    $row = mysqli_num_rows($getprate);
} else {
    $row = 0;
}
echo "$row";
?>
