<?php
require("includes/check_auth_user.php");
require("includes/dbconnect.php");
include('includes/function.php');
//include('includes/spdfeImage.php');

$zdb = $_SESSION["zdbyear_" . $dbname];
$zyear = right($zdb, 4);
mysqli_select_db($conn, $zdb);

$success = false;
if (isset($_REQUEST["vouchno"]) != "") {
    
    $vouchno = $_REQUEST["vouchno"];
    $series  = $_REQUEST["series"];

    $getImage   = mysqli_query($conn, "SELECT `pdfpath` FROM `visamain` WHERE `myvouch`='$vouchno'")or die(mysqli_error($conn));
    $gimage     = mysqli_fetch_array($getImage);
    $image      = $gimage['pdfpath']."?a=". mt_rand(0,500);
    $success   = true;
    
    $row = array(
    "success" => $success,
    "image"   => $image,
    );
    
    header("Content-type: application\json");
    Echo json_encode($row);
}
?>