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

$maindb = 'hotels';

$admin = $_SESSION["admin_" . $dbname];
$zdb = $_SESSION["zdbyear_" . $dbname];
mysqli_select_db($conn, $zdb);
$city = $_REQUEST["city"];
if ($city != 2 && $city != 3) {
    $mhotl = mysqli_query($conn, "SELECT code, hotelnm FROM $maindb where city!='2' AND city!='3' order by hotelnm ") or die(mysqli_error($conn));
} else {
    $mhotl = mysqli_query($conn, "SELECT code, hotelnm FROM $maindb where city='$city' order by hotelnm ") or die(mysqli_error($conn));
}
echo "<option value=''></option>";

while ($thotl = mysqli_fetch_array($mhotl)) {
    echo "<option value='$thotl[code]'>$thotl[hotelnm]</option>";
}
?>