<?php

$zroot = $_SESSION["zdir"];
$repocolor = $_SESSION["repocolor"];
$compcd = $_SESSION["comp_" . $dbname];

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

$comp = mysqli_fetch_array($getcomp);

?>

<style>
    .HDFont {
        font-family: "Verdana";
        color: #57606f;
        font-weight: bold;
    }

    @media print {
        .noPrint {
            display: none;
        }

        .skimg {
            width: 50% !important;
        }

        .skmarg {
            width: 50% !important;
        }
    }

    .head {
        font-size: 30px;
        font-weight: bold;
        padding: 3px;
        color: #57606f;
    }
    .table>tbody>tr>td{
        padding: 1px;
        border-top: 0px;
    }
</style>

<div class="container-fluid" style="background-color: <?= $repocolor; ?>">

    <table width="100%" class="table table-condesed ">  

        <tr>

            <td class="head HDFont">

                <img src="<?= $comp['reportheadimg']; ?>" style="width:30%" class="skimg">

            </td>

            <td style="text-align:right;padding:15px;">

                <button onclick="window.print();return false;" class="btn btn-primary noPrint" style="text-align: right;font-weight:bold;">Print</button>

                <button id='cancel' style="background: #26A69A;font-weight:bold;" type="button" class="btn btn-danger noPrint" onclick="window.close()">

                    Go Back

                </button>

            </td>

        </tr>

        <tr>

            <td style="font-size: 14px;width:70%;" class="HDFont">

                <?php echo $comp['hoadd1']; ?>

                <?php echo $comp['hoadd2']; ?>

                <?php echo $comp['hoadd3']; ?>

                <?php echo $comp['hocity']; ?>

                - <?php echo $comp['hopin']; ?>

            </td>

            <td style="width:30%">

            </td>

        </tr>



        <?php

        if ($dtype == 1) {

            $rtype = " - Summary";
        } elseif ($dtype == 2) {

            $rtype = " - Detail";
        } elseif ($dtype == '') {

            $rtype = '';
        }

        ?>

        <tr>

            <td style="font-size: 16px;color: black" class="HDFont">

                <?php echo $formname . ' ' . $rtype; ?>

            </td>

            <td style="font-size: 14px;" align="right" class="HDFont " colspan="2">

                Report Date - <?php echo Date("d-m-Y"); ?>

            </td>
            

        </tr>
        


        <tr>

            <td style="font-size: 14px" class="HDFont">

                <?php if ($mfdt != '') { ?>

                    From Date -

                    <?php echo $mfdt; ?> &nbsp;&nbsp;&nbsp;

                <?php }

                if ($mtdt != '') {

                ?>

                    To Date -

                <?php echo $mtdt;
                }

                ?>

            </td>

            <td>

            </td>

        </tr>

        <? // if($as_on_date != "00-00-0000"){ 
        ?>

        <!--        <tr>

            <td style="font-size: 14px" class="HDFont">

                    As On Date - 

<?php //Echo $as_on_date ;  
?> &nbsp;&nbsp;&nbsp;

            </td>

            <td>

            </td>

        </tr>-->

        <? // }  
        ?>

        <tr>

            <td style="font-size: 14px" class="HDFont" colspan="2">

                <?php echo $rtype2; ?>

            </td>

        </tr>



        <?php

        if ($getno > 0) {

        ?>

            <tr>

                <td style="font-size: 15px;padding:5px" class="HDFont" colspan="2">

                    Total No. of Record :&nbsp;&nbsp;<b><?php echo $getno; ?></b>

                </td>

            </tr>

        <?

        }

        //        elseif ($getno == 0){

        //        browse("No Record Found");

        //        echo "<script>window.close()</script>";

        //        }

        ?>

    </table>

</div>