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


mysqli_query($conn, "SET NAMES 'utf8'");
mysqli_query($conn, 'SET CHARACTER SET utf8');

header('Content-Type: text/html;charset=UTF-8');
ini_set('default_charset', 'utf-8');

$maindb = 'visamain';
$trandb = 'visatran';

$file = 'visa_pdf.php';
$formname = "Visaform";
$keyfld = "vouchno";

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

$admin = $_SESSION["admin_" . $dbname];
$myvouch = $_REQUEST["voucher"];
$ppno = $_REQUEST["passport"];
$passport = trim($ppno);

// browse($passport);
$pname = $getacc['name'];
$add1 = $getacc['add1'];
$add2 = $getacc['add2'];
$mainqry = mysqli_query($conn, "SELECT a. *, b. * FROM `$maindb` a, `$trandb` b WHERE a.vouchno = '$myvouch' ") or die(mysqli_error($conn));
//print table($mainqry);
//die();
$fetdata = mysqli_fetch_array($mainqry);
$sponsor = $fetdata['sponsor'];
$mofano = $fetdata['mofano'];
$mofano2 = $fetdata['mofano2'];
$imagepath = $fetdata['imagepath'];
$visapdf = $fetdata['visapdf'];
?>
<!DOCTYPE html>

<head>
    <title>VISA PDF</title>
</head>

<body>
    <iframe src="<?= $visapdf ?>" width="100%" style="height:100%"></iframe>
    <?php browse ($visapdf); ?>
</body>

</html>