| Server IP : 103.234.187.230 / Your IP : 216.73.216.216 Web Server : Apache System : Linux lserver42043-ind.megavelocity.net 3.10.0-1160.108.1.el7.x86_64 #1 SMP Thu Jan 25 16:17:31 UTC 2024 x86_64 User : apache ( 48) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/html/b2b.hellogtx.com/public/js/hotelinv/ng/ |
Upload File : |
//var hotelSearch = angular.module("hotelSearch", []);
app.controller("HotelDetailsController", ['$scope', '$http', '$location', '$window', '$timeout', function($scope, $http, $location, $window, $timeout) {
$scope.ErrorRoomInfo = false;
$scope.loadingRoomInfo = true;
var TraceId = $('#TraceId').val();
var SearchHotelTraceId = $('#SearchHotelTraceId').val();
var ResultIndex = $('#ResultIndex').val();
var HotelCode = $('#HotelCode').val();
var url = SITEURL + "hotels/index/hotel-detail/" + SearchHotelTraceId + '/' + TraceId;
$http({
method: "POST",
url: url,
data: { SearchHotelTraceId: SearchHotelTraceId, TraceId: TraceId, ResultIndex: ResultIndex, HotelCode: HotelCode, page: 'details' },
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'X-Requested-With': 'XMLHttpRequest'
}
}).then(function successCallback(response) {
if (response.data.ArrRoomInfo.ResponseStatus == 1) {
$scope.loadingRoomInfo = false;
$scope.RoomInfo = (response.data.RoomInfo);
$scope.HotelRoomsDetails = (response.data.ArrRoomInfo.HotelRoomsDetails);
//$scope.HotelFacilities = (response.data.ArrHotelInfo.HotelInfoResult.HotelDetails.HotelFacilities[0]).split(",");
$scope.HotelPolicy = (response.data.ArrHotelInfo.HotelInfoResult.HotelDetails.HotelPolicy);
$scope.Attractions = (response.data.ArrHotelInfo.HotelInfoResult.HotelDetails.Attractions);
$scope.Attractions = (response.data.ArrHotelInfo.HotelInfoResult.HotelDetails.Attractions);
$scope.HotelImages = (response.data.ArrHotelInfo.HotelInfoResult.HotelDetails.Images);
$scope.HotelData = response.data.HotelData;
console.log(response.data.ArrHotelInfo.HotelInfoResult.HotelDetails.HotelFacilities);
} else {
$scope.ErrorRoomInfo = true;
$scope.ErrorMessage = response.data.ArrRoomInfo.Error.ErrorMessage;
}
GethotelDetail();
}, function errorCallback(response) {
});
$scope.Cancellation = function(val) {
$('#cancellationpolicyPOP').modal('show');
var Listul = $('<ul></ul>');
angular.forEach(val.CancellationPolicies, function(value, key) {
Listul.append('<li>From: ' + value.strFromDate + ' To: ' + value.strToDate + ' : ' + value.Currency + ' ' + value.Charge + ' Charges.</li>');
});
$('#cancellation_div').html(Listul);
$('li.CancellationPolicy').html(val.CancellationPolicy);
};
$scope.BookRoomNow = function(item, val, index) {
var url = SITEURL + "hotels/search/book-room";
$http({
method: "POST",
url: url,
data: { item: item, val: val, index: index },
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'X-Requested-With': 'XMLHttpRequest'
}
}).then(function successCallback(response) {
if (response.data.success) {
$window.location.href = response.data.url;
} else {
alert(response.data.message);
}
});
};
}]);
function GethotelDetail() {
var TraceId = $('#TraceId').val();
var ResultIndex = $('#ResultIndex').val();
var HotelCode = $('#HotelCode').val();
var url = SITEURL + "hotels/index/gethoteldetail";
$.ajax({
type: "POST",
url: url,
dataType: 'html',
data: { TraceId: TraceId, ResultIndex: ResultIndex, HotelCode: HotelCode, page: 'details' },
beforeSend: function() {
$('.continue_btn').hide();
$('.paynow_btn').hide();
$("#DetailsData").html('<div style="text-align:center;padding-top:30px;"><img src="public/images/loader.gif"/></div>');
},
success: function(data) {
$("#DetailsData").html(data);
}
});
}