<?php
ob_start();
require("includes/check_auth_user.php");
require("includes/dbconnect.php");
include('includes/function.php');
header("Content-Type: text/html;charset=UTF-8");

//mysqli_query($conn, "SET NAMES 'utf8'");
//mysqli_query($conn, 'SET CHARACTER SET utf8');

$formname = 'Entry';
$maindb = 'visamain';
$trandb = 'visatran';
$trandb2 = "category";
$file = 'entry.php';
$printfile = "register_sc.php";
$trandbexist = 1;

$grid = '';
$keyfld = "myvouch";
$focusfield = "visatype";
$mgrpcode = '';
$keycond = "";
$myyear = $_SESSION["tit_" . $dbname];

$admin = $_SESSION["admin_" . $dbname];
$zdb = $_SESSION["zdbyear_" . $dbname];
$username = $_SESSION["username_" . $dbname];
$zroot = $_SESSION["zdir"];
$modet = $_GET["mode"];
mysqli_select_db($conn, $zdb);
include("includes/vouchno_generate.php");
include("includes/prev&next.php");
if (isset($_POST["submit"])) {
    $a = 1;


    $visatype = $_POST["visatype"];
    $voucher = $_POST["voucher"];
    $vouchdt = $_POST["vouchdt"];
    $manualno = $_POST["manualno"];
    $partyname = $_POST["partyname"];
    $sponsor = mysqli_real_escape_string($conn, $_POST["sponsor"]);
    $broker = $_POST["broker"];
    $email = $_POST["email"];
    $oadd1 = $_POST["oadd1"];
    $oadd2 = $_POST["oadd2"];
    $oadd3 = $_POST["oadd3"];
    $ladd1 = $_POST["ladd1"];
    $ladd2 = $_POST["ladd2"];
    $ladd3 = $_POST["ladd3"];
    $contact = $_POST["contact"];
    $visano = $_POST["visano"];
    $hijridate = $_POST["hijridate"];
    $sector = $_POST["sector"];
    $visaqty = $_POST["visaqty"];
    $mobile = $_POST["mobile"];
    $drname = $_POST["drname"];
    $meddate = $_POST["meddate"];
    $idno = $_POST["idno"];
    $remark = $_POST["remark"];
    $remark2 = $_POST["remark2"];
    $paidby = $_POST["paidby"];
    $createby = $_POST["createby"];
    $mis = $_POST["mis"];
    $misc = $_POST["misc"];
    $imig = $_POST["imig"];
    $stamp = $_POST["stamp"];
    $total = $_POST["total"];
    $disc = $_POST["disc"];
    $tot = $_POST["tot"];
    $mofa = $_POST["mofa"];

    $purpvisit = $_POST["purpvisit"];
    $inditot = $_POST["inditot"];
    $count = $_POST["items"];
    $count2 = $_POST["items2"];

    $mvouch = $qvouch;

    if ($a == 1) {
        mysqli_query($conn, "LOCK TABLES `$maindb` WRITE, `$trandb` WRITE, `$trandb2` WRITE");

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

            $gevo = mysqli_query($conn, "SELECT MAX(vouchno) AS maxcode FROM `visamain` where `visatype` = '$visatype' LIMIT 0,1 ") or die(mysqli_error($conn));

            if (mysqli_num_rows($gevo) > 0) {
                $vvoucher = mysqli_fetch_assoc($gevo);
                $qvoucher = $vvoucher["maxcode"] + 1;
            } else {
                $qvoucher = '1';
            }
            $voucher = $qvoucher;
        }

        //        browse($mvouch);
        //        browse($voucher);
        ########################################Image Part Start########################################

        $path = "images/" . $myyear . "/";

        $fileName = $qvouch . ".jpg";
        $img_file1 = $path . ($fileName);

        $image_ftype = pathinfo($img_file1, PATHINFO_EXTENSION);
        $size = $_FILES['image']['size'];

        if ($size < 20000) {
            move_uploaded_file($_FILES["image"]["tmp_name"], $img_file1);
        } else {
            browse("Image size Should be less then 20kb try again upload image");
            header("refresh: 1; $file?mode=last");
        }



        ########################################Image Part End  ########################################

        mysqli_query($conn, "Delete from `$trandb` where `myvouch`='$mvouch'") or die(mysqli_error($conn));
        //        mysqli_query($conn, "Delete from `$trandb` where `myvouch`='$mvouch' AND visatype = '$visatype'") or die(mysqli_error($conn));
        $cnt = 0;
        //        browse($count) ;

        for ($i = 0; $i <= $count; $i++) {
            $cnt++;
            $srno = $_POST["srno"][$i];
            $paxname = $_POST["paxname"][$i];
            $ppno = $_POST["passport"][$i];
            $passport = trim($ppno);
            $issplace = $_POST["issplace"][$i];
            $issdate = $_POST["issdate"][$i];
            $stampdate = $_POST["stampdate"][$i];
            $submission_date = $_POST["submission_date"][$i];
            $carrier = $_POST["carrier"][$i];
            $fltno = $_POST["fltno"][$i];
            $fltdate = $_POST["fltdate"][$i];
            $flttime = $_POST["flttime"][$i];
            $pnrno = $_POST["pnrno"][$i];
            $mofano = $_POST["mofano"][$i];
            $mofano2 = $_POST["mofano2"][$i];
            $category = $_POST["category"][$i];
            $memcash = $_POST["memcash"][$i];
            //            $category = mysqli_real_escape_string($conn, $_POST["category"]);
            $tfile = $_POST["tfile"][$i];
            $plbirth = $_POST["plbirth"][$i];
            $sex = $_POST["sex"][$i];
            $dob = $_POST["dob"][$i];
            $religion = $_POST["religion"][$i];
            $doe = $_POST["doe"][$i];
            $periodstay = $_POST["periodstay"][$i];
            $delvstatus = $_POST["delvstatus"][$i];
            //            browse($category);
            $dir = "images/" . $myyear . "/" . $mvouch;
            if (is_dir($dir) === false) {
                mkdir($dir);
            }
            $tpath = $dir . "/";

            $tfileNameU = $mvouch . "_" . $cnt . "_user.jpg";
            $tfileNameP = $mvouch . "_" . $cnt . "_pass.jpg";
            $tfileNameV = $mvouch . "_" . $cnt . "_visa.jpg";
            $tfileNameF = $mvouch . "_" . $cnt . "_visa.pdf";

            $timg_fileU = $tpath . ($tfileNameU);
            $timg_fileP = $tpath . ($tfileNameP);
            $timg_fileV = $tpath . ($tfileNameV);
            $timg_fileF = $tpath . ($tfileNameF);



            $tfileTmpLoc = $_FILES["tfile"]["tmp_name"][$i]; // File in the PHP tmp folder
            $tfileType = $_FILES["tfile"]["type"][$i]; // The type of file it is
            $tfileSize = $_FILES["tfile"]["size"][$i]; // File size in bytes
            $tfileErrorMsg = $_FILES["tfile"]["error"][$i]; // 0 for false... and 1 for true
            if ($tfileSize < 20000) {
                move_uploaded_file($_FILES["tfile"]["tmp_name"][$i], $timg_fileU);
            } else {
                browse("Image size Should be less then 20kb try again upload image");
                header("refresh: 1; $file?mode=last");
            }

            // if (!empty($tfileTmpLoc)) {
            //     move_uploaded_file($tfileTmpLoc, "$timg_fileU");
            // }

            $tfileTmpLoc2 = $_FILES["tfile2"]["tmp_name"][$i]; // File in the PHP tmp folder
            $tfileType2 = $_FILES["tfile2"]["type"][$i]; // The type of file it is
            $tfileSize2 = $_FILES["tfile2"]["size"][$i]; // File size in bytes
            $tfileErrorMsg2 = $_FILES["tfile2"]["error"][$i]; // 0 for false... and 1 for true

            if ($tfileSize2 < 20000) {
                move_uploaded_file($_FILES["tfile2"]["tmp_name"][$i], $timg_fileP);
            } else {
                browse("Image size Should be less then 20kb try again upload image");
                header("refresh: 1; $file?mode=last");
            }
            // if (!empty($tfileTmpLoc2)) {
            //     move_uploaded_file($tfileTmpLoc2, "$timg_fileP");
            // }

            $tfileTmpLoc3 = $_FILES["tfile3"]["tmp_name"][$i]; // File in the PHP tmp folder
            $tfileType3 = $_FILES["tfile3"]["type"][$i]; // The type of file it is
            $tfileSize3 = $_FILES["tfile3"]["size"][$i]; // File size in bytes
            $tfileErrorMsg3 = $_FILES["tfile3"]["error"][$i]; // 0 for false... and 1 for true
            if ($tfileSize3 < 20000) {
                move_uploaded_file($_FILES["tfile3"]["tmp_name"][$i], $timg_fileV);
            } else {
                browse("Image size Should be less then 20kb try again upload image");
                header("refresh: 1; $file?mode=last");
            }

            // if (!empty($tfileTmpLoc3)) {
            //     move_uploaded_file($tfileTmpLoc3, "$timg_fileV");
            // }

            $tfileTmpLoc4 = $_FILES["tfile4"]["tmp_name"][$i]; // File in the PHP tmp folder
            $tfileType4 = $_FILES["tfile4"]["type"][$i]; // The type of file it is
            $tfileSize4 = $_FILES["tfile4"]["size"][$i]; // File size in bytes
            $tfileErrorMsg4 = $_FILES["tfile4"]["error"][$i]; // 0 for false... and 1 for true

            if ($tfileSize4 < 20000) {
                move_uploaded_file($_FILES["tfile4"]["tmp_name"][$i], $timg_fileF);
            } else {
                browse("Image size Should be less then 20kb try again upload image");
                header("refresh: 1; $file?mode=last");
            }
            // if (!empty($tfileTmpLoc4)) {
            //     move_uploaded_file($tfileTmpLoc4, "$timg_fileF");
            // }

            if (!empty($paxname)) {

                mysqli_query($conn, "INSERT INTO `visatran`(`myvouch`, `yearno`, `visatype`, `vouchno`, `vouchdt`, `srno`, `paxname`, `passport`,
                                                `issdate`, `issplace`, `carrier`, `fltno`, `fltdate`, `flttime`, `pnrno`,`doe`,`dob`,`religion`,`plbirth`,`sex`,periodstay,
                                                `stampdate`, `mofano`,`mofano2`,`category` ,  `memcash` ,`imagepath`,`imagevisa`, `imagepass`, `visapdf`, `delvstatus`, `submission_date`)
                                        VALUES ('$mvouch','$myyear','$visatype','$voucher','$vouchdt','$cnt','$paxname','$passport',
                                                '$issdate','$issplace','$carrier','$fltno','$fltdate','$flttime','$pnrno','$doe','$dob','$religion','$plbirth','$sex','$periodstay',
                                                '$stampdate','$mofano','$mofano2',N'$category', '$memcash' , '$timg_fileU', '$timg_fileV','$timg_fileP', '$timg_fileF', '$delvstatus', '$submission_date')") or die(mysqli_error($conn));
            }
        }

        mysqli_query($conn, "Delete from `$trandb2` where `myvouch`='$mvouch' AND visatype = '$visatype'") or die(mysqli_error($conn));
        $cnt2 = 0;
        for ($j = 0; $j <= $count2; $j++) {
            $cnt2++;
            $srno2 = $_POST["srno2"][$j];
            $type = $_POST["type"][$j];
            $noqty = $_POST["noqty"][$j];

            if (!empty($type)) {
                mysqli_query($conn, "INSERT INTO `category`(`myvouch`, `yearno`, `visatype`, `vouchno`, `srno`,
                                                `descrip`, `noqty`)
                                        VALUES ('$mvouch','$myyear','$visatype','$voucher','$cnt2',N'$type','$noqty')") or die(mysqli_error($conn));
            }
        }

        if ($addflag == 1) {

            mysqli_query($conn, "INSERT INTO `$maindb`(`yearno`, `visatype`, `myvouch`, `vouchno`, `vouchdt`, `partyname`, `sponsor`,
                                               `oadd1`, `oadd2`, `oadd3`, `ladd1`, `ladd2`, `ladd3`, `visano`, `hijridate`, purpvisit,
                                               `visaqty`, `drname`, `meddate`, `sector`, `remark`,`remark2`, `reqmed`, `mobile`,
                                               `email`, `broker`, `idno`, `paidby`,`createby`, `contact`, `manualno`, `imagepath`,`imig`,`stamp`,
                                               `mis`,`mofa`,`misc`,`total`,`disc`,`tot`, `inditot`)
                                               VALUES ('$myyear','$visatype','$qvouch','$voucher','$vouchdt','$partyname',N'$sponsor',
                                                      N'$oadd1',N'$oadd2',N'$oadd3',N'$ladd1',N'$ladd2',N'$ladd3','$visano','$hijridate','$purpvisit',
                                                       '$visaqty','$drname','$meddate','$sector','$remark','$remark2','$reqmed','$mobile',
                                                       '$email',N'$broker','$idno','$paidby','$createby','$contact','$manualno','$img_file','$imig','$stamp',
                                                       '$mis','$mofa','$misc','$total','$disc','$tot', '$inditot')") or die(mysqli_error($conn));

            insmess();
            $mvouch = $qvouch;
            header("refresh: 1; $file?$keyfld=$mvouch&mode=edit");
        } else {

            mysqli_query($conn, "UPDATE `$maindb` SET  `vouchdt`='$vouchdt', `partyname`='$partyname',purpvisit='$purpvisit',
                                                       `sponsor`=N'$sponsor', `oadd1`=N'$oadd1', `oadd2`=N'$oadd2', `oadd3`=N'$oadd3', `ladd1`=N'$ladd1',
                                                       `ladd2`=N'$ladd2', `ladd3`=N'$ladd3', `visano`='$visano', `hijridate`='$hijridate', 
                                                       `visaqty`='$visaqty', `drname`='$drname', `meddate`='$meddate', `sector`='$sector', `remark`='$remark',
                                                       `remark2`='$remark2', `reqmed`='$reqmed', `mobile`='$mobile', `email`='$email', `broker`=N'$broker', `idno`='$idno',
                                                       `paidby`='$paidby', `contact`='$contact', `manualno`='$manualno', `imig`='$imig',`stamp`='$stamp',`mis`='$mis',`createby`='$createby',
                                                       `mofa`='$mofa',`misc`='$misc',`total`='$total',`disc`='$disc',`tot`='$tot',`inditot`='$inditot'  where `myvouch` = '$mvouch' ") or die(mysqli_error($conn));

            //            updmess(); 
            //            header("refresh: 1; $file?$keyfld=$mvouch&mode=edit");
        }
    }
    mysqli_query($conn, "UNLOCK TABLES");
}


