<?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"];
    $hide_var = "";
    if ($hide == 0) {
        $hide_var = 'style="display:none;"';
    }
    $mctr = $ctr;
    $mctr++;

    echo "<tr>";
     echo "<td style='text-align:center'><i class='fa fa-close remove' ></i></td>";
    echo "<td><input type='text' name='vsrno_$ctr' value='$mctr' class='form-control form'></td>";
    Echo "<td>";
    Echo "<select class='form-control form vcountry select2 fetchpart_$ctr' name='vcountry_$ctr' style='width:100%'  required>";
    Echo "<option value=''></option>";
    $git = mysqli_query($conn, "SELECT `code`,`country` FROM `visamain` ORDER BY `country`")or die(mysqli_error($conn));
    while ($itm = mysqli_fetch_array($git)) {
        Echo "<option value='$itm[code]'>$itm[country]</option>";
    }
    Echo "</select>";
    Echo "</td>";
    echo "<td><input type='number' name='vnopax_$ctr' value='0' class='form-control form vnopax text-right'></td>";
    echo "<td><input type='number' name='vrate_$ctr' value='0' class='form-control form vrate text-right'></td>";
    echo "<td><input type='number' name='vamount_$ctr' value='0' class='form-control form vamount text-right' readonly>"
    . "<input type='hidden' name='vroe_$ctr' value='0' class='form-control form vroe text-right'>"
    . "<input type='hidden' name='vinramt_$ctr' value='0' class='form-control form vinramt text-right'></td>";
    echo "<td><input type='text' name='vtype_$ctr' value='' class='form-control form vtype '>";
    echo "<td><input type='text' name='vvalidity_$ctr' value='' class='form-control form vvalidity '>";
    echo "<td><input type='text' name='vgroupcode_$ctr' value='' maxlength='15' class='form-control form vgroupcode '>";
    echo "<td><input type='date' name='vtraveldt_$ctr' value=''  class='form-control form vtraveldt '>";
    echo "</tr>";
    $ctr++;
} else {
    echo "ERROR";
}
?>
 