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

$formname = 'Pax Form';
$maindb = 'visaform';

$printfile = "paxform_print.php";
$file = 'paxform.php';
$trandbexist = 0;
$keyfld = "vouchno";
$keyfld1 = "tour";
$source = "";
$tourname = $_SESSION['tourname'];
$tourcode = $_SESSION['tourcode'];
$tourcond = "AND tour = '$tourcode'";

$admin = $_SESSION["admin_" . $dbname];
$zdb = $_SESSION["zdbyear_" . $dbname];
$myyear = $_SESSION[$myyear];
$compcd = $_SESSION["comp_" . $dbname];
// browse($compcd);
$zroot = $_SESSION["zdir"];

$getcomp2 = mysqli_query($conn, "SELECT `ppextract` FROM $zroot.`company` WHERE code = '$compcd'  ") or die(mysqli_error($conn));
$compfetch = mysqli_fetch_array($getcomp2);

mysqli_select_db($conn, $zdb);
include("includes/vouchno_generate.php");
include("includes/prev&next.php");

if (isset($_POST["submit"])) {
    $a = 1;

    $qvouch = $_POST["vouchno"];
    foreach ($_POST as $key => $value) {
        $exclude_fld = ["test"];
        if (in_array($key, $exclude_fld)) {
            continue;
        }
        $$key = $value;
        // echo "Field ".htmlspecialchars($key)." is ".htmlspecialchars($value)."<br>";
    }
    $count = $_POST["items"];
    $mvouch = $qvouch;
    $salecode = 11;

    if ($a == 1) {
        if ($addflag == 1) {
            $gen1 = mysqli_query($conn, "SELECT IFNULL(MAX(vouchno), 0) AS maxcode  FROM `$maindb` where vouchno != '' $tourcond LIMIT 0,1 ") or die(mysqli_error($conn));
            $vvouch = mysqli_fetch_assoc($gen1);
            if ($vvouch['maxcode'] > 0) {
                $qvouch = $vvouch["maxcode"] + 1;
            } else {

                $gen2 = mysqli_query($conn, "SELECT startreg  FROM `tour` WHERE code = '$tourcode' ") or die(mysqli_error($conn));
                if (mysqli_num_rows($gen2) > 0) {
                    $fet2 = mysqli_fetch_array($gen2);
                    $regnno = $fet2['startpax'];
                } else {
                    $qvouch = '1';
                }
                $mvouch = $qvouch;
            }
        }
        $mvouch = $qvouch;


        // FOLDER CREATION TOUR AND COMPANY WISE
        function ensureFolder($folder)
        {
            if (!is_dir($folder)) {
                mkdir($folder, 0755, true);
            }
        }

        $base = "compimages/$compcd/$tourcode/";

        ensureFolder($base);
        ensureFolder($base . "pax/");
        ensureFolder($base . "ppfront/");
        ensureFolder($base . "ppback/");
        ensureFolder($base . "pancard/");
        ensureFolder($base . "aadhaarcard/");
        ensureFolder($base . "insuranc/");
        ensureFolder($base . "visa/");
        ensureFolder($base . "health/");

        $path1 = "compimages/$compcd/$tourcode/";

        #####################PAX IMAGE#####################
        $path = "compimages/$compcd/$tourcode/pax/";
        $filename1 = $qvouch . ".jpg";
        $img_file1 = $path . ($filename1);
        $image_ftype = pathinfo($img_file1, PATHINFO_EXTENSION);
        $uploadOk = 1;
        $paxsize = $_FILES['image']['size'];

        if ($paxsize < 110000) {
            move_uploaded_file($_FILES["image"]["tmp_name"], $img_file1);
        } else {
            browse("Sorry, there was an error uploading your file. Pax Image should be less than 50KB");
        }

        #####################PP FROMT IMAGE#####################
        $ppfpath = $path1 . "ppfront/";
        $ppf_img = $ppfpath . ($filename1);
        $pfimage_ftype = pathinfo($ppf_img, PATHINFO_EXTENSION);
        $uploadOkPF = 1;
        $ppfrontsize = $_FILES['ppfront']['size'];

        if ($ppfrontsize < 110000) {
            move_uploaded_file($_FILES["ppfront"]["tmp_name"], $ppf_img);
        } else {
            browse("Sorry, there was an error uploading your file. Passport Front should be less than 50KB");
        }

        #####################PP BACK IMAGE#####################
        $ppbpath = $path1 . "ppback/";
        $ppb_img = $ppbpath . ($filename1);
        $pbimage_ftype = pathinfo($ppb_img, PATHINFO_EXTENSION);
        $uploadOkPB = 1;
        $ppbacksize = $_FILES['ppback']['size'];

        if ($ppbacksize < 110000) {
            move_uploaded_file($_FILES["ppback"]["tmp_name"], $ppb_img);
        } else {
            browse("Sorry, there was an error uploading your file. Passport Back should be less than 50KB");
        }

        #####################PAN CARD IMAGE#####################
        $panpath = $path1 . "pancard/";
        $pan_img = $panpath . ($filename1);
        $panimage_ftype = pathinfo($pan_img, PATHINFO_EXTENSION);
        $uploadOkPAN = 1;
        $panimgsize = $_FILES['panimg']['size'];

        if ($panimgsize < 110000) {
            move_uploaded_file($_FILES["panimg"]["tmp_name"], $pan_img);
        } else {
            browse("Sorry, there was an error uploading your file. Pan Card Image should be less than 50KB");
        }

        #####################AADHAAR CARD IMAGE#####################
        $aadhaarpath = $path1 . "aadhaarcard/";
        $aadhaar_img = $aadhaarpath . ($filename1);
        $aadhaarimage_ftype = pathinfo($aadhaar_img, PATHINFO_EXTENSION);
        $uploadOkPAN = 1;
        $aadhaarimgsize = $_FILES['aadhaarimg']['size'];

        if ($aadhaarimgsize < 110000) {
            move_uploaded_file($_FILES["aadhaarimg"]["tmp_name"], $aadhaar_img);
        } else {
            browse("Sorry, there was an error uploading your file. Pan Card Image should be less than 50KB");
        }

        #####################INSURANCE IMAGE#####################
        $inspath = $path1 . "insuranc/";
        $ins_img = $inspath . ($filename1);
        $insimage_ftype = pathinfo($ins_img, PATHINFO_EXTENSION);
        $uploadOkINS = 1;
        $insurancsize = $_FILES['insuranc']['size'];

        if ($insurancsize < 110000) {
            move_uploaded_file($_FILES["insuranc"]["tmp_name"], $ins_img);
        } else {
            browse("Sorry, there was an error uploading your file. Insurance Image should be less than 50KB");
        }

        #####################VISA IMAGE#####################
        $visapath = $path1 . "visa/";
        $visa_img = $visapath . ($filename1);
        $visaimage_ftype = pathinfo($visa_img, PATHINFO_EXTENSION);
        $uploadOkvisa = 1;
        $visaimgsize = $_FILES['visaimg']['size'];

        if ($visaimgsize < 110000) {
            move_uploaded_file($_FILES["visaimg"]["tmp_name"], $visa_img);
        } else {
            browse("Sorry, there was an error uploading your file. Visa Image should be less than 50KB");
        }

        #####################Health Certificate IMAGE#####################
        $healthpath = $path1 . "health/";
        $health_img = $healthpath . ($filename1);
        $healthimage_ftype = pathinfo($health_img, PATHINFO_EXTENSION);
        $uploadOkvisa = 1;
        $healthimgsize = $_FILES['healthimg']['size'];

        if ($healthimgsize < 110000) {
            move_uploaded_file($_FILES["healthimg"]["tmp_name"], $health_img);
        } else {
            browse("Sorry, there was an error uploading your file. Health Certificate Image");
        }


        #################################TRAN PART #################################  mehram part
//        mysqli_query($conn, "DELETE FROM `$trandbm` WHERE `$keyfld`='$mvouch'") or die(mysqli_error($conn));
//
//        $srl = 0;
//        $batch = date("Y-m-d") . $mvouch;
//        $cnt = 0;
//        for ($i = 0; $i <= $count; $i++) {
//
//            $srno = $_POST["srno_$i"];
//            $paxno = $_POST["paxno_$i"];
//            $paxname = $_POST["paxname_$i"];
//            $tgender = $_POST["tgender_$i"];
//            $trelate = $_POST["trelate_$i"];
//
//            $nigctr = $nonights;
//
//            if (!empty($paxname)) {
//                $srl++;
//                mysqli_query($conn, "INSERT INTO `$trandbm`(`vouchno`, `srno`, `paxno`, `paxname`, `tgender`, `trelate`)
//                                                    VALUES('$qvouch', '$srl', '$paxno', '$paxname', '$tgender', '$trelate')") or die(mysqli_error($conn));
//
//            }
//        }

        $mname = $surname . " " . $lastname . " " . $midname;
        #################################TRAN PART END #################################
        ############################## MAIN ######################################################


        if ($addflag == 1) {
            $skvouch = mysqli_query($conn, "SELECT vouchno FROM `bookform` WHERE regnno='$vregnno' AND tourno = '$tourcode'") or die(mysqli_error($conn));
            $getskvouch = mysqli_fetch_array($skvouch);
            $skbookno = $getskvouch["vouchno"];

            $uuid = $_SESSION["uuid"];

            mysqli_query($conn, "INSERT INTO `$maindb`(`vouchno`, bookvouch, `vregnno` , `vouchdt`, `image`, `surname`, `lastname`, `midname`, `suffix`,`name`,
                                                       `fhname`, `panno`, `dob`, `cmbgender`,`relation`, `plbirth`, `tktamt`, `nation`,
                                                       `touramt`, `redypass`, `issdate`, `submdate`,`barcode`, `issplace`, `expdate`, `cancdate`,
                                                       `visano`, `visadoi`, `visapoi`, `mofano`,`bankname`, `tourtype`, `roomno`,
                                                       `qurname`, `caste`, `community`, `haj_q`,`dum_q`, `oth_q`, `haj_b`, `dum_b`,`oth_b`, `tour`,
                                                       `chkticket`, `chkvisa`, `chkland`, `chkwhlchair`, `chkchildwob`,`ppfront`, `ppback`, `panimg`, `aadhaarimg`, `insuranc`, `visaimg`,
                                                       `healthimg`, `aadhaarno`, `bloodgrp`, `mstatus`, uuid, chkpassport, chkpan, chkaadhaar, chkhealth, chkvisarec, chkphoto)
                                               VALUES ('$mvouch', '$skbookno', '$vregnno', '$vouchdt',  '$img_file1', '$surname','$lastname', '$midname','$suffix','$mname',
                                                       '$fhname', '$panno', '$dob', '$cmbgender', '$relation','$plbirth', '$tktamt',
                                                       '$nation', '$touramt', '$redypass', '$issdate', '$submdate','$barcode', '$issplace',
                                                       '$expdate', '$cancdate', '$visano', '$visadoi', '$visapoi','$mofano', '$bankname',
                                                       '$tourtype', '$roomno', '$qurname', '$caste', '$community','$haj_q', '$dum_q',
                                                       '$oth_q', '$haj_b', '$dum_b', '$oth_b', '$tour', '$chkticket', '$chkvisa', '$chkland', '$chkwhlchair', '$chkchildwob',
                                                       '$ppf_img', '$ppb_img', '$pan_img', '$aadhaar_img', '$ins_img', '$visa_img', '$health_img',
                                                       '$aadhaarno', '$bloodgrp', '$mstatus', '$uuid', '$chkpassport', '$chkpan', '$chkaadhaar', '$chkhealth', '$chkvisarec', '$chkphoto')") or die(mysqli_error($conn));
            insmess();
            $mvouch = $qvouch; //1
            header("refresh: 1; $file?$keyfld=$mvouch&mode=edit");
        } else {

            //            browse('edit');
//            browse($mvouch);

            mysqli_query($conn, "UPDATE `$maindb` SET `vouchdt`='$vouchdt', `vregnno`='$vregnno', `image`='$img_file1', `surname`='$surname', `lastname`='$lastname',
                                                      `name`='$mname', `midname`='$midname', `suffix`='$suffix', `fhname`='$fhname', `panno`='$panno', `fhname`='$fhname',
                                                      `panno`='$panno', `dob`='$dob', `cmbgender`='$cmbgender', `relation`='$relation', `plbirth`='$plbirth',
                                                      `tktamt`='$tktamt', `nation`='$nation', `touramt`='$touramt', `redypass`='$redypass',`issdate`='$issdate', 
                                                      `submdate`='$submdate', `barcode`='$barcode', `issplace`='$issplace', `expdate`='$expdate', `cancdate`='$cancdate',
                                                      `visano`='$visano', `visadoi`='$visadoi', `visapoi`='$visapoi', `mofano`='$mofano', `bankname`='$bankname', 
                                                      `tourtype`='$tourtype',`roomno`='$roomno', `qurname`='$qurname', `caste`='$caste', `community`='$community', 
                                                      `haj_q`='$haj_q', `dum_q`='$dum_q',`oth_q`='$oth_q', `haj_b`='$haj_b', `dum_b`='$dum_b', 
                                                      `oth_b`='$oth_b', `chkticket`='$chkticket', `chkvisa`='$chkvisa', `chkland`='$chkland', `chkwhlchair`='$chkwhlchair',
                                                      `chkchildwob`='$chkchildwob', `ppfront`='$ppf_img', `ppback`='$ppb_img', `panimg`='$pan_img', 
                                                      `aadhaarimg`='$aadhaar_img', `insuranc`='$ins_img', `visaimg`='$visa_img',
                                                      `healthimg`='$health_img', `aadhaarno`='$aadhaarno', `bloodgrp`='$bloodgrp',
                                                      `mstatus`='$mstatus', chkpassport = '$chkpassport', chkpan = '$chkpan', chkaadhaar  = '$chkaadhaar',
                                                      `chkhealth`= '$chkhealth',chkvisarec= '$chkvisarec',chkphoto = '$chkphoto' 
                                                      WHERE `vouchno`= '$mvouch' and tour = '$tour' ") or die(mysqli_error($conn));

            updmess();
            header("refresh: 1; $file?$keyfld=$mvouch&mode=edit");
        }

        ################################# MAIN PART END #################################
    }
}

if ($addflag != 1) {

    $getvouch = '';
    if ($addflag == 0) {
        $getvouch = $_GET[$keyfld];
    } else {
        $getvouch = $qvouch;
    }

    $result = mysqli_query($conn, "SELECT * FROM `$maindb` WHERE $keyfld='$getvouch' $tourcond") or die(mysqli_error($conn));
    $get = mysqli_fetch_array($result);

    $mbook = mysqli_query($conn, "SELECT depdate FROM bookform where regnno='$get[vregnno]' and tourno ='$tourcode'") or die(mysqli_error($conn));
    $tbook = mysqli_fetch_array($mbook);

    $mhotel = mysqli_query($conn, "SELECT code,hotelnm FROM hotels where code='$get[hotelnm]'") or die(mysqli_error($conn));
    $thotel = mysqli_fetch_array($mhotel);

    $gettour = mysqli_query($conn, "SELECT code,name FROM tour where code='$get[tour]'") or die(mysqli_error($conn));
    $fettour = mysqli_fetch_array($gettour);

    if ($get['cmbgender'] == 'M') {
        $gender = 'Male';
    } elseif ($get['cmbgender'] == 'F') {
        $gender = 'Female';
    }
}

$senable = "";
$cenable = "";

if (isset($_GET["delete"])) {
    $imgfile = "images/pax/" . $_GET[$keyfld] . ".jpg";
    unlink($imgfile);

    $delcond = " vouchno = '$_GET[$keyfld]' and tour ='$tourcode' ";
    delnew($zdb, "$maindb", "$delcond", "$file?mode=last");
}


if (isset($_GET["delete"])) {

    $basePath = "compimages/$compcd/$tourcode/";
    $flname = $_GET[$keyfld] . ".jpg";

    $folders = [
        "pax",
        "ppfront",
        "ppback",
        "pancard",
        "aadhaarcard",
        "insuranc",
        "visa",
        "health"
    ];

    foreach ($folders as $folder) {
        $filenmd = $basePath . $folder . "/" . $flname;

        if (file_exists($filenmd)) {
            unlink($filenmd);
        }
    }

    $delcond = "vouchno='$_GET[$keyfld]' AND tour='$tourcode'";
    delnew($zdb, $maindb, $delcond, "$file?mode=last");
}

include("includes/linkshead.php");
?>
<style>
    .nav-tabs {
        text-transform: uppercase;
        font-weight: bold;
        width: 1400px;
    }

    .upload-btn-wrapper {
        position: relative;
        overflow: hidden;
        display: inline-block;
    }

    .skbtn {
        border: 2px solid gray;
        color: gray;
        background-color: white;
        padding: -4px -10px;
        border-radius: 8px;
        font-size: 15px;
        font-weight: bold;
        margin-left: 60px;
    }

    .sbtn {
        border: 2px solid gray;
        color: gray;
        background-color: white;
        padding: -4px -10px;
        border-radius: 8px;
        font-size: 15px;
        font-weight: bold;
    }

    .upload-btn-wrapper input[type=file] {
        font-size: 100px;
        position: absolute;
        left: 0;
        top: 0;
        opacity: 0;
    }

    .skimg {
        border-radius: 6px;
        box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
    }

    .paximg {
        /* border: #E7B315 solid 1px; */
        /*        width: 210px;
                height: 110px;*/
        margin-left: 70px;
        border-radius: 6px;
        /* box-shadow: 4px 4px 5px 0 rgba(255, 255, 255, .5),
            -4px -4px 5px 0 rgba(116, 125, 136, .5),
            inset -4px -4px 5px 0 rgba(255, 255, 255, .2),
            inset 4px 4px 5px 0 rgba(0, 0, 0, .4); */
        box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
    }


    /* ===========================
    PASSPORT OCR MODAL
    =========================== */

    #passportOCRModal .modal-dialog {
        width: 850px;
        max-width: 95%;
    }

    #passportOCRModal .modal-content {
        border: none;
        border-radius: 18px;
        overflow: hidden;
        box-shadow: 0 15px 40px rgba(0, 0, 0, .25);
    }

    #passportOCRModal .modal-header {
        background: linear-gradient(135deg, #0d6efd, #0099ff);
        color: #fff;
        border: 0;
        padding: 8px 20px;
    }

    #passportOCRModal .modal-header h4 {
        margin: 0;
        font-size: 22px;
        font-weight: 600;
    }

    #passportOCRModal .close {
        color: #fff;
        opacity: 1;
        font-size: 30px;
        text-shadow: none;
    }

    #passportOCRModal .modal-body {
        background: #f7f9fc;
        padding: 7px;
    }

    /* Table */

    #passportOCRModal table {
        margin-bottom: 0;
        border-collapse: separate;
        border-spacing: 0 8px;
    }

    #passportOCRModal th {
        width: 38%;
        background: #eef5ff;
        color: #1d3557;
        border: none !important;
        padding: 8px 10px !important;
        font-weight: 600;
        border-radius: 8px 0 0 8px;
    }

    #passportOCRModal td {
        background: #fff;
        border: none !important;
        padding: 8px 10px !important;
        color: #222;
        font-weight: 500;
        border-radius: 0 8px 8px 0;
        word-break: break-word;
    }

    /* Footer */

    #passportOCRModal .modal-footer {
        border: none;
        background: #fff;
        padding: 18px 25px;
    }

    /* Buttons */

    #passportOCRModal .btn {
        border-radius: 10px;
        padding: 10px 25px;
        font-size: 15px;
        font-weight: 600;
        transition: .25s;
    }

    #passportOCRModal .btn-default {
        background: #f2f2f2;
        border: 1px solid #ddd;
    }

    #passportOCRModal .btn-default:hover {
        background: #e4e4e4;
    }

    #passportOCRModal .btn-success {
        background: linear-gradient(135deg, #16a34a, #22c55e);
        border: none;
    }

    #passportOCRModal .btn-success:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 20px rgba(34, 197, 94, .35);
    }

    /* Animation */

    #passportOCRModal.fade .modal-dialog {
        transform: translateY(-25px);
        transition: .3s ease;
    }

    #passportOCRModal.in .modal-dialog {
        transform: translateY(0);
    }

    /* Label style */

    .ocr-title {
        font-size: 13px;
        color: #777;
        margin-bottom: 3px;
    }

    .ocr-value {
        font-size: 16px;
        font-weight: 600;
        color: #222;
    }

    /* Mobile */

    @media(max-width:768px) {

        #passportOCRModal .modal-dialog {
            width: 98%;
            margin: 15px auto;
        }

        #passportOCRModal th,
        #passportOCRModal td {
            display: block;
            width: 100%;
            border-radius: 8px;
        }

        #passportOCRModal th {
            margin-bottom: 2px;
        }

    }

    .passport-btn {
        display: flex;
        align-items: center;
        height: 34px;
    }

    #extractPassportBtn {
        width: 100%;
        height: 27px;
        padding: 0;
        font-size: 9px;
    }

    .mainpart-card {
        margin: 0;
        padding: 8px 10px;
        border: 1px solid #e8eef5;
        border-radius: 16px;
        background: #fff;
        box-shadow: 0 6px 18px rgba(0, 0, 0, .08);
    }

    .visa-card {
        margin: 0;
        padding: 8px 10px;
        border: 1px solid #e8eef5;
        border-radius: 16px;
        background: #fff;
        box-shadow: 0 6px 18px rgba(0, 0, 0, .08);
    }

    .ticketchk-card {
        margin: 0;
        padding: 8px 10px;
        border: 1px solid #e8eef5;
        border-radius: 16px;
        background: lightyellow;
        box-shadow: 0 6px 18px rgba(0, 0, 0, .08);
    }

    .passportchk-card {
        margin: 0;
        padding: 8px 10px;
        border: 1px solid #e8eef5;
        border-radius: 16px;
        background: #e0ffff;
        box-shadow: 0 6px 18px rgba(0, 0, 0, .08);
    }

    .passport-card {
        margin: 8px 0;
        padding: 10px 12px;
        background: linear-gradient(135deg, #f8fcff, #eef8ff);
        border: 1px solid #d8e8f5;
        border-radius: 14px;
        box-shadow: 0 4px 15px rgba(0, 0, 0, .08);
    }

    .passport-card {
        margin: 8px 0;
        padding: 10px 12px;
        background: linear-gradient(135deg, #f8fcff, #eef8ff);
        border: 1px solid #d8e8f5;
        border-radius: 14px;
        box-shadow: 0 4px 15px rgba(0, 0, 0, .08);
    }

    .passport-divider {
        height: 1px;
        margin: 8px 0;
        background: linear-gradient(to right,
                transparent,
                #c8dceb,
                transparent);
    }

    .passport-card .row {
        margin-left: -10px;
        margin-right: -10px;
    }

    .mainpart-card .form-control,
    .visa-card .form-control,
    .passport-card .form-control {
        border-radius: 7px;
        border: 1px solid #d6e4f0;
        box-shadow: none;
        transition: .25s;
    }

    .passport-card .form-control:focus {
        border-color: #4da3ff;
        box-shadow: 0 0 0 3px rgba(77, 163, 255, .15);
    }

    .mainpart-card label,
    .passport-card label {
        font-weight: 600;
        color: #495057;
    }

    .form-check-input {
        margin-left: 8px;
        vertical-align: middle;
        transform: scale(1.2);
        cursor: pointer;
    }
</style>
<script src="MyScript/shortkeys.js?b=2" type="text/javascript"></script>
<script src="MyScript/paxform.js?a=<?= mt_rand() ?>" type="text/javascript"></script>
<script src="MyScript/paxform_search.js?c=<?= mt_rand() ?>" type="text/javascript"></script>
</head>

<body>
    <form method='POST' action="" enctype="multipart/form-data">
        <!-- Default box -->
        <div>
            <div class="col-lg-12 col-md-10 col-sm-12 col-xs-12  pad">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <div class="row">
                            <div class="col-lg-1 col-md-1 col-sm-1 col-xs-1  text-right ">
                                <h3 class="panel-title" style="color:inherit"><?php echo $formname; ?></h3>
                            </div>
                            <div class="col-lg-10 col-md-10 col-sm-10 col-xs-10 text-center ">
                                <?php include("includes/buttsale.php"); ?>
                            </div>
                            <div class="col-lg-1 col-md-1 col-sm-1 col-xs-1  text-center ">
                            </div>
                        </div>
                    </div>

                    <div class="panel-body">

                        <div class="mainpart-card">
                            <div class="row">
                                <div class="col-lg-1 col-md-2 col-sm-2 col-xs-2 text-right pad">
                                    <label class="label-control marg">Tour</label>
                                </div>
                                <div class="col-lg-2 col-md-2 col-sm-2 col-xs-2  pad">
                                    <select name="tour" id="tour" class="form-control form tour " style="width:100%">
                                        <option value="<?php echo $tourcode; ?>"><?php echo $tourname; ?></option>
                                    </select>
                                </div>

                                <div class="col-lg-1 col-md-2 col-sm-2 col-xs-2 text-right pad">
                                    <label class="label-control marg">Regn. No.</label>
                                </div>
                                <div class="col-lg-1 col-md-3 col-sm-4 col-xs-4  pad">
                                    <select class="form-control form vregnno select2 focusfield" name="vregnno"
                                        style="width:100%">
                                        <option value="<?php echo ($addflag != 1) ? $get["vregnno"] : ""; ?>">
                                            <?php echo ($addflag != 1) ? $get["vregnno"] : ""; ?>
                                        </option>
                                        <?php
                                        $getvr = mysqli_query($conn, "Select * from `bookform` where tourno='$tourcode' order by vouchno");
                                        while ($fetvr = mysqli_fetch_array($getvr)) {
                                            echo "<option value='$fetvr[regnno]'>$fetvr[regnno]</option>";
                                        }
                                        ?>
                                    </select>
                                </div>

                                <div class="col-lg-1  col-md-2 col-sm-2 col-xs-2 text-right pad">
                                    <label class="label-control marg">Pax No.</label>
                                </div>
                                <div class="col-lg-1 col-md-3 col-sm-4 col-xs-4  pad">
                                    <input type="text" step="any" class="form-control vouchno form" name="vouchno"
                                        value="<?php echo ($addflag != 1) ? $get["vouchno"] : "NEW"; ?>" readonly>
                                    <input type="hidden" class="form-control text-size form addflg"
                                        value="<?php echo $addflag; ?>">
                                </div>

                                <div class="col-lg-1 col-md-1 col-sm-2 col-xs-2 text-right pad">
                                    <label class="label-control marg">Date</label>
                                </div>
                                <div class="col-lg-1 col-md-3 col-sm-4 col-xs-4  pad">
                                    <input type="date" class="form-control vouchdt form" name="vouchdt"
                                        value="<?php echo ($addflag != 1) ? $get["vouchdt"] : date('Y-m-d'); ?>">
                                </div>
                                <div class="col-lg-2 col-md-3 col-sm-4 col-xs-4  pad">
                                    <div class="upload-btn-wrapper">
                                        <button class="skbtn">Upload Image</button>
                                        <input type="file" class="form image" name="image" accept=".jpg" />
                                    </div>
                                    <!-- <input type="file" class="form-control image form" accept=".jpg" style="height:50%;width:50%;margin-left:50px" name="image"> -->
                                </div>
                            </div>

                            <div class="row" class="nomarg">
                                <div class="col-lg-1 col-md-2 col-sm-2 col-xs-2 text-left pad">
                                    <label class="label-control marg"> </label>
                                </div>
                                <div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 text-left pad">
                                    <label class="label-control marg" style="color:#2FBFFE;">Surname </label>
                                </div>
                                <div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 text-left pad">
                                    <label class="label-control marg" style="color:#2FBFFE;">Name </label>
                                </div>
                                <div class="col-lg-1 col-md-2 col-sm-2 col-xs-2 text-left pad">
                                    <label class="label-control marg" style="color:#2FBFFE;">Middle Name </label>
                                </div>
                                <div class="col-lg-3 col-md-2 col-sm-2 col-xs-2 text-left pad">
                                </div>
                                <div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 text-left pad">
                                    <img src="<?= $get['image'] . "?a=" . mt_rand(); ?>" alt="pax image" class="paximg"
                                        style="width:160px;height:160px;margin-bottom:-178px;">
                                </div>
                            </div>

                            <div class="row">
                                <div class="col-lg-1 col-md-2 col-sm-2 col-xs-2 text-left pad">
                                    <label class="label-control marg"> </label>
                                </div>
                                <div class="col-lg-2 col-md-3 col-sm-4 col-xs-4  pad">
                                    <input type="text" class="form-control surname form" name="surname"
                                        value="<?php echo ($addflag != 1) ? $get["surname"] : ""; ?>">
                                </div>
                                <div class="col-lg-2 col-md-3 col-sm-4 col-xs-4  pad">
                                    <input type="text" class="form-control lastname form" name="lastname"
                                        value="<?php echo ($addflag != 1) ? $get["lastname"] : ""; ?>">
                                </div>
                                <div class="col-lg-2 col-md-3 col-sm-4 col-xs-4  pad">
                                    <input type="text" class="form-control midname form" name="midname"
                                        value="<?php echo ($addflag != 1) ? $get["midname"] : ""; ?>">
                                </div>
                                <div class="col-lg-1 col-md-2 col-sm-2 col-xs-2 text-right pad">
                                    <label class="label-control marg">Suffix</label>
                                </div>
                                <div class="col-lg-1 col-md-3 col-sm-4 col-xs-4  pad">
                                    <select name="suffix" id="suffix" class="form-control suffix form select2">
                                        <option value="<?php echo ($addflag != 1) ? $get["suffix"] : "" ?>">
                                            <?php echo ($addflag != 1) ? $get["suffix"] : "" ?>
                                        </option>
                                        <?php
                                        $getsuff = mysqli_query($conn, "Select * from suffix order by name");
                                        while ($row = mysqli_fetch_array($getsuff)) {
                                            echo "<option value='$row[name]'>$row[name]</option>";
                                        }
                                        ?>
                                    </select>
                                </div>
                            </div>

                            <div class="row">
                                <div class="col-lg-1 col-md-2 col-sm-2 col-xs-2 text-right pad">
                                    <label class="label-control marg">Father's Name</label>
                                </div>
                                <div class="col-lg-2 col-md-3 col-sm-4 col-xs-4  pad">
                                    <input type="text" class="form-control fhname form" name="fhname"
                                        value="<?php echo ($addflag != 1) ? $get["fhname"] : ""; ?>">
                                </div>
                                <div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 text-right pad">
                                    <label class="label-control marg">Pan No.</label>
                                </div>
                                <div class="col-lg-2 col-md-3 col-sm-4 col-xs-4  pad">
                                    <input type="text" class="form-control panno form" name="panno"
                                        value="<?php echo ($addflag != 1) ? $get["panno"] : ""; ?>">
                                </div>
                                <div class="col-lg-1 col-md-2 col-sm-2 col-xs-2 text-right pad">
                                    <label class="label-control marg">Gender</label>
                                </div>
                                <div class="col-lg-1 col-md-3 col-sm-4 col-xs-4  pad">
                                    <select name="cmbgender" id="cmbgender" class="form-control cmbgender select2 form">
                                        <option value="<?php echo ($addflag != 1) ? $get["cmbgender"] : "" ?>">
                                            <?php echo ($addflag != 1) ? $gender : "" ?>
                                        </option>
                                        <option value=""></option>
                                        <option value="M">Male</option>
                                        <option value="F">Female</option>
                                    </select>
                                </div>
                            </div>

                            <div class="row">
                                <div class="col-lg-1 col-md-2 col-sm-2 col-xs-2 text-right pad">
                                    <label class="label-control marg">D.O.B</label>
                                </div>
                                <div class="col-lg-1 col-md-3 col-sm-4 col-xs-4  pad">
                                    <input type="date" class="form-control dob form" name="dob"
                                        value="<?php echo ($addflag != 1) ? $get["dob"] : ""; ?>">
                                </div>

                                <div class="col-lg-1 col-md-1 col-sm-2 col-xs-2 text-right pad wob">
                                    <label class="label-control marg">Child wob</label>
                                </div>
                                <div class="col-lg-1 col-md-1 col-sm-4 col-xs-4  pad wob">
                                    <input type="checkbox" class="form-control chkchildwob form"
                                        style="margin-left:20px;accent-color:blue" <?php
                                        if ($get['chkchildwob'] == "1") {
                                            echo "checked";
                                        }
                                        ?> value="1" name="chkchildwob">
                                </div>

                                <div class="col-lg-1 col-md-2 col-sm-2 col-xs-2 text-right pad">
                                    <label class="label-control marg">Aadhaar No.</label>
                                </div>
                                <div class="col-lg-2 col-md-3 col-sm-4 col-xs-4  pad">
                                    <input type="text" class="form-control aadhaarno form" name="aadhaarno"
                                        value="<?php echo ($addflag != 1) ? $get["aadhaarno"] : ""; ?>">
                                </div>
                                <div class="col-lg-1 col-md-2 col-sm-2 col-xs-2 text-right pad">
                                    <label class="label-control marg">Departure</label>
                                </div>
                                <div class="col-lg-1 col-md-2 col-sm-2 col-xs-2 text-right pad">
                                    <input type="date" class="form-control depdate form" name=""
                                        value="<?php echo ($addflag != 1) ? $tbook["depdate"] : ""; ?>" readonly
                                        style="color:maroon">
                                </div>
                            </div>

                            <div class="row">
                                <div class="col-lg-1 col-md-2 col-sm-2 col-xs-2 text-right pad">
                                    <label class="label-control marg">Relationship</label>
                                </div>
                                <div class="col-lg-3 col-md-3 col-sm-4 col-xs-4  pad">
                                    <input type="text" class="form-control relation form" name="relation"
                                        value="<?php echo ($addflag != 1) ? $get["relation"] : ""; ?>">
                                </div>
                            </div>

                            <div class="row">
                                <div class="col-lg-1 col-md-2 col-sm-2 col-xs-2 text-right pad">
                                    <label class="label-control marg">Place of Birth</label>
                                </div>
                                <div class="col-lg-3 col-md-3 col-sm-4 col-xs-4  pad">
                                    <input type="text" class="form-control plbirth form" name="plbirth"
                                        value="<?php echo ($addflag != 1) ? $get["plbirth"] : ""; ?>">
                                </div>
                                <div class="col-lg-1 col-md-2 col-sm-2 col-xs-2 text-right pad">
                                    <label class="label-control marg">Ticket Amount</label>
                                </div>
                                <div class="col-lg-1 col-md-3 col-sm-4 col-xs-4  pad">
                                    <input type="number" step="any" class="form-control tktamt form" name="tktamt"
                                        value="<?php echo ($addflag != 1) ? $get["tktamt"] : ""; ?>">
                                </div>
                                <div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 text-right pad">
                                    <label class="label-control marg">Blood Group</label>
                                </div>
                                <div class="col-lg-1 col-md-3 col-sm-4 col-xs-4  pad">
                                    <input type="text" class="form-control bloodgrp form" name="bloodgrp"
                                        value="<?php echo ($addflag != 1) ? $get["bloodgrp"] : ""; ?>">
                                </div>
                            </div>

                            <div class="row">
                                <div class="col-lg-1 col-md-2 col-sm-2 col-xs-2 text-right pad">
                                    <label class="label-control marg">Nationality</label>
                                </div>
                                <div class="col-lg-3 col-md-3 col-sm-4 col-xs-4  pad">
                                    <input type="text" class="form-control nation form" name="nation"
                                        value="<?php echo ($addflag != 1) ? $get["nation"] : ""; ?>">
                                </div>
                                <div class="col-lg-1 col-md-2 col-sm-2 col-xs-2 text-right pad">
                                    <label class="label-control marg">Tour Amount</label>
                                </div>
                                <div class="col-lg-1 col-md-3 col-sm-4 col-xs-4  pad">
                                    <input type="number" step="any" class="form-control touramt form" name="touramt"
                                        value="<?php echo ($addflag != 1) ? $get["touramt"] : ""; ?>">
                                </div>
                                <div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 text-right pad">
                                    <label class="label-control marg">Marital Status</label>
                                </div>
                                <div class="col-lg-1 col-md-3 col-sm-4 col-xs-4  pad">
                                    <select name="mstatus" class="form-control mstatus select2 form">
                                        <option value="<?php echo ($addflag != 1) ? $get["mstatus"] : "" ?>">
                                            <?php echo ($addflag != 1) ? $get["mstatus"] : "" ?>
                                        </option>
                                        <option value=""></option>
                                        <option value="Single">Single</option>
                                        <option value="Married">Married</option>
                                        <option value="Divorced">Divorced</option>
                                        <option value="Widow">Widow</option>
                                    </select>
                                </div>
                            </div>
                        </div>


                        <div class="passport-card">
                            <div class="row">
                                <div class="col-lg-1 col-md-2 col-sm-2 col-xs-2 text-right pad">
                                    <label class="label-control marg">Passport No.</label>
                                </div>
                                <div class="col-lg-1 col-md-3 col-sm-4 col-xs-4  pad">
                                    <input type="text" class="form-control redypass form" name="redypass"
                                        value="<?php echo ($addflag != 1) ? $get["redypass"] : ""; ?>">
                                </div>

                                <div class="col-lg-1 col-md-1 col-sm-4 col-xs-4 pad passport-btn">

                                    <?php if ($compfetch["ppextract"] == 1): ?>

                                        <button type="button" class="btn btn-primary form" id="extractPassportBtn">
                                            Extract Passport
                                        </button>
                                    <?php endif; ?>
                                </div>


                                <div class="col-lg-1 col-md-2 col-sm-2 col-xs-2 text-right pad">
                                    <label class="label-control marg">Issue Date</label>
                                </div>
                                <div class="col-lg-1 col-md-3 col-sm-4 col-xs-4  pad">
                                    <input type="date" class="form-control issdate form" name="issdate"
                                        value="<?php echo ($addflag != 1) ? $get["issdate"] : ""; ?>">
                                </div>

                            </div>

                            <div class="row">
                                <div class="col-lg-1 col-md-2 col-sm-2 col-xs-2 text-right pad">
                                    <label class="label-control marg">Place of Issue</label>
                                </div>
                                <div class="col-lg-2 col-md-3 col-sm-4 col-xs-4  pad">
                                    <input type="text" class="form-control issplace form" name="issplace"
                                        value="<?php echo ($addflag != 1) ? $get["issplace"] : ""; ?>">
                                </div>
                                <div class="col-lg-1 col-md-2 col-sm-2 col-xs-2 text-right pad">
                                    <label class="label-control marg">Expiry Date</label>
                                </div>
                                <div class="col-lg-1 col-md-3 col-sm-4 col-xs-4  pad">
                                    <input type="date" class="form-control expdate form" name="expdate"
                                        value="<?php echo ($addflag != 1) ? $get["expdate"] : ""; ?>">
                                </div>
                                <div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 text-right pad">
                                    <label class="label-control marg" style="color:red">Cancellation Date</label>
                                </div>
                                <div class="col-lg-1 col-md-3 col-sm-4 col-xs-4  pad">
                                    <input type="date" class="form-control cancdate form" style="color:red"
                                        name="cancdate" value="<?php echo ($addflag != 1) ? $get["cancdate"] : ""; ?>">
                                </div>
                            </div>
                        </div>

                        <div class="visa-card">
                            <div class="row">
                                <div class="col-lg-1 col-md-2 col-sm-2 col-xs-2 text-right pad">
                                    <label class="label-control marg">Visa No.</label>
                                </div>
                                <div class="col-lg-2 col-md-3 col-sm-4 col-xs-4  pad">
                                    <input type="text" class="form-control visano form" name="visano"
                                        value="<?php echo ($addflag != 1) ? $get["visano"] : ""; ?>">
                                </div>
                                <div class="col-lg-1 col-md-2 col-sm-2 col-xs-2 text-right pad">
                                    <label class="label-control marg">Issue Date</label>
                                </div>
                                <div class="col-lg-1 col-md-3 col-sm-4 col-xs-4  pad">
                                    <input type="date" class="form-control visadoi form" name="visadoi"
                                        value="<?php echo ($addflag != 1) ? $get["visadoi"] : ""; ?>">
                                </div>
                                <div class="col-lg-1 col-md-2 col-sm-2 col-xs-2 text-right pad">
                                    <label class="label-control marg">Place of Issue</label>
                                </div>
                                <div class="col-lg-2 col-md-3 col-sm-4 col-xs-4  pad">
                                    <input type="text" class="form-control visapoi form" name="visapoi"
                                        value="<?php echo ($addflag != 1) ? $get["visapoi"] : ""; ?>">
                                </div>
                            </div>
                        </div>

                        <div class="ticketchk-card">
                            <div class="row">
                                <div class="col-lg-1 col-md-1 col-sm-2 col-xs-2 text-right pad">
                                    <label class="label-control marg">Ticket</label>
                                </div>
                                <div class="col-lg-1 col-md-1 col-sm-4 col-xs-4  pad">
                                    <input type="checkbox" class="form-control chkticket form"
                                        style="margin-left:20px;accent-color:red" <?php
                                        if ($get['chkticket'] == "1") {
                                            echo "checked";
                                        }
                                        ?> value="1" name="chkticket">
                                </div>
                                <div class="col-lg-1 col-md-1 col-sm-2 col-xs-2 text-right pad">
                                    <label class="label-control marg">Visa</label>
                                </div>
                                <div class="col-lg-1 col-md-1 col-sm-4 col-xs-4  pad">
                                    <input type="checkbox" class="form-control chkvisa form"
                                        style="margin-left:20px;accent-color:yellow" <?php
                                        if ($get['chkvisa'] == "1") {
                                            echo "checked";
                                        }
                                        ?> value="1" name="chkvisa">
                                </div>
                                <div class="col-lg-1 col-md-1 col-sm-2 col-xs-2 text-right pad">
                                    <label class="label-control marg">Land Package</label>
                                </div>
                                <div class="col-lg-1 col-md-1 col-sm-4 col-xs-4  pad">
                                    <input type="checkbox" class="form-control chkland form"
                                        style="margin-left:20px;accent-color:green" <?php
                                        if ($get['chkland'] == "1") {
                                            echo "checked";
                                        }
                                        ?> value="1" name="chkland">
                                </div>
                                <div class="col-lg-1 col-md-1 col-sm-2 col-xs-2 text-right pad">
                                    <label class="label-control marg">Wheel Chair</label>
                                </div>
                                <div class="col-lg-1 col-md-1 col-sm-4 col-xs-4  pad">
                                    <input type="checkbox" class="form-control chkwhlchair form"
                                        style="margin-left:20px;accent-color:green" <?php
                                        if ($get['chkwhlchair'] == "1") {
                                            echo "checked";
                                        }
                                        ?> value="1" name="chkwhlchair">
                                </div>
                            </div>
                        </div>


                        <div class="passportchk-card">
                            <div class="row">
                                <!-- Passport -->
                                <div class="col-lg-1 col-md-1 col-sm-2 col-xs-2 text-right pad">
                                    <label class="label-control marg">Passport</label>
                                </div>
                                <div class="col-lg-1 col-md-1 col-sm-4 col-xs-4 pad">
                                    <input type="checkbox" class="form-control chkpassport form"
                                        style="margin-left:20px;accent-color:blue" <?php if ($get['chkpassport'] == "1")
                                            echo "checked"; ?> value="1" name="chkpassport">
                                </div>


                                <!-- Pan Card -->
                                <div class="col-lg-1 col-md-1 col-sm-2 col-xs-2 text-right pad">
                                    <label class="label-control marg">Pan Card</label>
                                </div>
                                <div class="col-lg-1 col-md-1 col-sm-4 col-xs-4 pad">
                                    <input type="checkbox" class="form-control chkpan form"
                                        style="margin-left:20px;accent-color:purple" <?php if ($get['chkpan'] == "1")
                                            echo "checked"; ?> value="1" name="chkpan">
                                </div>

                                <!-- Aadhaar Card -->
                                <div class="col-lg-1 col-md-1 col-sm-2 col-xs-2 text-right pad">
                                    <label class="label-control marg">Aadhaar</label>
                                </div>
                                <div class="col-lg-1 col-md-1 col-sm-4 col-xs-4 pad">
                                    <input type="checkbox" class="form-control chkaadhaar form"
                                        style="margin-left:20px;accent-color:orange" <?php if ($get['chkaadhaar'] == "1")
                                            echo "checked"; ?> value="1" name="chkaadhaar">
                                </div>

                                <!-- Health Card -->
                                <div class="col-lg-1 col-md-1 col-sm-2 col-xs-2 text-right pad">
                                    <label class="label-control marg">Health Card</label>
                                </div>
                                <div class="col-lg-1 col-md-1 col-sm-4 col-xs-4 pad">
                                    <input type="checkbox" class="form-control chkhealth form"
                                        style="margin-left:20px;accent-color:green" <?php if ($get['chkhealth'] == "1")
                                            echo "checked"; ?> value="1" name="chkhealth">
                                </div>

                                <!-- Visa -->
                                <div class="col-lg-1 col-md-1 col-sm-2 col-xs-2 text-right pad">
                                    <label class="label-control marg">Visa</label>
                                </div>
                                <div class="col-lg-1 col-md-1 col-sm-4 col-xs-4 pad">
                                    <input type="checkbox" class="form-control chkvisarec form"
                                        style="margin-left:20px;accent-color:red" <?php if ($get['chkvisarec'] == "1")
                                            echo "checked"; ?> value="1" name="chkvisarec">
                                </div>

                                <!-- Photo White -->
                                <div class="col-lg-1 col-md-1 col-sm-2 col-xs-2 text-right pad">
                                    <label class="label-control marg">Photo White</label>
                                </div>
                                <div class="col-lg-1 col-md-1 col-sm-4 col-xs-4 pad">
                                    <input type="checkbox" class="form-control chkphoto form"
                                        style="margin-left:20px;accent-color:black" <?php if ($get['chkphoto'] == "1")
                                            echo "checked"; ?> value="1" name="chkphoto">
                                </div>
                            </div>
                        </div>


                        <div class="nav-tabs-custom">
                            <ul class="nav nav-tabs" style="text-align: center;">
                                <!-- <li class="active"><a href="#tab_1" data-toggle="tab" aria-expanded="true">MEHRAM DETAIL</a></li> -->
                                <li class="active" style="margin-left:50px"> <a href="#tab_1" data-toggle="tab"
                                        aria-expanded="false">IMAGES</a></li>
                                <li style="margin-left:50px"> <a href="#tab_2" data-toggle="tab"
                                        aria-expanded="false">MOFA DETAIL</a></li>
                                <li class="" style="margin-left:50px"> <a href="#tab_3" data-toggle="tab"
                                        aria-expanded="false">QURBANI DETAIL </a></li>
                            </ul>

                            <div class="tab-content">
                                <div class="tab-pane active" id="tab_1">
                                    <div class="panel panel-default">
                                        <div class="row" style="color:blue;margin-left:30px">
                                            <div class="col-lg-2 col-md-3 col-sm-4 col-xs-4 text-center pad"
                                                style="width:200px">
                                                <label class="label-control marg">PP Front</label>
                                            </div>
                                            <div class="col-lg-2 col-md-3 col-sm-4 col-xs-4 text-center pad"
                                                style="width:200px">
                                                <label class="label-control marg">PP Back</label>
                                            </div>
                                            <div class="col-lg-2 col-md-3 col-sm-4 col-xs-4 text-center pad"
                                                style="width:200px">
                                                <label class="label-control marg">Pan Card</label>
                                            </div>
                                            <div class="col-lg-2 col-md-3 col-sm-4 col-xs-4 text-center pad"
                                                style="width:200px">
                                                <label class="label-control marg">Aadhaar Card</label>
                                            </div>
                                            <div class="col-lg-2 col-md-3 col-sm-4 col-xs-4 text-center pad"
                                                style="width:200px">
                                                <label class="label-control marg">Insurance</label>
                                            </div>
                                            <div class="col-lg-2 col-md-3 col-sm-4 col-xs-4 text-center pad"
                                                style="width:200px">
                                                <label class="label-control marg">Visa</label>
                                            </div>
                                            <div class="col-lg-2 col-md-3 col-sm-4 col-xs-4 text-center pad"
                                                style="width:200px">
                                                <label class="label-control marg">Health </label>
                                            </div>
                                        </div>

                                        <div class="row" style="margin-left:30px">
                                            <div class="col-lg-2 col-md-3 col-sm-4 col-xs-4 text-center pad"
                                                style="width:200px">

                                                <div class="upload-btn-wrapper">
                                                    <button class="sbtn">Choose Passport</button>
                                                    <input type="file" id="ocrPassportFile" class="form ppfront"
                                                        name="ppfront" accept=".jpg,.jpeg,.png,.pdf">
                                                </div>

                                                <!-- <input type="file" class="form-control ppfront form" accept=".jpg" style="height:50%;width:50%;margin-left:50px" name="ppfront"> -->
                                            </div>

                                            <div class="col-lg-2 col-md-3 col-sm-4 col-xs-4 text-center pad"
                                                style="width:200px">
                                                <div class="upload-btn-wrapper">
                                                    <button class="sbtn">Upload Image</button>
                                                    <input type="file" class="form ppback" name="ppback"
                                                        accept=".jpg" />
                                                </div>
                                                <!-- <input type="file" class="form-control ppback form" accept=".jpg" style="height:50%;width:50%;margin-left:50px" name="ppback"> -->
                                            </div>
                                            <div class="col-lg-2 col-md-3 col-sm-4 col-xs-4 text-center pad"
                                                style="width:200px">
                                                <div class="upload-btn-wrapper">
                                                    <button class="sbtn">Upload Image</button>
                                                    <input type="file" class="form panimg" name="panimg"
                                                        accept=".jpg" />
                                                </div>
                                                <!-- <input type="file" class="form-control panimg form" accept=".jpg" style="height:50%;width:50%;margin-left:50px" name="panimg"> -->
                                            </div>
                                            <div class="col-lg-2 col-md-3 col-sm-4 col-xs-4 text-center pad"
                                                style="width:200px">
                                                <div class="upload-btn-wrapper">
                                                    <button class="sbtn">Upload Image</button>
                                                    <input type="file" class="form aadhaarimg" name="aadhaarimg"
                                                        accept=".jpg" />
                                                </div>
                                                <!-- <input type="file" class="form-control aadhaarimg form" accept=".jpg" style="height:50%;width:50%;margin-left:50px" name="aadhaarimg"> -->
                                            </div>
                                            <div class="col-lg-2 col-md-3 col-sm-4 col-xs-4 text-center pad"
                                                style="width:200px">
                                                <div class="upload-btn-wrapper">
                                                    <button class="sbtn">Upload Image</button>
                                                    <input type="file" class="form insuranc" name="insuranc"
                                                        accept=".jpg" />
                                                </div>
                                                <!-- <input type="file" class="form-control insuranc form" accept=".jpg" style="height:50%;width:50%;margin-left:50px" name="insuranc"> -->
                                            </div>
                                            <div class="col-lg-2 col-md-3 col-sm-4 col-xs-4 text-center pad"
                                                style="width:200px">
                                                <div class="upload-btn-wrapper">
                                                    <button class="sbtn">Upload Image</button>
                                                    <input type="file" class="form visaimg" name="visaimg"
                                                        accept=".jpg" />
                                                </div>
                                                <!-- <input type="file" class="form-control visaimg form" accept=".jpg" style="height:50%;width:50%;margin-left:50px" name="visaimg"> -->
                                            </div>
                                            <div class="col-lg-2 col-md-3 col-sm-4 col-xs-4 text-center pad"
                                                style="width:200px">
                                                <div class="upload-btn-wrapper">
                                                    <button class="sbtn">Upload Image</button>
                                                    <input type="file" class="form healthimg" name="healthimg"
                                                        accept=".jpg" />
                                                </div>
                                                <!-- <input type="file" class="form-control healthimg form" accept=".jpg" style="height:50%;width:50%;margin-left:50px" name="healthimg"> -->
                                            </div>
                                        </div>
                                        <div class="row" style="margin-left:30px">
                                            <div class="col-lg-2 col-md-3 col-sm-4 col-xs-4 text-center pad pop"
                                                style="width:200px">
                                                <img src="<?= $get['ppfront'] . "?f=" . mt_rand(); ?>"
                                                    alt="ppfront image" class="skimg view1 "
                                                    style="width:150px;height:150px;">
                                            </div>
                                            <div class="col-lg-2 col-md-3 col-sm-4 col-xs-4 text-center pad pop"
                                                style="width:200px">
                                                <img src="<?= $get['ppback'] . "?b=" . mt_rand(); ?>" alt="ppback image"
                                                    class="skimg view2 " style="width:150px;height:150px;">
                                            </div>
                                            <div class="col-lg-2 col-md-3 col-sm-4 col-xs-4 text-center pad pop"
                                                style="width:200px">
                                                <img src="<?= $get['panimg'] . "?p=" . mt_rand(); ?>"
                                                    alt="pancard image" class="skimg view3"
                                                    style="width:150px;height:150px;">
                                            </div>
                                            <div class="col-lg-2 col-md-3 col-sm-4 col-xs-4 text-center pad pop"
                                                style="width:200px">
                                                <img src="<?= $get['aadhaarimg'] . "?d=" . mt_rand(); ?>"
                                                    alt="aadhaarcard image" class="skimg view4"
                                                    style="width:150px;height:150px;">
                                            </div>
                                            <div class="col-lg-2 col-md-3 col-sm-4 col-xs-4 text-center pad pop"
                                                style="width:200px">
                                                <img src="<?= $get['insuranc'] . "?i=" . mt_rand(); ?>"
                                                    alt="insurance image" class="skimg view5 "
                                                    style="width:150px;height:150px;">
                                            </div>
                                            <div class="col-lg-2 col-md-3 col-sm-4 col-xs-4 text-center pad pop"
                                                style="width:200px">
                                                <img src="<?= $get['visaimg'] . "?v=" . mt_rand(); ?>" alt="visa image"
                                                    class="skimg view6 " style="width:150px;height:150px;">
                                            </div>
                                            <div class="col-lg-2 col-md-3 col-sm-4 col-xs-4 text-center pad pop"
                                                style="width:200px">
                                                <img src="<?= $get['healthimg'] . "?h=" . mt_rand(); ?>"
                                                    alt="health image" class="skimg view7 "
                                                    style="width:150px;height:150px;">
                                            </div>
                                        </div>
                                    </div>
                                </div><!-- /.tab_2 -->

                                <div class="tab-pane" id="tab_2">
                                    <div class="panel panel-default">
                                        <div class="row">
                                            <div class="col-lg-1 col-md-3 col-sm-3 col-xs-3 text-right pad">
                                                <label class="label-control marg">Mofa No.</label>
                                            </div>
                                            <div class="col-lg-2 col-md-8 col-sm-8 col-xs-8 pad">
                                                <input type="text" class="form-control mofano form" name="mofano"
                                                    value="<?php echo ($addflag != 1) ? $get["mofano"] : ""; ?>">
                                            </div>
                                            <div class="col-lg-1 col-md-3 col-sm-3 col-xs-3 text-right pad">
                                                <label class="label-control marg">Name Of Bank</label>
                                            </div>
                                            <div class="col-lg-2 col-md-3 col-sm-3 col-xs-3 pad">
                                                <input type="text" class="form-control bankname form" name="bankname"
                                                    value="<?php echo ($addflag != 1) ? $get["bankname"] : ""; ?>">
                                            </div>
                                            <div class="col-lg-1 col-md-3 col-sm-3 col-xs-3 text-right pad">
                                                <label class="label-control marg">Type Of Tour</label>
                                            </div>
                                            <div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 pad">
                                                <input type="text" class="form-control tourtype form" name="tourtype"
                                                    value="<?php echo ($addflag != 1) ? $get["tourtype"] : ""; ?>">
                                            </div>
                                            <div class="col-lg-1 col-md-3 col-sm-3 col-xs-3 text-right pad">
                                                <label class="label-control marg">Room No.</label>
                                            </div>
                                            <div class="col-lg-2 col-md-8 col-sm-8 col-xs-8 pad">
                                                <input type="text" class="form-control roomno form " name="roomno"
                                                    value="<?php echo ($addflag != 1) ? $get["roomno"] : ""; ?>">
                                            </div>
                                        </div>
                                    </div>
                                </div><!-- /.tab_2 -->

                                <div class="tab-pane" id="tab_3">

                                    <div class="panel panel-default">

                                        <div class="row">

                                            <div class="panel-body">
                                                <div class='' align="center">
                                                    <div class="row">
                                                        <div class="col-lg-1 col-md-3 col-sm-3 col-xs-3 text-right pad">
                                                            <label class="label-control marg">Qurbani Name</label>
                                                        </div>
                                                        <div class="col-lg-3 col-md-8 col-sm-8 col-xs-8 pad">
                                                            <input type="text" class="form-control form qurname"
                                                                name="qurname"
                                                                value="<?php echo ($addflag != 1) ? $get["qurname"] : ""; ?>">
                                                        </div>
                                                        <div class="col-lg-2 col-md-3 col-sm-3 col-xs-3 text-right pad">
                                                            <label class="label-control marg">Qurbani - Small</label>
                                                        </div>
                                                        <div class="col-lg-5 col-md-8 col-sm-8 col-xs-8 pad">
                                                            <table class="table table-bordered">

                                                                <tr>
                                                                    <td>
                                                                        Haj
                                                                        <input type="checkbox"
                                                                            class="form-check-input haj_q" name="haj_q"
                                                                            value="1" <?= ($get['haj_q'] == "1") ? "checked" : "" ?>>
                                                                    </td>

                                                                    <td>
                                                                        Dum
                                                                        <input type="checkbox"
                                                                            class="form-check-input dum_q" name="dum_q"
                                                                            value="1" <?= ($get['dum_q'] == "1") ? "checked" : "" ?>>
                                                                    </td>

                                                                    <td>
                                                                        Other
                                                                        <input type="checkbox"
                                                                            class="form-check-input oth_q" name="oth_q"
                                                                            value="1" <?= ($get['oth_q'] == "1") ? "checked" : "" ?>>
                                                                    </td>
                                                                </tr>
                                                            </table>
                                                        </div>
                                                    </div>

                                                    <div class="row">
                                                        <div class="col-lg-1 col-md-3 col-sm-3 col-xs-3 text-right pad">
                                                            <label class="label-control marg">Caste</label>
                                                        </div>
                                                        <div class="col-lg-3 col-md-8 col-sm-8 col-xs-8 pad">
                                                            <input type="text" class="form-control form caste"
                                                                name="caste"
                                                                value="<?php echo ($addflag != 1) ? $get["caste"] : ""; ?>">
                                                        </div>
                                                        <div class="col-lg-2 col-md-3 col-sm-3 col-xs-3 text-right pad">
                                                            <label class="label-control marg">Qurbani - Big</label>
                                                        </div>
                                                        <div class="col-lg-5 col-md-8 col-sm-8 col-xs-8 pad">
                                                            <table class="table table-bordered">
                                                                <tr>
                                                                    <td>
                                                                        Haj
                                                                        <input type="checkbox"
                                                                            class="form-check-input haj_b" name="haj_b"
                                                                            value="1" <?= ($get['haj_b'] == "1") ? "checked" : "" ?>>
                                                                    </td>

                                                                    <td>
                                                                        Dum
                                                                        <input type="checkbox"
                                                                            class="form-check-input dum_b" name="dum_b"
                                                                            value="1" <?= ($get['dum_b'] == "1") ? "checked" : "" ?>>
                                                                    </td>

                                                                    <td>
                                                                        Other
                                                                        <input type="checkbox"
                                                                            class="form-check-input oth_b" name="oth_b"
                                                                            value="1" <?= ($get['oth_b'] == "1") ? "checked" : "" ?>>
                                                                    </td>
                                                                </tr>

                                                            </table>
                                                        </div>
                                                    </div>
                                                    <div class="row">
                                                        <div class="col-lg-1 col-md-3 col-sm-3 col-xs-3 text-right pad">
                                                            <label class="label-control marg">Community</label>
                                                        </div>
                                                        <div class="col-lg-3 col-md-8 col-sm-8 col-xs-8 pad">
                                                            <input type="text" class="form-control form community"
                                                                name="community"
                                                                value="<?php echo ($addflag != 1) ? $get["community"] : ""; ?>">
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
    </form>


    <div class="modal fade" id="imagemodal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
        aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-body" style="background-color: transparent;">
                    <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true"
                            style="font-size: 35px;">&times;</span><span class="sr-only">Close</span></button>
                    <img src="" class="imagepreview" style="width: 100%;">
                </div>
            </div>
        </div>
    </div>


    <div class="modal fade" id="passportOCRModal">

        <div class="modal-dialog modal-lg">

            <div class="modal-content">

                <div class="modal-header bg-primary text-white">

                    <button class="close" data-dismiss="modal">
                        &times;
                    </button>

                    <h4>
                        Passport OCR Result
                    </h4>

                </div>

                <div class="modal-body">

                    <table class="table table-bordered">

                        <tr>
                            <th width="35%">Passport Number</th>
                            <td id="ocrPassportNo"></td>
                        </tr>

                        <tr>
                            <th>Surname</th>
                            <td id="ocrSurname"></td>
                        </tr>

                        <tr>
                            <th>Given Name</th>
                            <td id="ocrGiven"></td>
                        </tr>

                        <tr>
                            <th>Nationality</th>
                            <td id="ocrNationality"></td>
                        </tr>

                        <tr>
                            <th>Date of Birth</th>
                            <td id="ocrBirth"></td>
                        </tr>

                        <tr>
                            <th>Date of Issue</th>
                            <td id="ocrIssue"></td>
                        </tr>

                        <tr>
                            <th>Date of Expiry</th>
                            <td id="ocrExpiry"></td>
                        </tr>

                        <tr>
                            <th>Place of Issue</th>
                            <td id="ocrIssuePlace"></td>
                        </tr>

                        <tr>
                            <th>Place of Birth</th>
                            <td id="ocrBirthPlace"></td>
                        </tr>

                        <tr>
                            <th>Gender</th>
                            <td id="ocrGender"></td>
                        </tr>

                    </table>

                </div>

                <div class="modal-footer">

                    <button type="button" class="btn btn-default" data-dismiss="modal">
                        Cancel
                    </button>

                    <button type="button" class="btn btn-success" id="fillOnly">
                        Fill Form
                    </button>

                </div>

            </div>

        </div>

    </div>


    <div class="modal fade bs-example-modal-lg searchModal" tabindex="-1" role="dialog"
        aria-labelledby="myLargeModalLabel">
        <div class="modal-dialog modal-lg">
            <div class="modal-content">
                <div class="modal-header">
                    <button class="close" data-dismiss="modal"><span>&times;</span></button>
                    <h4 class="modal-title" id="myLargeModalLabel">Search <? echo $formname; ?></h4>
                </div>
                <div class="modal-body">
                    <div class="row">
                        <div class="col-lg-2">
                            <select class="form-control sfield">
                                <option value="1">Pax No.</option>
                                <!-- <option value="2">Date</option> -->
                                <option value="3">Name</option>
                                <option value="4">SurName</option>
                                <option value="5">Regn No.</option>
                                <option value="6">Mofano</option>
                                <option value="7">DOB</option>
                                <option value="8">PAN No.</option>
                                <option value="9">Aadhaar No.</option>
                            </select>
                        </div>
                        <div class="col-lg-2">
                            <select class="form-control soperator">
                                <option value="">Type of Search</option>
                                <option value="%">Like</option>
                                <option value="=">Exactly</option>
                            </select>
                        </div>
                        <div class="col-lg-2">
                            <select class="form-control sortBy">
                                <option value="">Sort By</option>
                                <option value="1">Pax No.</option>
                                <!-- <option value="2">Date</option> -->
                                <option value="3">Name</option>
                                <option value="4">SurName</option>
                                <option value="5">Regn No.</option>
                                <option value="6">Mofa No.</option>
                                <option value="7">DOB</option>
                                <option value="8">PAN No.</option>
                                <option value="9">Aadhaar No.</option>
                            </select>
                        </div>
                        <div class="col-lg-2">
                            <select class="form-control orderAs">
                                <option value="desc">Desc</option>
                                <option value="asc">Asc</option>
                            </select>
                        </div>
                        <div class="col-lg-2">
                            <input type="text" value="" class="form-control ssearch" placeholder="Search Here">
                        </div>
                        <div class="col-lg-2">
                            <input type="button" class="btn btn-primary sload" value="Search">
                        </div>
                    </div>
                    <div class="col-lg-12 sloader text-center">
                    </div>
                    <div class="col-lg-12 snoRecord text-center">
                        <h3>NO RECORDS FOUND</h3>
                    </div>
                    <div class="table-responsive" style="max-height: 400px;overflow: auto;">
                        <table id="" class="table-striped table-condensed table-bordered" width="100%">
                            <thead>
                                <tr class="mySearchTr">
                                    <th style="width:8%">Pax No.</th>
                                    <!-- <th style="width:13%">Date</th> -->
                                    <th style="width:17%">Name</th>
                                    <th style="width:12%">SurName</th>
                                    <th style="width:7%">Regn #</th>
                                    <th style="width:9%">Mofa No.</th>
                                    <th style="width:8%">DOB</th>
                                    <th style="width:10%">PAN No.</th>
                                    <th style="width:12%">Aadhaar No.</th>
                                    <th style="width:4%">Action</th>
                                </tr>
                            </thead>
                            <tbody class="sTbody">
                            </tbody>
                        </table>
                    </div>
                    <div class="row">
                        <div class="col-xs-12 text-right search-action-bar">
                            <input type="button" class="btn btn-primary sprev" value="Previous">
                            <input type="button" class="btn btn-primary snext" value="Next">
                        </div>
                    </div>
                </div>
                <div class="modal-footer"></div>
            </div>
        </div>
    </div>
    <?php include("includes/linksfoot.php"); ?>
</body>

</html>