if ($addflag != 1) {

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

    mysqli_query($conn, "SET NAMES 'utf8'");
    mysqli_query($conn, 'SET CHARACTER SET utf8');
    $result = mysqli_query($conn, "SELECT *, date_format(`vouchdt`,'%d-%m-%Y') as mydt FROM `$maindb` WHERE $keyfld='$getvouch'") or die(mysqli_error($conn));
    $get = mysqli_fetch_array($result);
    if ($get['visatype'] == 'W') {
        $vtype = "Work";
    } elseif ($get['visatype'] == 'F') {
        $vtype = "Family";
    } elseif ($get['visatype'] == 'R') {
        $vtype = "Residence";
    } elseif ($get['visatype'] == 'V') {
        $vtype = "Visit";
    } else {
        $vtype = "";
    }
}


if (isset($_GET["delete"])) {
    $path = "images/" . $myyear . "/";
    $path2 = "images/" . $myyear . "/" . $_GET[$keyfld];

    $tqry = mysqli_query($conn, "SELECT * FROM `$trandb` WHERE `myvouch`='$_GET[$keyfld]' ORDER BY srno") or die(mysqli_error($conn));
    while ($nrow = mysqli_fetch_array($tqry)) {
        $imgpath = $nrow['imagepath'];
        unlink($imgpath);
    }

    delete($zdb, "$maindb", "$keyfld", $_GET[$keyfld], "$file?mode=last");
    delete($zdb, "$trandb", "$keyfld", $_GET[$keyfld], "$file?mode=last");
    delete($zdb, "$trandb2", "$keyfld", $_GET[$keyfld], "$file?mode=last");
    unlink($path . $_GET[$keyfld] . ".jpg");
    rmdir($path2);
}

