<?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"];
$maindb = 'accmast';
//$para = $_GET["para"];


$mainqry = mysqli_query($conn, "SELECT * FROM `$maindb` WHERE `accode` = '$code' AND `grpcode` = '010' ") or die(mysqli_error($conn));
$get = mysqli_fetch_object($mainqry);
?>
<html>
    <head>
        <title><?= $formanme ?></title>
        <style>
            .page {
                width: 240.568mm;
                min-height: 85.2mm;
                padding: 1mm;
                margin: 0mm 0mm 0mm 4mm;
                border: 1px #D3D3D3 solid;
                border-radius: 5px;
                background: white;

            }
            .subpage {
                padding-right   : 0.5cm;
                padding-left    : 0.5cm;
                padding: 0cm; 
                /*border: 1px solid;*/
                height: 110.2mm;
                outline: 2cm #ffffff solid;
            }
            body{
                font-size: 23px;

            }
            td{
                font-size: 17px;
            }
            @media print{@page {size: landscape}}

        </style>
    </head>
    <body onload="window.print();">
        <div class="page">
            <div class="subpage">
                <div style="width:65%;margin-left:227px;border:0px solid;padding-top:25px;">
                    <table>
                        <tr>
                            <td class="" style="text-align:left;padding-top: 185px; font-size:20;padding-left:80px;" >To,</td>
                        </tr>
                        <tr style="">
                            <td style="text-align:left;padding-left:80px;"><span style="padding-right:25px;"></span>
                                <b><?= $get->custcode ?></b><br/> 
                                <span style="padding-right:25px"></span><b><?= $get->name ?></b><br/>
                                <span style="padding-right:25px"></span><?= $get->add1 ?><br/>
                                <span style="padding-right:25px"></span><?= $get->add2 ?><br/>
                                <span style="padding-right:25px"></span><?= $get->add3 ?><br/>
                                <!--<span style="padding-right:25px"></span><?= $get->station ?><br/>-->
                                <span style="padding-right:25px"></span><?= $get->city ?> <?= $get->pin ?><br/>
                                <span style="padding-right:25px"></span>
                                <?php
                                if (!empty($get->tel)) {
                                    echo $get->tel . " / ";
                                }
                                ?>  <?= $get->mobile ?><br/>
                                <span style="padding-right:25px"></span><?= $get->email ?>

                            </td>
                        </tr>
                    </table>
                </div>
            </div>
        </div>
    </body>
</html>
