<?php
$getid = $_GET['id'];
include('../../includes/config.php');
$dl_info = mysqli_fetch_assoc(mysqli_query($ahk_conn, "select * from dllist where id=" . $getid . ""));
extract($dl_info);

?>
<html>
<title> print DL</title>
<head>
         <style type = "text/css">
  @media print {
    body{
        width: 21cm;
        height: 29.7cm;
        margin-bottom: 0mm;
        /* change the margins as you want them to be. */
   } 
}
</style>

    <style type="text/css">
        .PhotoSize {
            height: 65px;
            width: 60px;
        }

        .SignatureSize {
            height: 20px;
            width: 100px;
        }

        .HeadSize {
            font-size: 14px;
            font-weight: 100;
            font-family: "Arial";
        }

        .BackSize {
            font-size: 12px;
            font-weight: 100;
            font-family: "Arial";
        }
        .txt11 {
            font-size: 6px;
        }

        .txt1 {
            font-size: 11px;
        }

        .txt2 {
            font-weight: bold;
        }

        .txt3 {
            font-size: 10px;
        }

        .BarcodeSize {
            height: 70px;
            width: 70px;
        }

        .border1 {
            border: 1px solid black;
            border-collapse: collapse;
            font-size: 7px;
        }
        img{
            pointer-events:none;
        }
        * {
            -webkit-print-color-adjust: exact !important;
            color-adjust: exact !important;
            print-color-adjust: exact !important;
        }
    </style>
</head>