include("includes/linkshead.php");
?>
<script src="MyScript/entry.js" type="text/javascript"></script>
<script src="MyScript/entry_search.js" type="text/javascript"></script>
<style type="text/css">
    .stick{
        position: sticky;
        position: -webkit-sticky;
        top: 0;
        background: #5D96E4;
        z-index: 10;

    }
</style>
</head>

<body>
    <form action='' method='POST' enctype="multipart/form-data" accept-charset="utf-8">
        <!-- Default box -->
        <div class="row">
            <div class="col-lg-12">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <h3 class="panel-title">
                            <?php echo $formname; ?>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            <span style="color: #5D96E4;font-size: 11px">
                                (Alt+T &nbsp;&nbsp;-&nbsp;&nbsp; New Visa Type)</span>
                        </h3>
                    </div>
                    <div class="panel-body">
                        <div class="row">
                            <div class="col-lg-1 col-md-1 col-sm-1 col-xs-1 text-right pad ">
                                <label class="label-control marg visa" style="color: #5D96E4">Visa Type</label>
                            </div>
                            <div class="col-lg-1 col-md-1 col-sm-1 col-xs-1 pad ">
                                <select name="visatype" class=" form-control form focusfield visatype" required autofocus>
                                    <option value="<?php echo ($addflag != 1) ? $get["visatype"] : "W"; ?>"><?php echo ($addflag != 1) ? $vtype : "Work"; ?></option>
                                    <?php
                                    if ($addflag == 1) {
                                        ?>

                                        <!--<option value='W'>Work</option>-->
                                        <option value='F'>Family</option>
                                        <option value='R'>Residence</option>
                                        <option value='V'>Visit</option>
                                        <?php
                                    }
                                    ?>
                                </select>
                            </div>
                            <!--                            <div class="col-lg-1 col-md-1 col-sm-1 col-xs-1 text-right pad " >
                                                            <label class="label-control marg">Voucher No.</label>
                                                        </div>-->
                            <div class="col-lg-1 col-md-1 col-sm-1 col-xs-1 pad ">
                                <input type="hidden" class="form-control form addflag addflg" value="<?php echo ($addflag != 1) ? $addflag : $addflag; ?>">
                                <input type="hidden" class="form-control form myvouch" value="<?php echo ($addflag != 1) ? $qvouch : $qvouch; ?>">
                                <input type="text" class="form-control form voucher" name="voucher" value="<?php echo ($addflag != 1) ? $get["vouchno"] : ""; ?>" tabindex="-1" readonly>
                            </div>
                            <div class="col-lg-1 col-md-1 col-sm-1 col-xs-1 text-right pad " style="padding-left: 140px;">
                                <label class="label-control marg">Date</label>
                            </div>
                            <div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 pad" style="width:10.2%;padding-left: 35px;">
                                <input type="date" class="form-control form vouchdt" name="vouchdt" value="<?php echo ($addflag != 1) ? $get["vouchdt"] : date("Y-m-d"); ?>" required>
                            </div>
                            <div class="col-lg-1 col-md-1 col-sm-1 col-xs-1 text-right pad">
                                <label class="label-control marg" style="color: #5D96E4"> File No.</label>
                            </div>
                            <div class="col-lg-1 col-md-1 col-sm-1 col-xs-1 pad ">
                                <input type="text" class="form-control form manualno" id="manualno" name="manualno" value="<?php echo ($addflag != 1) ? $get["manualno"] : "AH-"; ?>" required style="color: #5D96E4;background-color: white;border: 1px solid #5D96E4">
                            </div>
                            <div class="col-lg-1 col-md-1 col-sm-1 col-xs-1 text-right pad ">
                                <label class="label-control marg">Agent</label>
                            </div>
                            <div class="col-lg-2 col-md-3 col-sm-3 col-xs-3 pad" style="width:24.66%">
                                <input type="text" class="form-control form broker" id="broker" name="broker" value="<?php echo ($addflag != 1) ? $get["broker"] : ""; ?>">
                            </div>
                            <div class="col-lg-1 col-md-1 col-sm-1 col-xs-1 pad" style="width:2.45%">
                                <button id='brksrch' type="button" class="btn btn-pad " data-toggle="modal" style="background-color:#5D96E4;color:white;padding-top:3px;padding-bottom:3px; ">
                                    <i class="fa fa-search"></i>
                                </button>
                            </div>
                            <!--                            <div class="col-lg-2 col-md-2 col-sm-1 col-xs-1 text-right pad ">
                                                            <label class="label-control marg">Candidate Name</label>
                                                        </div>
                                                        <div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 pad " style="width: 21%">
                                                            <input type="text" class="form-control form partyname" name="partyname" value="<?php echo ($addflag != 1) ? $get["partyname"] : ""; ?>" required>
                                                        </div>-->
                        </div>
                        <div class="row">
                            <div class="col-lg-1 col-md-1 col-sm-1 col-xs-1 text-right pad ">
                                <label class="label-control marg">Sponsor Name</label>
                            </div>
                            <div class="col-lg-2 col-md-3 col-sm-3 col-xs-3 pad" style="">
                                <input type="text" class="form-control form sponsor" name="sponsor" id="sponsor" value="<?php echo ($addflag != 1) ? $get["sponsor"] : ""; ?>">
                            </div>
                            <div class="col-lg-1 col-md-1 col-sm-1 col-xs-1 pad" style="width:2.45%">
                                <button id='spnname' type="button" class="btn btn-pad " data-toggle="modal" style="background-color:#5D96E4;color:white;padding-top:3px;padding-bottom:3px; ">
                                    <i class="fa fa-search"></i>
                                </button>
                            </div>
                            <div class="col-lg-1 col-md-1 col-sm-1 col-xs-1 text-right pad ">
                                <label class="label-control marg">Visa No.</label>
                            </div>
                            <div class="col-lg-1 col-md-1 col-sm-1 col-xs-1 pad">
                                <input type="text" class="form-control form visano" id="visano" name="visano" value="<?php echo ($addflag != 1) ? $get["visano"] : ""; ?>">
                            </div>
                            <div class="col-lg-1 col-md-1 col-sm-1 col-xs-1 text-right pad ">
                                <label class="label-control marg">ID No.</label>
                            </div>
                            <div class="col-lg-1 col-md-1 col-sm-1 col-xs-1 pad ">
                                <input type="text" class="form-control form idno" name="idno" value="<?php echo ($addflag != 1) ? $get["idno"] : ""; ?>">
                            </div>

                            <div class="col-lg-1 col-md-1 col-sm-1 col-xs-1 text-right pad ">
                                <label class="label-control marg">Email</label>
                            </div>
                            <div class="col-lg-2 col-md-3 col-sm-3 col-xs-3 pad" style="width:24.66%">

                                <input type="email" class="form-control form email" name="email" value="<?php echo ($addflag != 1) ? $get["email"] : ""; ?>">
                            </div>


                        </div>
                        <!--                        <div class="row">
                                                    <div class="col-lg-1 col-md-1 col-sm-1 col-xs-1 text-right pad ">
                                                        <label class="label-control marg">Overseas</label>
                                                    </div>
                                                    <div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 pad">
                                                        <input type="text" class="form-control form oadd1" name="oadd1" value="<?php echo ($addflag != 1) ? $get["oadd1"] : ""; ?>">
                                                        <input type="text" class="form-control form oadd2" name="oadd2" value="<?php echo ($addflag != 1) ? $get["oadd2"] : ""; ?>">
                                                        <input type="text" class="form-control form oadd3" name="oadd3" value="<?php echo ($addflag != 1) ? $get["oadd3"] : ""; ?>">
                                                    </div>
                                                    <div class="col-lg-1 col-md-1 col-sm-1 col-xs-1 text-right pad ">
                                                        <label class="label-control marg">Local</label>
                                                    </div>
                                                    <div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 pad" style="width:27.2%;" >
                                                        <input type="text" class="form-control form 1add1" name="ladd1" value="<?php echo ($addflag != 1) ? $get["ladd1"] : ""; ?>">
                                                        <input type="text" class="form-control form ladd2" name="ladd2" value="<?php echo ($addflag != 1) ? $get["ladd2"] : ""; ?>">
                                                        <input type="text" class="form-control form ladd3" name="ladd3" value="<?php echo ($addflag != 1) ? $get["ladd3"] : ""; ?>">
                                                    </div>
                                                    <div class="col-lg-1 col-md-1 col-sm-1 col-xs-1 text-right pad " >
                                                        <label class="label-control marg" style="color: #5D96E4">Contact No.</label>
                                                    </div>
                                                    <div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 pad" style="width: 21%">
                                                        <input type="text" class="form-control form contact" name="contact" value="<?php echo ($addflag != 1) ? $get["contact"] : ""; ?>" style="color: #5D96E4">
                                                    </div>
                                                    <div class="col-lg-1 col-md-1 col-sm-1 col-xs-1 text-right pad " >
                                                        <label class="label-control marg">Mobile No.</label>
                                                    </div>
                                                    <div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 pad" style="width: 21%">
                                                        <input type="text" class="form-control form mobile" name="mobile" value="<?php echo ($addflag != 1) ? $get["mobile"] : ""; ?>">
                                                    </div>
                                                </div>-->
                        <div class="row">
                            <div class="col-lg-1 col-md-3 col-sm-1 col-xs-1 text-right pad">
                                <label class="label-control marg">Place</label>
                            </div>
                            <div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 pad">
                                <select name="sector" class=" form-control form  sector" required>
                                    <option value="<?php echo ($addflag != 1) ? $get["sector"] : "MUMBAI"; ?>"><?php echo ($addflag != 1) ? $get["sector"] : "MUMBAI"; ?></option>
                                    <option value="MUMBAI">MUMBAI</option>
                                    <option value="New DELHI">NEW DELHI</option>

                                </select>
                            </div>
                            <div class="col-lg-1 col-md-1 col-sm-1 col-xs-1 pad" style="width:2.45%">
                                <!--                                <button id='spnname' type="button" class="btn btn-pad " data-toggle="modal"  style="background-color:#5D96E4;color:white;padding-top:3px;padding-bottom:3px; ">
                                                                    <i class="fa fa-search"></i>
                                                                </button>-->
                            </div>
                            <div class="col-lg-1 col-md-1 col-sm-1 col-xs-1 text-right pad  ">
                                <label class="label-control marg">Visa Qty.</label>
                            </div>
                            <div class="col-lg-1 col-md-2 col-sm-1 col-xs-1 pad">
                                <input type="text" class="form-control form visaqty" name="visaqty" value="<?php echo ($addflag != 1) ? $get["visaqty"] : ""; ?>">
                            </div>


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



                        </div>
                        <div class="row">
                            <div class="col-lg-1 col-md-1 col-sm-1 col-xs-1 text-right pad">
                                <label class="label-control marg">Paid By</label>
                            </div>
                            <div class="col-lg-2 col-md-1 col-sm-1 col-xs-1 pad">
                                <select id="paidby" name="paidby" class="select2 form-control form paidby">
                                    <option value=""></option>
                                    <option <?php
                                    if ($get['paidby'] == 'C') {
                                        echo "selected=selected";
                                    }
                                    ?> value='C'>Cash</option>
                                    <option <?php
                                    if ($get['paidby'] == 'R') {
                                        echo "selected=selected";
                                    }
                                    ?> value='R'>Credit</option>
                                    <option <?php
                                    if ($get['paidby'] == 'U') {
                                        echo "selected=selected";
                                    }
                                    ?> value='U'>UPI / RTGS</option>

                                </select>
                            </div>
                            <div class="col-lg-1 col-md-1 col-sm-1 col-xs-1 pad" style="width:2.45%">
                                <!--                                <button id='spnname' type="button" class="btn btn-pad " data-toggle="modal"  style="background-color:#5D96E4;color:white;padding-top:3px;padding-bottom:3px; ">
                                                                    <i class="fa fa-search"></i>
                                                                </button>-->
                            </div>
                            <div class="col-lg-1 col-md-1 col-sm-1 col-xs-1 text-right pad ">
                                <label class="label-control marg">File Created By</label>
                            </div>
                            <div class="col-lg-1 col-md-1 col-sm-1 col-xs-1 pad ">
                                <input type="text" class="form-control form createby" name="createby" value="<?php echo ($addflag != 1) ? $get["createby"] : ""; ?>">
                            </div>
                        </div>
                        <!--                        <div class="row">
                                                    <div class="col-lg-5 col-md-5 col-sm-5 col-xs-5 text-right pad ">
                                                    </div>
                                                    <div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 pad" style="width: 13.5%">
                                                        <button class="form form-control btn btn-primary category">Category</button>
                                                    </div>
                                                    <div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 pad" style="width: 13.5%">
                                                        <button class="form form-control btn btn-primary paxdetail">Pax Detail</button>
                                                    </div>
                                                </div>-->
                        <br>
                        <div class="pax_d">
                            <!--<div class="table-responsive" style="overflow-y: scroll;height:500px">-->
                            <div class="table-responsive" style="overflow-y: scroll;height:500px">
                                <table class="  table-striped table-condensed table-bordered" width="170%" >
                                    <thead class="mySearchTr stick">
                                        <tr>
                                            <th style="width: 1%;" class="stick"></th>
                                            <th style="width: 2%;" class="stick">Sr.</th>
                                            <th style="width: 15%;" class="stick">Pax Name</th>
                                            <th style="width: 2%;" class="stick">Sex</th>
                                            <th style="width: 4%;" class="stick">Passport</th>
                                            <th style="width: 2%;" class="stick">Immigration<br>Status</th>
                                            <?php
                                            if ($addflag != 1) {
                                                ?>
                                                <th style="width: 2%;" class="stick">Visa</th>
                                                <th style="width: 2%;" class="stick">UT</th>
                                                <th style="width: 2%;" class="stick">DL</th>
                                                <th style="width: 2%;" class="stick">Barcode</th>
                                                <th style="width: 2%;" class="stick">Image</th>
                                                <th style="width: 2%;" class="stick">PDF</th>

                                                <?php
                                            }
                                            ?>
                                            <th style="width: 2%;" class="stick">DOB</th>
                                            <th style="width: 5%;" class="stick">Religion</th>
                                            <th style="width: 5%;" class="stick">POB</th>
                                            <th style="width: 5%;" class="stick">POI</th>
                                            <th style="width: 5%;" class="stick">Stay<br> Period</th>
                                            <th style='width: 2%' class="stick">DOI</th>
                                            <th style='width: 2%' class="stick">DOE</th>
                                            <th style='width: 4%' class="stick">Stamp Date</th>
                                            <!--<th style='width: 5%'>Carrier</th>-->
                                            <!--<th style='width: 4%'>Flight No.</th>-->
                                            <!--<th style='width: 2%'>Flight Date</th>-->
                                            <!--<th style='width: 4%'>Flight Time</th>-->
                                            <th style='width: 5%'>Submission Date</th>
                                            <th style='width: 5%' class="stick">Mofa No.1</th>
                                            <th style='width: 5%' class="stick">Mofa No.2</th>
                                            <th style='width: 5%' class="stick">Category</th>
                                            <th style='width: 5%' class="stick">Amount</th>
                                            <th style='width: 2%' class="stick">User Photo</th>
                                            <th style='width: 2%' class="stick">Visa Upload</th>
                                            <th style='width: 2%' class="stick">Passport Upload</th>
                                            <th style='width: 2%' class="stick">Visa Pdf</th>

                                        </tr>
                                    </thead>
                                    <tbody class="tbody">
                                        <?php
                                        if ($addflag != 1) {
                                            $qry = mysqli_query($conn, "SELECT * FROM `$trandb` WHERE `myvouch`='$get[myvouch]' ORDER BY srno") or die(mysqli_error($conn));
                                            $ctr = 0;
                                            while ($row = mysqli_fetch_array($qry)) {

                                                if ($row['delvstatus'] == 'E') {
                                                    $dlvstatus = "ECR";
                                                } elseif ($row['delvstatus'] == 'N') {
                                                    $dlvstatus = "ECNR";
                                                } else {
                                                    $dlvstatus = "";
                                                }

                                                $visapdf = $row['visapdf'];
                                                //                                                browse($paxname);
                                                echo "<tr>";
                                                echo "<td><i class='fa fa-close remove'></i></td>";
                                                echo "<td>";
                                                echo "<input type='text' name='srno[]' class='srno form-control form' value='$row[srno]'>";
                                                echo "</td>";
                                                echo "<td>";
                                                echo "<input type='text' name='paxname[]' class='paxname form-control  form' value='$row[paxname]' >";
                                                echo "</td>";
                                                echo "<td>";
                                                echo "<select class='form-control form' name='sex[]' >";
                                                echo "<option value='$row[sex]'>$row[sex]</option>";
                                                echo "<option value='M'>M</option>";
                                                echo "<option value='F'>F</option>";
                                                echo "</select>";
                                                echo "</td>";
                                                echo "<td>";
                                                echo "<input type='text' name='passport[]'  class='passport form-control  form' value='$row[passport]' >";
                                                echo "</td>";
                                                echo "<td>";
                                                echo "<select class='form-control form' name='delvstatus[]' >";
                                                echo "<option value='$row[delvstatus]'>$dlvstatus</option>";
                                                echo "<option value='E'>ECR</option>";
                                                echo "<option value='N'>ECNR</option>";
                                                echo "</select>";
                                                echo "</td>";
                                                echo "<td><a href='visaapp_pdf.php?myvouch=$get[myvouch]&passport=$row[passport]' target='_blank'><i class='fa fa-cc-visa' style='font-size:28px'> </i></a></td>";
                                                echo "<td><a href='undertaking_pdf.php?myvouch=$get[myvouch]&passport=$row[passport]'  target='_blank'><i class='fa fa-file-text'  style='font-size:28px'></i></a></td>";
                                                echo "<td><a href='license_pdf.php?visano=$get[visano]&paxname=$row[paxname]'  target='_blank'><i class='fa fa-clipboard'  style='font-size:28px'></i></a></td>";
                                                echo "<td><a href='visa_barcode.php?visano=$get[visano]&mofano=$row[mofano]&mofano2=$row[mofano2]'  target='_blank'><i class='fa fa-barcode' style='font-size:35px'></i></a></td>";
                                                echo "<td><i class='fa fa-picture-o imgshow'  style='font-size:28px'></i></td>";
                                                // echo "<td><i class='fa fa-file-pdf-o pdfshow'  style='font-size:28px'></i></td>";
                                                echo "<td><a href='$visapdf' target='_blank'><i class='fa fa-file-pdf-o visapdf'  style='font-size:28px'></i></a></td>";
                                                echo "<td><input type='date' name='dob[]' class='dob form-control  form'  value='$row[dob]' style='width:120px;'></td>";
                                                echo "<td><input type='text' name='religion[]' class='religion form-control  form'  value='$row[religion]' ></td>";
                                                echo "<td>";
                                                echo "<input type='text' name='plbirth[]' class='plbirth form-control  form' value='$row[plbirth]' >";
                                                echo "</td>";
                                                echo "<td>";
                                                echo "<input type='text' name='issplace[]' class='issplace form-control  form' value='$row[issplace]'>";
                                                echo "</td>";
                                                echo "<td><input type='text' name='periodstay[]' class='periodstay form-control  form'  value='$row[periodstay]'></td>";
                                                echo "<td><input type='date' name='issdate[]' class='issdate form-control  form'  value='$row[issdate]'  style='width:120px;'></td>";
                                                echo "<td><input type='date' name='doe[]' class='doe form-control  form'  value='$row[doe]'  style='width:120px;'></td>";
                                                echo "<td><input type='date' name='stampdate[]' class='stampdate form-control  form'  value='$row[stampdate]'  style='width:120px;'></td>";
                                                echo "<td><input type='date' name='submission_date[]' class='submission_date form-control  form'  value='$row[submission_date]'  style='width:120px;'></td>";
                                                //                                                Echo "<td><input type='text' name='carrier[]' class='carrier form-control  form' value='$row[carrier]' ></td>";
                                                //                                                Echo "<td><input type='text' name='fltno[]' class='fltno form-control  form' value='$row[fltno]' ></td>";
                                                //                                                Echo "<td><input type='date' name='fltdate[]' class='fltdate form-control  form'  value='$row[fltdate]'  style='width:120px;'></td>";
                                                //                                                Echo "<td><input type='text' name='flttime[]' class='flttime form-control  form' value='$row[flttime]' ></td>";
                                                //                                                Echo "<td><input type='text' name='pnrno[]' class='pnrno form-control  form' value='$row[pnrno]' ></td>";
                                                echo "<td><input type='text' name='mofano[]' class='mofano form-control  form' value='$row[mofano]' ></td>";
                                                echo "<td><input type='text' name='mofano2[]' class='mofano2 form-control  form' value='$row[mofano2]' ></td>";
                                                echo "<td>";
                                                echo "<input list='category' name='category[]' class='size form-control form ' autocomplete='off' value='$row[category]'> ";
                                                echo "<datalist id='category' char='#'>";
                                                echo "<option >";

                                                $msize = mysqli_query($conn, "SELECT `category` FROM `visatran` group by category") or die(mysqli_error($conn));

                                                while ($tsize = mysqli_fetch_array($msize)) {
                                                    $sizename = $tsize['category'];
                                                    echo "<option value='$sizename'>";
                                                }
                                                echo "</datalist>";
                                                echo "</td>";
                                                echo "<td><input type='text' name='memcash[]' class='memcash form-control  form' value='$row[memcash]' ></td>";
                                                echo "<td>
                                                        <input type='file' name='tfile[]'  class='form btn btn-primary file' style='padding: 0px;margin: 0px;display:inline;width:93px'>
                                                      </td>";
                                                echo "<td>
                                                        <input type='file' name='tfile2[]'  class='form btn btn-primary file' style='padding: 0px;margin: 0px;display:inline;width:93px'>
                                                      </td>";
                                                echo "<td>
                                                        <input type='file' name='tfile3[]'  class='form btn btn-primary file' style='padding: 0px;margin: 0px;display:inline;width:93px'>
                                                      </td>";
                                                echo "<td>
                                                        <input type='file' name='tfile4[]'  class='form btn btn-primary file' style='padding: 0px;margin: 0px;display:inline;width:93px'>
                                                      </td>";
                                                echo "</tr>";
                                                $ctr++;
                                            }
                                        } else {
                                            ?>
                                            <tr>
                                                <td><i class='fa fa-close remove'></i></td>
                                                <td><input type='text' name='srno[]' class='srno form-control form' value='1'></td>
                                                <td>
                                                    <input type='text' name='paxname[]' class='paxname form-control  form' value=''>
                                                </td>
                                                <td>
                                                    <?php
                                                    echo "<select class='form-control form' name='sex[]' >";
                                                    echo "<option value=''></option>";
                                                    echo "<option value='M'>M</option>";
                                                    echo "<option value='F'>F</option>";
                                                    echo "</select>";
                                                    ?>
                                                </td>
                                                <td>
                                                    <input type='text' name='passport[]' class='passport form-control  form' value=''>
                                                </td>
                                                <td>
                                                    <?php
                                                    echo "<select class='form-control form' name='delvstatus[]' >";
                                                    echo "<option value=''></option>";
                                                    echo "<option value='E'>ECR</option>";
                                                    echo "<option value='N'>ECNR</option>";
                                                    echo "</select>";
                                                    ?>
                                                </td>

                                                <td><input type='date' name='dob[]' class='issdate form-control  form' value=''></td>
                                                <td><input type='text' name='religion[]' class='religion form-control  form' value='Muslim'></td>
                                                <td><input type='text' name='plbirth[]' class='issplace form-control  form' value=''></td>
                                                <td><input type='text' name='issplace[]' class='issplace form-control  form' value=''></td>
                                                <td><input type='text' name='periodstay[]' class='periodstay form-control  form' value=''></td>
                                                <td><input type='date' name='issdate[]' class='issdate form-control  form' value=''></td>
                                                <td><input type='date' name='doe[]' class='issdate form-control  form' value=''></td>
                                                <td><input type='date' name='stampdate[]' class='stampdate form-control  form' value=''></td>
                                                <td><input type='date' name='submission_date[]' class='submission_date form-control  form' value=''></td>
                                                <!--                                                <td><input type='text' name='carrier[]' class='carrier form-control  form' value='' ></td>
                                                <td><input type='text' name='fltno[]' class='fltno form-control  form' value='' ></td>
                                                <td><input type='date' name='fltdate[]' class='fltdate form-control  form'  value='' ></td>
                                                <td><input type='text' name='flttime[]' class='flttime form-control  form' value='' ></td>
                                                <td><input type='text' name='pnrno[]' class='pnrno form-control  form' value='' ></td>-->
                                                <td><input type='text' name='mofano[]' class='mofano form-control  form' value=''></td>
                                                <td><input type='text' name='mofano2[]' class='mofano2 form-control  form' value=''></td>
                                                <td>
                                                    <input list='category' name='category[]' value="" class='size form-control form ' autocomplete="off">
                                                    <datalist id='category' char="#">
                                                        <option value=''></option>
                                                        <?php
                                                        $msize = mysqli_query($conn, "SELECT `category` FROM `visatran` group by category ") or die(mysqli_error($conn));

                                                        while ($tsize = mysqli_fetch_array($msize)) {
                                                            $sizename = $tsize['category'];
                                                            echo "<option value='$sizename'>";
                                                        }
                                                        ?>
                                                    </datalist>
                                                </td>
                                                <td><input type='text' name='memcash[]' class='memcash form-control  form' value=''></td>
                                                <td><input type='file' name='tfile[]' class='form btn btn-primary file' style='padding: 0px;margin: 0px;display:inline;width:93px'>
                                                <td><input type='file' name='tfile2[]' class='form btn btn-primary file' style='padding: 0px;margin: 0px;display:inline;width:93px'>
                                                <td><input type='file' name='tfile3[]' class='form btn btn-primary file' style='padding: 0px;margin: 0px;display:inline;width:93px'>
                                                <td><input type='file' name='tfile4[]' class='form btn btn-primary file' style='padding: 0px;margin: 0px;display:inline;width:93px'>
                                                </td>
                                            </tr>
                                            <?php
                                        }
                                        ?>
                                    </tbody>
                                </table>
                            </div>
                            <div>
                                <button type='button' class='btn btn-success btn-square form' id='addnew'>
                                    <i class='fa fa-plus' style='color:#ffffff' data-toggle='tooltip' title='Add Row'></i>
                                </button>
                                <input type='hidden' name='items' id="items" class='items form-control  form' value='<?php echo ($addflag != 1) ? $ctr : 0; ?>'>
                            </div>
                        </div>
                        <div class=' cat_d' style="display: none">
                            <div class="table-responsive">
                                <table class="table-striped table-condensed table-bordered" width="40%">
                                    <thead class="mySearchTr">
                                        <tr>
                                            <th style="width: 2%;"></th>
                                            <th style="width: 3%;">Sr.</th>
                                            <th style="width: 20%;">Type</th>
                                            <th style="width: 10%;">Qty.</th>
                                        </tr>
                                    </thead>
                                    <tbody class="tbody2">
                                        <?php
                                        if ($addflag != 1) {
                                            $qry2 = mysqli_query($conn, "SELECT * FROM `$trandb2` WHERE `myvouch`='$get[myvouch]' ORDER BY srno") or die(mysqli_error($conn));
                                            $ctr2 = 0;
                                            while ($row2 = mysqli_fetch_array($qry2)) {
                                                echo "<tr>";
                                                echo "<td><i class='fa fa-close remove'></i></td>";
                                                echo "<td>";
                                                echo "<input type='text' name='srno2[]' class='srno2 form-control form' value='$row2[srno]'>";
                                                echo "</td>";
                                                echo "<td>";
                                                echo "<input type='text' name='type[]'  class='type form-control  form' value='$row2[descrip]' >";
                                                echo "</td>";
                                                echo "<td>";
                                                echo "<input type='text' name='noqty[]'  class='noqty form-control  form' value='$row2[noqty]' >";
                                                echo "</td>";
                                                echo "</tr>";
                                                $ctr2++;
                                            }
                                        } else {
                                            ?>
                                            <tr>
                                                <td><i class='fa fa-close remove'></i></td>
                                                <td><input type='text' name='srno2[]' class='srno2 form-control form' value='1'></td>
                                                <td>
                                                    <input type='text' name='type[]' class='type form-control  form' value=''>
                                                </td>
                                                <td>
                                                    <input type='text' name='noqty[]' class='noqty form-control  form' value=''>
                                                </td>
                                            </tr>
                                            <?php
                                        }
                                        ?>
                                    </tbody>
                                </table>
                            </div>
                            <div>
                                <button type='button' class='btn btn-success btn-square form' id='addnew2'>
                                    <i class='fa fa-plus' style='color:#ffffff' data-toggle='tooltip' title='Add Row'></i>
                                </button>
                                <input type='hidden' name='items2' id="items2" class='items2 form-control  form' value='<?php echo ($addflag != 1) ? $ctr2 : 0; ?>'>
                            </div>
                        </div>
                        <br>
                        <!--                        <div class="" style="text-align: center;background-color: #eacfd0;border:2px solid #5D96E4;height: 30px;padding-top: 5px">
                                                    <strong style="color: #5D96E4;font-size:21px">Medical Details</strong>
                                                </div>-->
                        <br>
                        <div style="">
                            <div class="col-lg-12 col-xs-12 pad">
                                <div class="col-lg-6 col-xs-12 pad">
                                    <!--                                <div class="col-lg-1 col-md-1 col-sm-1 col-xs-1 text-right pad ">
                                                                        <label class="label-control marg">Doctor Name</label>
                                                                    </div>
                                                                    <div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 pad">
                                                                        <input type="text" class="form-control form drname" name="drname" value="<?php echo ($addflag != 1) ? $get["drname"] : ""; ?>">
                                                                    </div>
                                                                    <div class="col-lg-1 col-md-1 col-sm-1 col-xs-1 text-right pad ">
                                                                        <label class="label-control marg">Date</label>
                                                                    </div>
                                                                    <div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 pad" style="width:10.55%;" >
                                                                        <input type="date" class="form-control form meddate" name="meddate"  value="<?php echo ($addflag != 1) ? $get["meddate"] : date("Y-m-d"); ?>">
                                                                    </div>-->
                                    <div class="col-lg-1 col-md-1 col-sm-1 col-xs-1 text-right pad ">
                                        <label class="label-control marg">Remarks</label>
                                    </div>
                                    <div class="col-lg-7 col-md-5 col-sm-3 col-xs-3 pad">
                                        <input type="text" class="form-control form remark" name="remark" value="<?php echo ($addflag != 1) ? $get["remark"] : ""; ?>">
                                        <input type="text" class="form-control form remark" name="remark2" value="<?php echo ($addflag != 1) ? $get["remark2"] : ""; ?>">
                                    </div>
                                </div>
                                <div class="col-lg-6 col-xs-12 pad">
                                    <div class="col-lg-12 col-xs-12 pad">
                                        <div class="col-lg-3 pad"></div>
                                        <div class="col-lg-3 pad"></div>
                                        <div class="col-lg-3 pad text-right">
                                            <label class="label-control marg">Individual Total</label>
                                        </div>
                                        <div class="col-lg-3 pad">
                                            <input type="number" step="any" name="inditot" class="form-control form text-right inditot inditot" value="<?php echo ($addflag != 1) ? $get['inditot'] : "0"; ?>">
                                        </div>
                                    </div>
                                    <div class="col-lg-12 col-xs-12 pad">
                                        <div class="col-lg-3 pad"></div>
                                        <div class="col-lg-3 pad"></div>
                                        <div class="col-lg-3 pad text-right">
                                            <label class="label-control marg">Mofa</label>
                                        </div>
                                        <div class="col-lg-3 pad">
                                            <input type="number" step="any" name="mofa" class="form-control form text-right tottotal mofa" value="<?php echo ($addflag != 1) ? $get['mofa'] : "0"; ?>">
                                        </div>
                                    </div>
                                    <div class="col-lg-12 col-xs-12 pad">
                                        <div class="col-lg-3 pad"></div>
                                        <div class="col-lg-3 pad"></div>
                                        <div class="col-lg-3 pad text-right">
                                            <label class="label-control marg">Stamping</label>
                                        </div>
                                        <div class="col-lg-3 pad">
                                            <input type="number" step="any" name="stamp" class="form-control form text-right totamt stamp" value="<?php echo ($addflag != 1) ? $get['stamp'] : "0"; ?>">
                                        </div>
                                    </div>
                                    <div class="col-lg-12 col-xs-12 pad">
                                        <div class="col-lg-3 pad"></div>
                                        <div class="col-lg-3 pad"></div>
                                        <div class="col-lg-3 pad text-right">
                                            <label class="label-control marg">Immigration</label>
                                        </div>
                                        <div class="col-lg-3 pad">
                                            <input type="number" step="any" name="imig" class="form-control form text-right totamt imig" value="<?php echo ($addflag != 1) ? $get['imig'] : "0"; ?>">
                                        </div>
                                    </div>
                                    <div class="col-lg-12 col-xs-12 pad">
                                        <div class="col-lg-3 pad"></div>
                                        <div class="col-lg-3 pad"></div>
                                        <div class="col-lg-3 pad text-right">
                                            <label class="label-control marg">M/s. </label>
                                        </div>
                                        <div class="col-lg-3 pad">
                                            <input type="number" step="any" name="mis" class="form-control form text-right totamt mis" value="<?php echo ($addflag != 1) ? $get['mis'] : "0"; ?>">
                                        </div>
                                    </div>



                                    <div class="col-lg-12 col-xs-12 pad">
                                        <div class="col-lg-3 pad"></div>
                                        <div class="col-lg-3 pad"></div>
                                        <div class="col-lg-3 pad text-right">
                                            <label class="label-control marg">Miscellaneous</label>
                                        </div>

                                        <div class="col-lg-3 pad">
                                            <input type="number" step="any" name="misc" class="form-control  text-right totadv form misc" value="<?php echo ($addflag != 1) ? $get['misc'] : "0"; ?>">
                                        </div>
                                    </div>
                                    <div class="col-lg-12 col-xs-12 pad">
                                        <div class="col-lg-3 pad"></div>
                                        <div class="col-lg-3 pad"></div>
                                        <div class="col-lg-3 pad text-right">
                                            <label class="label-control marg">Total</label>
                                        </div>
                                        <div class="col-lg-3 pad">
                                            <input type="number" step="any" name="total" required="true" class="form-control form text-right total" value="<?php echo ($addflag != 1) ? $get['total'] : "0"; ?>" readonly tabindex="-1">
                                        </div>
                                    </div>
                                    <div class="col-lg-12 col-xs-12 pad">
                                        <div class="col-lg-3 pad"></div>
                                        <div class="col-lg-3 pad"></div>
                                        <div class="col-lg-3 pad text-right">
                                            <label class="label-control marg">Discount</label>
                                        </div>
                                        <div class="col-lg-3 pad">
                                            <input type="number" step="any" name="disc" required="true" class="form-control form text-right disc" value="<?php echo ($addflag != 1) ? $get['disc'] : "0"; ?>">
                                        </div>
                                    </div>
                                    <div class="col-lg-12 col-xs-12 pad">
                                        <div class="col-lg-3 pad"></div>
                                        <div class="col-lg-3 pad"></div>
                                        <div class="col-lg-3 pad text-right">
                                            <label class="label-control marg">Final Amount</label>
                                        </div>
                                        <div class="col-lg-3 pad">
                                            <input type="number" step="any" name="tot" required="true" class="form-control form text-right tot" value="<?php echo ($addflag != 1) ? $get['tot'] : "0"; ?>" readonly tabindex="-1">
                                        </div>
                                    </div>

                                </div>

                            </div>
                        </div>
                        <br>
                        <!--                            <div class="row">
                                                        
                                                        <div class="col-lg-1 col-md-1 col-sm-1 col-xs-1 text-right pad ">
                                                            <label class="label-control marg">Required Medical</label>
                                                        </div>
                                                        <div class="col-lg-3 col-md-3 col-sm-3 col-xs-3 pad" style="width:27.2%;" >
                                                            <input type="text" class="form-control form reqmed" name="reqmed" value="<?php echo ($addflag != 1) ? $get["reqmed"] : ""; ?>">
                                                        </div>
                                                    </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">Choose File</label>
                                                    </div>
                                                    <div class="col-lg-1 col-md-2 col-sm-2 col-xs-2 pad">
                                                        <input type="file" name="file" id="file" class="form btn btn-primary" >
                                                    </div>
                                                    <div class="col-lg-2" style="float:right">
                                                        <img id="preview" style="height:130px" src="<?php echo ($addflag != 1) ? $get['imagepath'] . "?a=" . mt_rand() : "" ?>" alt="your image"/>
                                                    </div>
                                                </div>-->
                    </div>
                    <div class="panel-footer">
                        <? include("includes/buttons.php"); ?>
                    </div>
                </div>
            </div>
        </div>
    </form>
    <div class="modal fade" id="myModal" role="dialog">
        <div class="modal-dialog">

            <!-- Modal content-->
            <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 Sponsor's Name</h4>
                </div>
                <div class="modal-body">
                    <div class="table-responsive" style="max-height: 400px;overflow: auto;">
                        <div class="row">
                            <div class="col-lg-3">
                                <input type="text" id="sponsrch" class="form-control " placeholder="Search Here">
                            </div>
                        </div>
                        <table class='table table-condensed tabel-bordered'>
                            <thead>
                                <tr>
                                    <th>Name</th>
                                </tr>
                            </thead>
                            <tbody class="modalbody">
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="modal fade" id="myBroker" role="dialog">
        <div class="modal-dialog">

            <!-- Modal content-->
            <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 Broker's Name</h4>
                </div>
                <div class="modal-body">
                    <div class="table-responsive" style="max-height: 400px;overflow: auto;">
                        <div class="row">
                            <div class="col-lg-3">
                                <input type="text" id="broksrch" class="form-control " placeholder="Search Here">
                            </div>
                        </div>
                        <table class='table table-condensed tabel-bordered'>
                            <thead>
                                <tr>
                                    <th>Name</th>
                                </tr>
                            </thead>
                            <tbody class="brokbody">
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="modal fad VisaModal" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel">
        <div class="modal-dialog modal-md">
            <div class="modal-content">
                <div class="modal-header">
                    <button class="close" data-dismiss="modal"><span>&times;</span></button>
                    <h4 class="modal-title" id="myLargeModalLabel" style="color: #5D96E4">Visa Types</h4>
                </div>
                <div class="modal-body">
                    <table class="table-striped table-condensed table-bordered" width="40%">
                        <thead class="mySearchTr">
                            <tr>
                                <th style="width: 2%;"></th>
                                <th style="width: 10%;">Name</th>
                            </tr>
                        </thead>
                        <tbody class="tbody3">
                            <?php
                            $vtype = mysqli_query($conn, "SELECT * FROM `visatype`  ORDER BY name") or die(mysqli_error($conn));
                            $ctr3 = 0;
                            while ($fvtype = mysqli_fetch_array($vtype)) {
                                echo "<tr>";
                                echo "<td><i class='fa fa-close remove rdel' ></i></td>";
                                echo "<td>";
                                echo "<input type='text' name='tname' class='tname form-control form' value='$fvtype[name]' readonly maxlength='10'>";
                                echo "<input type='hidden' name='code' class='code form-control form' value='$fvtype[code]'>";
                                echo "</td>";
                                echo "</tr>";
                            }
                            ?>
                        </tbody>
                    </table>
                </div>
                <div class="modal-footer">
                    <input type='button' class="btn btn-primary newsave" value='save'>
                    <button type='button' class='btn btn-success btn-square form' id='addnew3'>
                        <i class='fa fa-plus' style='color:#ffffff' data-toggle='tooltip' title='Add Row'></i>
                    </button>
                </div>
            </div>
        </div>
    </div>
    <div class="modal fad imgModal" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel">
        <div class="modal-dialog modal-md">
            <div class="modal-content">
                <div class="modal-header">
                    <button class="close" data-dismiss="modal"><span>&times;</span></button>
                    <h4 class="modal-title" id="myLargeModalLabel" style="color: #5D96E4">Images</h4>
                </div>
                <div class="modal-body">
                    <table class="table-striped table-condensed table-bordered" width="100%">
                        <thead class="mySearchTr">
                            <tr>
                                <th style="width: 30%;">User</th>
                                <th style="width: 30%;">Passport</th>
                                <th style="width: 30%;">Visa</th>
                            </tr>
                        </thead>
                        <tbody class="tbody4">
                        </tbody>
                    </table>
                </div>

            </div>
        </div>
    </div>

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

</html>