$(document).ready(function () {
    $("body").on('click', '.sksearch', ModaLSearch);

    $("body").on("change", '.scity', getHnm);


    function ModaLSearch() {
        var city = $(".scity").val(),
                hotelnm = $(".shotelnm").val(),
                roomcatg = $(".roomcatg").val(),
                checkin = $(".mcheckin").val(),
                checkout = $(".mcheckout").val();

        if (city == '') {
            alert("Please Select City");
            return false;
        }
        if (checkin == "0000-00-00" || checkin == "") {
            alert("Please Select Date");
            return false;

        }
//        if (hotelnm == '') {
//            alert("Please Select Hotel Name");
//        }

        $.post('getcheckinDetails.php', {
            city: city,
            hotelnm: hotelnm,
            roomcatg: roomcatg,
            checkin: checkin,
            checkout: checkout
        }, function (data) {
            $(".hoteldetail").html(data);
        });
    }


    function getHnm() {
        var city = $(".scity").val();
        $.post('getHotel.php', {city: city}, function (data) {
            $(".shotelnm").html(data);
        });
    }


});