<?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='lsrno_$ctr' value='$mctr' class='form-control form'></td>";
    echo "<td><input type='date' name='lcheckin_$ctr' value='' class='form-control form lcheckin'></td>";
    echo "<td><input type='date' name='lcheckout_$ctr' value='' class='form-control form lcheckout'></td>";
    Echo "<td>";
    Echo "<select class='form-control form lhotel select2 fetchpart_$ctr' name='lhotel_$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='lnonights_$ctr' value='0' class='form-control form lnonights text-right' readonly></td>";
    echo "<td><input type='number' name='lnopax_$ctr' value='0' class='form-control form lnopax text-right'></td>";
    echo "<td><input type='number' name='lrate_$ctr' value='0' class='form-control form lrate text-right'></td>";
    echo "<td><input type='number' name='lamount_$ctr' value='0' class='form-control form lamount text-right' readonly>"
    . "<input type='hidden' name='lroe_$ctr' value='0' class='form-control form lroe text-right'>"
    . "<input type='hidden' name='linramt_$ctr' value='0' class='form-control form linramt text-right'></td>";
    echo "</tr>";
    $ctr++;
} else {
    echo "ERROR";
}
?>
 