<body onload="self.print();">
    <left>
        <div class="row">
            <div class="col-md-12">
                <table>
                    <tbody>
                        <tr style="vertical-align: top;">
                            <td style="background-image: url(1.png); background-repeat: no-repeat; background-size: 100%; height: 400px; width: 400px; background-position: center;">
                                <table width="100%" style="margin-top: 75px;">
                                    <tbody>
                                        <tr>
                                            <td width="100%" class="HeadSize" style="text-align: center;">
                                                <center>
                                                    <table width="100%">
                                                        <tbody>
                                                            <tr>
                                                                <td width="100%" style="text-align: center; padding-left: 70px; padding-top: 9px; font-size: 14px;">INDIAN UNION DRIVING LICENCE</td>
                                                                <td width="20%"><span id="ContentPlaceHolder1_lblRto" style="margin-right: 15px; display: inline-block; margin-top: 10px; font-size: 11px; color: black;"><?=$state?></span></td>
                                                            </tr>
                                                        </tbody>
                                                    </table>
                                                </center>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td width="100%" class="" style="margin-top: -3px;margin-left: 13px; text-align: center; display: list-item; font-size: 12px;">ISSUED BY GOVERNMENT OF <?=$states?> <span id="ContentPlaceHolder1_lblIssueBy"></span></td>
                                        </tr>
                                        <tr>
                                            <td width="100%" class="HeadSize" style="text-align: center; padding-right: 120px; padding-top: 10px;"><span id="ContentPlaceHolder1_lbldl2" class=""><B><?=$dlno?></B></span></td>
                                        </tr>
                                        <tr>
                                            <td width="100%" style="text-align: center;">
                                                <center>
                                                    <table width="100%">
                                                        <tbody>
                                                            <tr>
                                                                <td width="22%"></td>
                                                                <td width="70%">
                                                                    <table width="100%">
                                                                        <tbody>
                                                                            <tr>
                                                                                <td width="33%" class="txt1">Issue Date</td>
                                                                                <td width="33%" class="txt1">Validity (NT)</td>
                                                                                <td width="33%" class="txt1">Validity( TR ) </td>
                                                                            </tr>
                                                                            <tr>
                                                                                <td width="33%" class="txt1 "><span id="ContentPlaceHolder1_lblissuedate" class=""><?=$idate?></span></td>
                                                                                <td width="33%" class="txt1 "><span id="ContentPlaceHolder1_lblvalid" class=""><?=$edate?></span></td>
                                                                                <td width="33%" class="txt1 "></td>
                                                                            </tr>
                                                                        </tbody>
                                                                    </table>
                                                                </td>
                                                                <td width="25%">
                                                                    <table width="45%">
                                                                        <tbody>
                                                                            <tr>
                                                                                <td><img src="<?=$photo?>" id="ContentPlaceHolder1_imgPhoto" class="PhotoSize" style="margin-top: -30px;" /></td>
                                                                            </tr>
                                                                        </tbody>
                                                                    </table>
                                                                </td>
                                                            </tr>
                                                        </tbody>
                                                    </table>
                                                </center>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td width="100%" style="text-align: center;">
                                                <center>
                                                    <table width="101%">
                                                        <tbody>
                                                            <tr>
                                                                <td width="28%"></td>
                                                                <td width="47%"></td>
                                                                <td width="25%">
                                                                    <table width="100%">
                                                                        <tbody style="width: 100%;">
                                                                            <tr>
                                                                                <td><span id="ContentPlaceHolder1_Label1" class="txt1" style="position: relative; top: -13px; padding-left:18px;"> Holder's Signature</span>
                                                                                    <img src="<?=$sign?>" id="ContentPlaceHolder1_imgSignature" class="SignatureSize" style="margin-top: -16px;" />
                                                                                    
                                                                                </td>
                                                                            </tr>
                                                                        </tbody>
                                                                    </table>
                                                                </td>
                                                            </tr>
                                                        </tbody>
                                                    </table>
                                                </center>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td width="100%" style="text-align: center; position: relative; top: -20px;">
                                                <center>
                                                    <table width="100%">
                                                        <tbody>
                                                            <tr style="height: 14px;">
                                                                <td width="5%"></td>
                                                                <td width="15%" class="txt1" style="vertical-align: top;">Name</td>
                                                                <td width="15%" class="txt3 " colspan="4" style="vertical-align: top;"><span id="ContentPlaceHolder1_lblname" class="">: <?=$name?></span></td>
                                                                <td width="15%" class="txt1" style="vertical-align: top; position: relative; top: 5px;">Gender:<span id="ContentPlaceHolder1_lblGender" class="txt1 "><?=$gender?></span></td>
                                                                <td width="5%" class="txt1"></td>
                                                            </tr>
                                                            <tr style="height: 14px;">
                                                                <td width="5%" class="txt1"></td>
                                                                <td width="20%" class="txt1" style="vertical-align: top;">Date Of Birth :</td>
                                                                <td width="17%" class="txt1 " style="vertical-align: top;"><span id="ContentPlaceHolder1_lbldob" class=""><?=$dob?></span></td>
                                                                <td width="20%" class="txt1" style="vertical-align: top;">Blood Group :</td>
                                                                <td width="5%" class="txt1 " style="vertical-align: top;"><span id="ContentPlaceHolder1_lblgroup" class="txt1 "><?=$bgroup?></span></td>
                                                                <td width="20%" class="txt1" style="vertical-align: top;">Organ Donor :</td>
                                                                <td width="15%" class="txt1 " style="vertical-align: top;"><span id="ContentPlaceHolder1_Label5" class="txt1 ">N</span></td>
                                                                <td width="5%"></td>
                                                            </tr>
                                                            <tr style="height: 14px;">
                                                                <td width="5%"></td>
                                                                <td width="15%" colspan="2" class="txt1" style="vertical-align: top;">Son/Daughter/Wife of :</td>
                                                                <td width="15%" class="txt3 " colspan="3" style="vertical-align: top;"><span id="ContentPlaceHolder1_lblfathername" class=""><?=$swd?></span></td>
                                                                <td width="15%"></td>
                                                                <td width="5%" class="txt1"></td>
                                                            </tr>
                                                            <tr style="height: 14px;">
                                                                <td width="5%"></td>
                                                                <td width="15%" class="txt1" style="vertical-align: top;">Address</td>
                                                                <td width="15%" class="txt3 " colspan="5" style="vertical-align: top;">
                                                                    <span id="ContentPlaceHolder1_lbladdress" class="">: <?=$address?></span>
                                                                </td>
                                                                <td width="15%"></td>
                                                                <td width="5%" class="txt1"></td>
                                                            </tr>
                                                        </tbody>
                                                    </table>
                                                </center>
                                            </td>
                                        </tr>
                                    </tbody>
                                </table>
                            </td>
                            <td class="back" style="background-image: url(2.png); background-repeat: no-repeat; background-size: 100%; height: 401px; width: 410px; background-position: center;">
                                <table width="100%" style="margin-top: 84px;">
                                    <tbody>
                                        <tr>
                                            <td width="100%" class="HeadSize txt2" style="text-align: left;padding-left:10px;">DL No: <span id="ContentPlaceHolder1_lbldlno" class=""><?=$dlno?></span></td>
                                        </tr>
                                        <tr>
                                            <td width="100%" style="text-align: center; height: 95px; vertical-align: top;">
                                                <center>
                                                    <table width="100%">
                                                        <tbody>
                                                            <tr>
                                                                <td width="25%">
                                                                    <table width="45%">
                                                                        <tbody>
                                                                            <tr>
                                                                                <td style="text-align: center;">
                                                                                    <img src="https://api.qrserver.com/v1/create-qr-code/?size=250x250&amp;data=<?=urlencode('https://sarathi.parivahan.gov.in/sarathiservice/rsServices/sarathi/QRService/DLDetails/dlqrresult?dlnum='.base64_encode($dlno).'&dob='.base64_encode($dob))?>" id="ContentPlaceHolder1_imgBarCode" class="BarcodeSize" style=" margin-left: 0px;" />
                                                                                </td>
                                                                            </tr>
                                                                        </tbody>
                                                                    </table>
                                                                </td>
                                                                <td width="75%" style="vertical-align: top;">
                                                                    <table width="100%">
                                                                        <tbody>
                                                                            <tr>
                                                                                <td width="100%" class="BackSize" colspan="2">ADPVEH No.(Regn.Numbers)</td>
                                                                            </tr>
                                                                            <tr>
                                                                                <td width="100%" class="BackSize txt2" colspan="2"><span id="ContentPlaceHolder1_Label3" class=""></span></td>
                                                                            </tr>
                                                                            <tr>
                                                                               <td width="60%" class="BackSize" style="padding-top:20px">Hazardous Validity</td>
                                                                               <td width="40%" class="BackSize" style="padding-top:20px">Hill Validity</td>
                                                                            </tr>
                                                                            <tr>
                                                                                <td width="50%" class="BackSize txt2"><span id="ContentPlaceHolder1_Label2" class=""></span></td>
                                                                                <td width="50%" class="BackSize txt2"><span id="ContentPlaceHolder1_Label6" class=""></span></td>
                                                                            </tr>
                                                                        </tbody>
                                                                    </table>
                                                                </td>
                                                            </tr>
                                                        </tbody>
                                                    </table>
                                                </center>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td width="100%" style="text-align: center; position: relative; top: -5px;">
                                                <table width="100%" class="border1">
                                                    <tbody>
                                                        <tr>
                                                            <td width="14%" class="border1" style="vertical-align: top; text-align: center;">Class of Vechical</td>
                                                            <td width="12%" class="border1" style="vertical-align: top; text-align: center;">Code</td>
                                                            <td width="12%" class="border1" style="vertical-align: top; text-align: center;">Code Issued By</td>
                                                            <td width="12%" class="border1" style="vertical-align: top; text-align: center;">Date of Issue</td>
                                                            <td width="12%" class="border1" style="vertical-align: top; text-align: center;">Vehicle Category</td>
                                                            <td width="12%" class="border1" style="vertical-align: top; text-align: center;">Badge Number#</td>
                                                            <td width="12%" class="border1" style="vertical-align: top; text-align: center;">Badge IssuedDate#</td>
                                                            <td width="14%" class="border1" style="vertical-align: top; text-align: center;">Badge IssuedBy#</td>
                                                        </tr>
                                                        <?php
                                                        $stshor = substr($dlno, 0, 4);
                                                        $tovs = explode(',',$typeofvehicle);
                                                        $count = 1;
                                                        foreach($tovs as $tov)
                                                        {
                                                            echo '
                                                            <tr>
                                                            <td width="14%" class="border1" style="vertical-align: top; text-align: center;"><span id="ContentPlaceHolder1_lblClassOfVech1">'.$tov.'</span></td>
                                                            <td width="12%" class="border1" style="vertical-align: top; text-align: center;"><span id="ContentPlaceHolder1_lblCode1">'.$tov.'</span></td>
                                                            <td width="12%" class="border1" style="vertical-align: top; text-align: center;"><span id="ContentPlaceHolder1_lblCodeIssue1">'.$stshor.'</span></td>
                                                            <td width="12%" class="border1" style="vertical-align: top; text-align: center;"><span id="ContentPlaceHolder1_lblIssueDate1">'.$idate.'</span></td>
                                                            <td width="12%" class="border1" style="vertical-align: top; text-align: center;"><span id="ContentPlaceHolder1_lblVehCat1">NT</span></td>
                                                            <td width="12%" class="border1" style="vertical-align: top; text-align: center;"></td>
                                                            <td width="12%" class="border1" style="vertical-align: top; text-align: center;"></td>
                                                            <td width="14%" class="border1" style="vertical-align: top; text-align: center;"></td>
                                                        </tr>
                                                            ';
                                                            $count++;
                                                        }
                                                        for($count;$count<=5;$count++)
                                                        {
                                                            echo '
                                                            <tr>
                                                            <td width="14%" class="border1" style="vertical-align: top; text-align: center;"><span id="ContentPlaceHolder1_lblClassOfVech3">-</span></td>
                                                            <td width="12%" class="border1" style="vertical-align: top; text-align: center;"><span id="ContentPlaceHolder1_lblCode3"></span></td>
                                                            <td width="12%" class="border1" style="vertical-align: top; text-align: center;"><span id="ContentPlaceHolder1_lblCodeIssue3"></span></td>
                                                            <td width="12%" class="border1" style="vertical-align: top; text-align: center;"><span id="ContentPlaceHolder1_lblIssueDate3"></span></td>
                                                            <td width="12%" class="border1" style="vertical-align: top; text-align: center;"><span id="ContentPlaceHolder1_lblVehCat3"></span></td>
                                                            <td width="12%" class="border1" style="vertical-align: top; text-align: center;"></td>
                                                            <td width="12%" class="border1" style="vertical-align: top; text-align: center;"></td>
                                                            <td width="14%" class="border1" style="vertical-align: top; text-align: center;"></td>
                                                        </tr>
                                                            ';
                                                        }
                                                        ?>
                                                    </tbody>
                                                </table>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td width="100%" style="text-align: center; position: relative; top: -5px;">
                                                <table width="100%">
                                                    <tbody>
                                                        <tr>
                                                            <td width="50%" style="vertical-align: top;">&nbsp;</td>
                                                            <td width="50%" style="vertical-align: top;"></td>
                                                        </tr>
                                                        <tr style="position: relative; top: -20px;">
                                                            <td width="50%" style="vertical-align: top; text-align: center;" class="txt1 txt2"><span id="ContentPlaceHolder1_Label4" class="">Emergancy Contact Number</span></td>
                                                            <td width="50%" style="vertical-align: top; text-align: center;" class="txt1 txt2"><span id="ContentPlaceHolder1_Label7" class="">Licensing Authority</span></td>
                                                        </tr>
                                                    </tbody>
                                                </table>
                                            </td>
                                        </tr>
                                    </tbody>
                                </table>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </left>
</body>

</html>