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

// $formname = '';
$maindb = 'remform';
$file = 'remform_fr.php';
// $source = "CR";

$zdb = $_SESSION["zdbyear_" . $dbname];
mysqli_select_db($conn, $zdb);
$zroot = $_SESSION["zdir"];
$mht = 'height:20px;';

$admin = $_SESSION["admin_" . $dbname];

$vouchno = $_REQUEST["vouchno"];
$mvouch = $_GET["mvouch"];
$society = $_SESSION["society_" . $dbname];

if($vouchno != ''){
    $vouchcond = " vouchno = $vouchno";
}elseif ($mvouch != ''){
    $vouchcond = " vouchno = $mvouch ";
}

$para = $_REQUEST["para"];

$getcomp = mysqli_query($conn, "SELECT * FROM $zroot.`company` WHERE `code` = '$society' ") or die(mysqli_error($conn));
$company = mysqli_fetch_array($getcomp);

$mainqry = mysqli_query($conn, "SELECT *, DATE_FORMAT(`vouchdt`, '%d-%m-%Y') AS vouchdt FROM `$maindb` WHERE $vouchcond $keycond") or die(mysqli_error($conn));
$getmdata = mysqli_fetch_array($mainqry) or die(mysqli_error($conn));

$party = mysqli_query($conn, "SELECT accode,name FROM accmast where accode = $getmdata[party] ")or die (mysqli_error($conn));
$fetparty = mysqli_fetch_array($party);
$partyname = $fetparty['name'];

?>

<!DOCTYPE HTML>
<html lang="en-US">


</head>
<style>
    body {
        width: 100%;
        height: 100%;
        margin: 0;
        padding: 0;
        font-style: normal;
        /*background-color: #FAFAFA;*/
        font: 12pt "Tahoma";
    }
    * {
        box-sizing: border-box;
        -moz-box-sizing: border-box;
    }
    .page {
        width: 210mm;
        min-height: 140mm;
        padding: 4mm;
        margin: 10mm auto;
        border: 1px #D3D3D3 solid;
        border-radius: 5px;
        /*background: white;*/

    }
    .subpage {
        padding: 0cm;
        /*        border: 1px solid;*/
        height: 288mm;
        outline: 2cm #ffffff solid;
    }
    .box{
        width:130px;
        height:100px;
        border:1px solid black;
    }
    .border{
        border-right-style:solid; 
        border-bottom-style:none;
        border-left-style: solid; 
        border-top-style: solid;
        border-width: 1px ;
    }
    
    .border2{
        border-style:inset;
        border-width: 3px ;
        border-color:#EFE4B0;        
    }
    td{
        padding: 5px;
    }
    .center{
        text-align: center;
    }
    .left{
        text-align: left;
    }
    .right{
        text-align: right;
    }
    .padd{
        padding: 5px 5px 5px 20px;
    }

    @page {
        size: A4;
        margin: 0;
    }
    @media print {
        html, body {
            width: 210mm;
            height: 297mm;        
        }
        .page {
            margin: 0;
            border: initial;
            border-radius: initial;
            width: initial;
            min-height: initial;
            box-shadow: initial;
            background: initial;
            page-break-after: always;
        }
    }
    .color{
            background-color: #EFE4B0;
            -webkit-print-color-adjust : exact;
        }

</style>
<body id="main_container">
    <div class="book">
        <div class="page">
            <div class="subpage">
                <!--   ************Header************  -->
                <div style="">
                   

                    <table width="80%" class="border2">
                        <tr>
                            <td class='padd'><lable><center><b> <?= $company['compname'] ?> </b><center></lable></td>
                        </tr>
                        <tr>
                            <td class='padd'><lable>Reminder For Flat No: <b> <?= $getmdata['flatno'] ?> </b></lable></td>
                        </tr>
                        <tr>
                            <td class='padd'><lable><?= $partyname ?></lable></td>
                        </tr>
                        <tr>
                            <td class='padd'><lable>Regarding - <b><?= strtoupper($getmdata['remindfor']) ?></b> </lable></td>
                        </tr>
                        
                        <?php if($getmdata['descrip'] != ''){ ?>
                            <tr>
                                <td class='padd'><lable><?php echo $getmdata['descrip'] ?></lable></td>
                            </tr>
                            <?php } ?>
                            <?php if($getmdata['descrip2'] != ''){ ?>
                            <tr>
                           <td class='padd'><lable><?php echo $getmdata['descrip2'] ?></lable></td>
                        </tr>
                        <?php } ?>
                        <tr>
                            <td class='padd'><lable>Date - <?= $getmdata['vouchdt'] ?></lable></td>
                            <!--<td class='padd'><lable>being the charges for the Flat&nbsp;<strong><?php // echo $member[wing] . "/" . $member[flatno] ?></strong></lable></td>-->
                        </tr>
                    </table>
                    <br>
                </div>
            </div>

            <?php
            include("includes/linksfoot.php");
            ?>
            <script>
                $(function () {
                    formGeneral();
                });
            </script>
            </body>
            </html>
