<?php

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

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

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

    $getsl = mysqli_query($conn, "SELECT vouchno FROM `sordmain` WHERE `vouchno` = '$saleorder' ")or die(mysqli_error($conn));
    if (mysqli_num_rows($getsl) > 0) {
        $data = array('success' => true);
    } else {
        $data = array('success' => false);
    }
} else {
    $data = array('success' => false);
}
header('Content-Type: application/json');
echo json_encode($data);
?>
