<?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: 35% !important;
        }




    }



    .head {

        font-size: 30px;

        font-weight: bold;

        padding: 3px;

        color: #57606f;

    }
</style>

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

    <table width="100%">

        <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" class="HDFont">

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

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

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

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

            </td>

            <td>

            </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 skmarg">

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

            </td>
            <td>

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

        <tr>

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

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

    <table width="100%">

        <tr>


            <td style="font-size: 13px;padding:3px">

                <?php

                if (!empty($group)) {
                    echo "<span style='font-size: 13px;padding-left:20px'>Group : $group </span>";
                }

                if (!empty($class)) {
                    echo "<span style='font-size: 13px;padding-left:20px'>Class : $classprn </span>";
                }

                if (!empty($city)) {
                    echo "<span style='font-size: 13px;padding-left:20px'> City : $city </span>";
                }

                if (!empty($state)) {
                    echo "<span style='font-size: 13px;padding-left:20px'> State : $state </span>";
                }

                if (!empty($sex)) {

                    if ($sex == "M") {
                        $gender = "Male";
                    } else {
                        $gender = "Female";
                    }

                    echo "<span style='font-size: 13px;padding-left:20px'> Sex : $gender </span>";
                }

                if ($ppexpiry != 99 && $ppexpiry != "") {

                    if ($ppexpiry == 1) {
                        $months = "1 Month";
                    } elseif ($ppexpiry == 2) {
                        $months = "2 Month";
                    } elseif ($ppexpiry == 3) {
                        $months = "3 Month";
                    } elseif ($ppexpiry == 4) {
                        $months = "4 Month";
                    } elseif ($ppexpiry == 5) {
                        $months = "5 Month";
                    } elseif ($ppexpiry == 6) {
                        $months = "6 Month";
                    }
                    echo "<span style='font-size: 13px;padding-left:20px'> Passport Expiry In : $months </span>";
                }

                ?>
            </td>

        </tr>

        <tr>


            <td style="font-size: 13px;padding:3px">

                <?php

                if ($depdate != "") {
                    echo "<span style='font-size: 13px;padding-left:20px'> Departure Date : " . date("d-m-Y", strtotime($depdate)) . " </span>";
                }

                if ($deppnr != "A" && $deppnr != "") {

                    if ($deppnr != "A") {
                        $dep = "Pending";
                    }
                    echo "<span style='font-size: 13px;padding-left:20px'>Departure PNR : $dep </span>";
                }

                if ($airlines != "") {
                    echo "<span style='font-size: 13px;padding-left:20px'> Airlines/Carrier : $airlines </span>";
                }

                if (!empty($agent)) {
                    echo "<span style='font-size: 13px;padding-left:20px'> Agent Name : $agent </span>";
                }

                if ($arrvdate != "") {
                    echo "<span style='font-size: 13px;padding-left:20px'> Arrival Date : " . date("d-m-Y", strtotime($arrvdate)) . " </span>";
                }

                if ($arrvpnr != "A" && $arrvpnr != "") {

                    if ($arrvpnr != "A") {
                        $arv = "Pending";
                    }
                    echo "<span style='font-size: 13px;padding-left:20px'>Arrival PNR : $arv </span>";
                }

                ?>
            </td>

        </tr>

    </table>

</div>