<?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';
$account = $_REQUEST["account"];

$para = $_GET["para"];
$maindb = 'accmast';
$mainqry = mysqli_query($conn, "SELECT * FROM `$maindb` WHERE accode ='$account'")or die(mysqli_error($conn));
$get = mysqli_fetch_object($mainqry);
// print_r($get);
?>
<html>
    <head>
        <title><?= $formname ?></title>
        <style>
            @page {
                margin-left: 10%;
            }
            body{
                margin-left: 19%;
                width: 220.98mm;
                height: 109.22mm;
            }
            /*            @media print {
                            html, body {
                                margin-left: 19%;
                                width: 220.98mm;
                                height: 109.22mm;
                            }
                             ... the rest of the rules ... 
                        }*/
            /*            .page{
                            height: 109.22mm;
                            width: 220.98mm;
                        }
                                                     @page { size:109.22mm 220.98mm; margin: 2cm }
                                         @page rotated { size : landscape }
                        @media print 
                        {
                            .page{
                                height: 109.22mm;
                                width: 220.98mm;
                            }
                            @page
                            {
                                size: 220.98mm 109.22mm;
                                size: landscape;
                            }
                        }*/

            @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>
