<?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='fsrno_$ctr' value='$mctr' class='form-control form'></td>";
    echo "<td><input type='date' name='fcheckin_$ctr' value='' class='form-control form fcheckin'></td>";
    echo "<td><input type='date' name='fcheckout_$ctr' value='' class='form-control form fcheckout'></td>";
    Echo "<td>";
    Echo "<select class='form-control form fhotel select2 fetchpart_$ctr' name='fhotel_$ctr' style='width:100%'  required>";
    Echo "<option value=''></option>";
    $git = mysqli_query($conn, "SELECT `code`,`hotelnm` FROM `hotels` ORDER BY `hotelnm`")or die(mysqli_error($conn));
    while ($itm = mysqli_fetch_array($git)) {
        Echo "<option value='$itm[code]'>$itm[hotelnm]</option>";
    }
    Echo "</select>";
    Echo "</td>";
    echo "<td><input type='number' name='fnonights_$ctr' value='0' class='form-control form fnonights text-right' readonly></td>";
    echo "<td><input type='number' name='fnopax_$ctr' value='0' class='form-control form fnopax text-right'></td>";
    echo "<td><input type='number' name='frate_$ctr' value='0' class='form-control form frate text-right'></td>";
    echo "<td><input type='number' name='famount_$ctr' value='0' class='form-control form famount text-right' readonly>"
    . "<input type='hidden' name='froe_$ctr' value='0' class='form-control form froe text-right'>"
    . "<input type='hidden' name='finramt_$ctr' value='0' class='form-control form finramt text-right'></td>";
    echo "</tr>";
    $ctr++;
} else {
    echo "ERROR";
}
?>
 