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

$admin = $_SESSION["admin_" . $dbname];
$zdb = $_SESSION["zdbyear_" . $dbname];
$myyear = $_SESSION[$myyear];
mysqli_select_db($conn, $zdb);

$zroot = $_SESSION["zdir"];
$zcomp = $_SESSION["comp_" . $dbname];
$formname = 'Pax Form';
$maindb = 'visaform';
$trandb = 'mehram';
$file = 'paxform_pdf.php';
$tourname = $_SESSION['tourname'];
$tourcode = $_SESSION['tourcode'];
$tourcond = "AND tourno = '$tourcode'";

$vouchno = $_REQUEST["vouchno"];

$mainqry = mysqli_query($conn, "SELECT *, DATE_FORMAT(`vouchdt`, '%d-%m-%Y') AS vouchdt,DATE_FORMAT(`dob`, '%d-%m-%Y') AS dob,
                                          DATE_FORMAT(`issdate`, '%d-%m-%Y') AS doi, DATE_FORMAT(`expdate`, '%d-%m-%Y') AS doe
                                          FROM `$maindb` WHERE `vouchno`='$vouchno' and tour='$tourcode'  ORDER BY `vouchno` ") or die(mysqli_error($conn));
$getmdata = mysqli_fetch_array($mainqry);


if ($getmdata['chkwhlchair'] == 1) {
    $showchkwhlchair = '- <span style="font-size:18px;">♿</span>';
} else {
    $showchkwhlchair = "";
}

$gettran = mysqli_query($conn, "SELECT * FROM $trandb where vouchno = '$getmdata[vouchno]' ") or die(mysqli_error($conn));
$fettran = mysqli_fetch_array($gettran);

$getrelate = mysqli_query($conn, "SELECT code,name FROM relation where code='$fettran[trelate]'") or die(mysqli_error($conn));
$fetrelate = mysqli_fetch_array($getrelate);


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

$compname = $comp2['compname'];
$headerimg = $comp2['reportheadimg'];


include("includes/linkshead.php");
?>
<link href="styles/rep_format.css" rel="stylesheet">
<style>
    body {
        font-size: 11px;
    }

    .right {
        text-align: right;
    }

    .left {
        text-align: left;
    }

    .center {
        text-align: center;
    }

    .fsize {
        font-size: 15px;
    }

    td,
    th {
        padding: 0px;
        font-size: 11px;
    }

    .padd {
        padding: 15px;
    }

    .paddd {
        padding: 5px 5px 5px 5px;
    }

    .padd2 {
        padding: 5px;
    }

    .padd3 {
        padding: 7px;
    }

    .bottom {
        border-bottom-style: solid;
        border-top-style: none;
        border-left-style: none;
        border-right-style: none;
        border-width: 1px;
    }

    table {
        width: 100%;
        /*border : 1px solid black;*/
    }

    #lab1 {
        font-size: 20px;
    }

    .skf1 {
        font-size: 15px;
    }

    #lab2 {
        font-size: 20px;
    }

    #lab3 {
        font-size: 17px;
    }

    #fon {
        font-size: 14px;
    }

    .subpage {
        padding-right: 0.5cm;
        padding-left: 0.8cm;
        height: 291mm;
    }

    .page {

        background: white;
        display: block;
        margin: 0 auto;
    }

    .df {
        font-size: 15px;
    }

    .bolder {
        font-size: 15px;
    }

    .bordered-table {
        border: 1px solid black;
    }

    .bordered-table2 {
        border: 2px solid black;
        margin: 20px 10px !important;
    }

    .newPad {
        padding: 10px 5px !important;
    }

    .border-right {
        border-right: 1px solid black !important;
    }

    .fullBorder {
        border: 2px solid black !important;
        height: 130px !important;
    }

    .marginTop {
        margin-top: 140px !important;
    }
</style>
</head>

