<?php

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

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

if ($_REQUEST["ctr"]) {
    $ctr = $_REQUEST["ctr"];
    $hide = $_REQUEST["hide"];
    $addflg = $_REQUEST["addflg"];
    $hide_var = "";
    if ($hide == 0) {
        $hide_var = 'style="display:none;"';
    }
    $mctr = $ctr;
    $mctr++;

    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='$mctr'>";
    Echo "</td>";
    Echo "<td>";
    Echo "<input type='text' name='paxname[]' class='paxname form-control  form' value='' >";
    Echo "</td>";
    Echo "<td>";
    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>";
    Echo "</td>";
    Echo "<td>";
    Echo "<input type='text' name='passport[]'  class='passport form-control  form' value='' >";
    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>";
    if ($addflg != 1) {

        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]'  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><a href='visaapp_pdf.php?vouchno=$get[vouchno]&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?vouchno=$get[vouchno]&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?vouchno=$get[vouchno]&passport=$row[passport]'  target='_blank'><i class='fa fa-clipboard'  style='font-size:28px'></i></a></td>";
//        Echo "<td><a href='#'  class='imgshow'><i class='fa fa-picture-o'  style='font-size:28px'></i></a></td>";
    }
    Echo "<td><input type='date' name='dob[]' class='doe form-control  form'  value='' style='width:120px;'></td>";
    Echo "<td><input type='text' name='religion[]' class='religion form-control  form'  value='Muslim' ></td>";
    Echo "<td>";
    Echo "<input type='text' name='plbirth[]' class='plbirth form-control  form' value='' >";
    Echo "</td>";
    Echo "<td>";
    Echo "<input type='text' name='issplace[]' class='issplace form-control  form' value=''>";
    Echo "</td>";
    Echo "<td><input type='text' name='periodstay[]' class='periodstay form-control  form'  value=''></td>";
    Echo "<td><input type='date' name='issdate[]' class='issdate form-control  form'  value=''  style='width:120px;'></td>";
    Echo "<td><input type='date' name='doe[]' class='doe form-control  form'  value=''  style='width:120px;'></td>";
    Echo "<td><input type='date' name='stampdate[]' class='stampdate form-control  form'  value=''  style='width:120px;'></td>";
//    Echo "<td><input type='text' name='carrier[]' class='carrier form-control  form' value='' ></td>";
//    Echo "<td><input type='text' name='fltno[]' class='fltno form-control  form' value='' ></td>";
//    Echo "<td><input type='date' name='fltdate[]' class='fltdate form-control  form'  value=''  style='width:120px;'></td>";
//    Echo "<td><input type='text' name='flttime[]' class='flttime form-control  form' value='' ></td>";
//    Echo "<td><input type='text' name='pnrno[]' class='pnrno form-control  form' value='' ></td>";
    Echo "<td><input type='text' name='mofano[]' class='mofano form-control  form' value='' ></td>";
    Echo "<td><input type='text' name='mofano2[]' class='mofano2 form-control  form' value='' ></td>";
    Echo "<td>";
    echo "<input list='category' name='category[]' class='size form-control form ' autocomplete='off'> ";
    echo "<datalist id='category' char='#'>";
    echo"<option value=''></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='' ></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><img class='preview'  style='height:98px;width:98px;display:inline' src='$row[imagepath]?a=" . mt_rand() . "' alt='your image'></td>";
//                                                Echo "<td><img class='preview'  style='height:98px;width:98px;display:inline' src='$row[imagepath]?a=" . mt_rand() . "' alt='your image'></td>";
    Echo "</tr>";
    $ctr++;
} else {
    echo "ERROR";
}
?>
 