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

$zdb = $_SESSION["zdbyear_" . $dbname];
//mysqli_select_db($conn, $zdb);
$formname = 'Envelope Print';
$code = $_REQUEST["code"];

$para = $_GET["para"];
$maindb = 'address';
$mainqry = mysqli_query($conn, "SELECT * FROM `$maindb` WHERE accode ='$code'")or die(mysqli_error($conn));
$get = mysqli_fetch_object($mainqry);
?>
<html>
    <head>
        <title><?= $formname ?></title>
        <style>
            @page {
                margin-left: 10%;
            }
            body{
                margin-left: 19%;
                width: 220.98mm;
                height: 109.22mm;
            }
         

            @media print 
            {
                @page
                {
                    margin-top: 30px;
                    margin-left: 60px;

                    size: 4.0in 8.0in ;
                    size: landscape;
                }
            }
        </style>
    </head>
    <body>
        <div style="margin:auto;border:0px solid;padding-top:30px;" class="page">
            <table>
                <tr>
                    <td>
                        <font style="font-size: 26px;font-weight: bolder"><?= $get->name ?>
                        </font>
                    </td>
                </tr>
                <tr>   
                    <td>
                        <?= $get->add1 ?><br/>
                        <font style="font-size: 19px;"><?= $get->add2 ?><br/>
                        <?= $get->add3 ?><br/>
                    </td>
                </tr>
                <tr>   
                    <td>
                        <?= $get->station ?>
                        <font style="font-size: 20px;font-weight: bolder"><?= $get->city ?> </font><?= $get->pin ?>
                    </td>
                </tr>
                <tr>   
                    <td>
                        <?php
                        if (!empty($get->tel)) {
                            echo $get->tel . " / ";
                        }
                        ?>  <?= $get->mobile ?>
                    </td>
                </tr>
                </font>
            </table>
        </div>
    </body>
</html>
