<?php

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

$admin = $_SESSION["admin_" . $dbname];
$zdb = $_SESSION["zdbyear_" . $dbname];
$myyear = $_SESSION[$myyear];
mysqli_select_db($conn, $zdb);

$maindb = 'compyear';
$trandb = '';
$zroot = $_SESSION["zdbroot"];
$vouchdt = $_REQUEST["vouchdt"];

$sucs = 0;
$slmain = mysqli_query($conn, "SELECT * from $zroot.compyear WHERE finyear =  '$myyear'  ") or die(mysqli_error($conn));
$ftmain = mysqli_fetch_array($slmain);
$sldt = $ftmain['salelock'];
if ($sldt != '0000-00-00') {
    if ($vouchdt <= $sldt) {
        $sucs = "1";
    }
}
echo $sucs;
?>
