<?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["myvouch"];
$ppno = $_REQUEST["passport"];
$passport = trim($ppno);

// browse($passport);
$pname = $getacc['name'];
$add1 = $getacc['add1'];
$add2 = $getacc['add2'];
// /browse($passport);
// $mainqry = mysqli_query($conn, "SELECT a. *, b. * FROM `$maindb` a, `$trandb` b WHERE a.vouchno = '$myvouch' and a.vouchno=b.vouchno and b.passport='$passport'") or die(mysqli_error($conn));
$mainqry = mysqli_query($conn, "SELECT visapdf from `$trandb`  WHERE vouchno = '$myvouch' and passport='$passport'") or die(mysqli_error($conn));
$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>
    <style type="text/css">
        iframe{      
        display: block;  /* iframes are inline by default */   
        height: 100vh;  /* Set height to 100% of the viewport height */   
        width: 100vw;  /* Set width to 100% of the viewport width */     
        border: none; /* Remove default border */
        background: lightyellow; /* Just for styling */
    }
    </style>
</head>

<body>
        <iframe  src="<?= $visapdf ?>" name="frame1" class="frame1" style="width: 100%;" frameBorder="0"
            scrolling="yes"></iframe>

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

</html>