<body>

    <div class="page">
        <div class="subpage" style="margin-top:1%; margin-left:3%; margin-right:1%;">

            <div class="row" style="text-align:center;">
                <img style="height:auto;width:50%;margin-top: -10px;margin-bottom: -20px;"
                    src="<?php echo $headerimg; ?>">
            </div>
            <table width="100%">
                <tr>
                    <td width="80%">
                        <table>
                            <tr>
                                <td width="12%" class="bolder"><b>Booking Form For Hajj:</b></td>
                                <td width="20%" class="bottom df">&nbsp;</td>
                                <td width="1%" class="">&nbsp;</td>
                            </tr>
                        </table>
                    </td>
                    <td width="20%">
                        <table class="">
                            <tr>
                                <td width="100%" class="fullBorder">&nbsp;</td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>

            <table>
                <tr class="marginTop">
                    <td width="80%">
                        <table>
                            <tr class='header'>
                                <td width="10%" class="bolder"><b>Booking No :</b></td>
                                <td width="20%" class="bottom df"><?= $getmdata["vouchno"]; ?></td>
                                <td width="20%" class="bolder"><b>&nbsp;(For Office Use Only)</b></td>
                            </tr>
                        </table>
                    </td>
                    <td width="20%">
                        <table>
                            <tr>
                                <td width="100%" class="">&nbsp;</td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>

            <br>
            <table>
                <tr>
                    <td width="100%">
                        <table class="bordered-table">
                            <tr>
                                <td width="25%" class="bolder newPad "><b>Standard Class</b></td>
                                <td width="22%" class="bordered-table2">&nbsp;</td>
                                <td width="3%" class="newPad border-right"></td>
                                <td width="25%" class="bolder newPad "><b>Busy Class</b></td>
                                <td width="22%" class="bordered-table2">&nbsp;</td>
                                <td width="3%" class="newPad border-right"></td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>

            <br>

            <table>
                <tr>
                    <td width="10%"><b>1. Name :</b></td>
                    <td width="90%" class="bottom df"><?= $getmdata["surname"]; ?> <?= $getmdata['lastname']; ?>
                        <?= $getmdata['midname']; ?> <?= $showchkwhlchair ?></td>
                </tr>
            </table>

            <br>

            <table>
                <tr>
                    <td width='20%' class=''><b>2A.&nbsp;Passport Number : </b></td>
                    <td width='30%' class="bottom df"><?= $getmdata["redypass"]; ?></td>

                    <td width='16%' class=''><b>&nbsp;B.&nbsp;Date of Birth : </b></td>
                    <td width='34%' class="bottom df">
                        <?php
                        if ($getmdata["dob"] != "00-00-0000") {
                            echo $getmdata["dob"];
                        }
                        ?>
                    </td>
                </tr>
            </table>

            <br>

            <table>
                <tr>
                    <td width='17%' class=''><b>3A. Place of Issue : </b></td>
                    <td width='33%' class="bottom df"><?php echo $getmdata["issplace"]; ?></td>
                    <td width='15%' class=''><b>&nbsp;&nbsp;&nbsp;B. Nationality : </b></td>
                    <td width='35%' class="bottom df"><?php echo $getmdata["nation"]; ?></td>
                </tr>
            </table>
            <br>
            <table>
                <tr>
                    <td width='17%' class=''><b>4A. Date of Issue : </b></td>
                    <td width='33%' class="bottom df">
                        <?php
                        if ($getmdata["doi"] != "00-00-0000") {
                            echo $getmdata["doi"];
                        }
                        ?>
                    </td>
                    <td width='18%' class=''><b>&nbsp;&nbsp;&nbsp;B. Date of Expiry : </b></td>
                    <td width='32%' class="bottom df">
                        <?php
                        if ($getmdata["doe"] != "00-00-0000") {
                            echo $getmdata["doe"];
                        }
                        ?>
                    </td>

                </tr>
            </table>
            <br>
            <table>
                <tr>
                    <td width='17%' class=''><b>5. Father's Name : </b></td>
                    <td width='83%' class="bottom df"><?php echo $getmdata["fhname"]; ?></td>
                </tr>
            </table>
            <br>
            <table>
                <tr>
                    <td width='20%' class=''><b>6A. Mother's Name : </b></td>
                    <td width='30%' class="bottom df"><?php echo $fetmehname["dob"]; ?></td>
                    <td width='18%' class=''><b>&nbsp;&nbsp;&nbsp;B. Spouse Name : </b></td>
                    <td width='32%' class="bottom df"><?php echo $fetmehname["pob"]; ?></td>
                </tr>
            </table>
            <br>
            <table>
                <tr>
                    <td width='20%' class=''><b>7A. Name Of Mehram : </b></td>
                    <td width='30%' class="bottom df"><?php echo $fettran["paxname"]; ?></td>
                    <td width='18%' class=''><b>&nbsp;&nbsp;&nbsp;B. Relationship : </b></td>
                    <td width='32%' class="bottom df"><?php echo $fetrelate["name"]; ?></td>
                </tr>
            </table>
            <br>
            <table>
                <tr>
                    <td width='40%' class=''><b>8. Present Residential Address with pincode : </b></td>
                    <td width='60%' class="bottom df"></td>
                </tr>
            </table>
            <br>
            <table>
                <tr>
                    <td width='100%' class="bottom df">&nbsp;</td>
                </tr>
            </table>
            <br>
            <table>
                <tr>
                    <td width='20%' class=''><b>9A. Mobile Number : </b></td>
                    <td width='30%' class="bottom df"><?php echo $fetmehname["dob"]; ?></td>
                    <td width='18%' class=''><b>&nbsp;&nbsp;&nbsp;B. Phone Number : </b></td>
                    <td width='32%' class="bottom df"><?php echo $fetmehname["pob"]; ?></td>
                </tr>
            </table>
            <br>
            <table>
                <tr>
                    <td width='10%' class=''><b>10. Email : </b></td>
                    <td width='80%' class="bottom df"><?php echo $fetmehname["dob"]; ?></td>
                </tr>
            </table>
            <br>
            <table>
                <tr>
                    <td width='20%' class=''><b>11A. Maritial Status : </b></td>
                    <td width='25%' class="bottom df"><?php echo $fetmehname["dob"]; ?></td>
                    <td width='10%' class=''><b>&nbsp;&nbsp;&nbsp;B. Sex : </b></td>
                    <td width='12%' class="bottom df"><?php echo $fetmehname["dob"]; ?></td>
                    <td width='18%' class=''><b>&nbsp;&nbsp;&nbsp;C. Blood Group : </b></td>
                    <td width='15%' class="bottom df"><?php echo $fetmehname["dob"]; ?></td>
                </tr>
            </table>
            <br>
            <table>
                <tr>
                    <td width='13%' class=''><b>12A. Religion : </b></td>
                    <td width='37%' class="bottom df"><?php echo $fetmehname["dob"]; ?></td>
                    <td width='13%' class=''><b>&nbsp;&nbsp;&nbsp;B. Sector : </b></td>
                    <td width='37%' class="bottom df"><?php echo $fetmehname["dob"]; ?></td>
                </tr>
            </table>
            <br>
            <table>
                <tr>
                    <td width='18%' class=''><b>13A. Qualification : </b></td>
                    <td width='32%' class="bottom df"><?php echo $fetmehname["dob"]; ?></td>
                    <td width='15%' class=''><b>&nbsp;&nbsp;&nbsp;B. Profession : </b></td>
                    <td width='35%' class="bottom df"><?php echo $fetmehname["dob"]; ?></td>
                </tr>
            </table>
            <br>
            <table>
                <tr>
                    <td width='22%' class=''><b>14A. Passport Enclosed : </b></td>
                    <td width='28%' class="bottom df"><?php echo $fetmehname["dob"]; ?></td>
                    <td width='28%' class=''><b>&nbsp;&nbsp;&nbsp;B. Special requirement if any : </b></td>
                    <td width='22%' class="bottom df"><?php echo $fetmehname["dob"]; ?></td>
                </tr>
            </table>
            <br>
            <table>
                <tr>
                    <td width='22%' class=''><b>15A. Name of Nominee : </b></td>
                    <td width='28%' class="bottom df"><?php echo $fetmehname["dob"]; ?></td>
                    <td width='16%' class=''><b>&nbsp;&nbsp;&nbsp;B. Relationship : </b></td>
                    <td width='34%' class="bottom df"><?php echo $fetmehname["dob"]; ?></td>
                </tr>
            </table>
            <br>
            <table>
                <tr>
                    <td width='12%' class=''><b>C. Address : </b></td>
                    <td width='87%' class="bottom df">&nbsp;</td>
                </tr>
            </table>
            <br>
            <table>
                <tr>
                    <td width='50%' class="bottom df">&nbsp;</td>
                    <td width='15%' class=''><b>D. Contact No : </b></td>
                    <td width='35%' class="bottom df">&nbsp;</td>
                </tr>
            </table>
            <br>
            <table>
                <tr>
                    <td width='100%' class='bolder'><b>Declaration by the Applicant : </b></td>
                </tr>
            </table>
            <br>
            <table>
                <tr>
                    <td width='1%' class=''><b>I, </b></td>
                    <td width='20%' class="bottom df">&nbsp;</td>
                    <td width='79%' class="">&nbsp;&nbsp;hereby authorise M/s Global Atlas Tours & Forex to arrange the
                        Flight Ticket / Accomodation in Makkah</td>
                </tr>
            </table>
            <br>
            <table>
                <tr>
                    <td width='100%' class="">Al - Mukarrama, Madina Al - Munawwara, Maulim Draft and other Haj Expenses
                        as the need be in Saudi Arabia. Further, If I die,</td>
                </tr>
            </table>
            <br>
            <table>
                <tr>
                    <td width='100%' class=""> bury my body in the same Country, according to the laws of that country,
                        I do hereby accept and abide all the terms and Conditions</td>
                </tr>
            </table>
            <br>
            <table>
                <tr>
                    <td width='50%' class=""> of your company</td>
                    <td width='50%' class="bolder text-right"> <b>Your's Sincerely</b></td>
                </tr>
            </table>
            <br>
            <br>
            <br>
            <br>
            <table>
                <tr>
                    <td width='30%' class=""> Please see Overleaf</td>
                    <td width='70%' class="bolder text-right"> <b>Sign or Thumb Impression of the Applicant</b></td>
                </tr>
            </table>
        </div>
    </div>


    <?php include("includes/linksfoot.php"); ?>
</body>

</html>
<?php
