| 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/b2bzend/application/views/scripts/accommodation/ |
Upload File : |
<?php
$hotelDetails = $this->hotelDetails;
$arrAroundProprty = Zend_Controller_Action_HelperBroker::getStaticHelper('Hotel')->getAroundProprty();
?>
<!--Page main section start-->
<section id="min-wrapper" class="active" ng-app="myApp">
<div id="main-content">
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<!--Top header start-->
<!--Top breadcrumb start -->
<ol class="breadcrumb">
<li><a href="#"><i class="fa fa-home"></i></a></li>
<li class="active">Accommodation</li><li class="active"><?=!empty($this->hotel_id)?'Update Hotels - '.$hotelDetails['Title'].'':'Add Villa'?> </li>
</ol>
<!--Top breadcrumb start -->
</div>
<!--for display message div-->
<?php if (!empty($this->messages)) { ?>
<div class="col-md-12" id="message_hotel_div">
<div class="alert alert-success">
<button aria-hidden="true" id="hideHotelMessage" class="close" type="button">×</button>
<?php foreach ($this->messages as $message) { ?>
<span id="success-message-box"><?php echo $this->escape($message); ?></span>
<?php } ?>
</div>
</div>
<?php } ?>
</div>
<script type="text/javascript">
$("#hideHotelMessage").click( function(){
$("#message_hotel_div").hide();
});
</script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular-route.js"></script>
<!-- Main Content Element Start-->
<div class="row">
<?php if(!empty($this->hotel_id)){ ?>
<input type="hidden" name="update_hotel_id" id="update_hotel_id" value="<?=$this->hotel_id?>">
<?php } ?>
<div class="col-md-12">
<div class="leadeBorder2">
<div class="panel-body">
<div class="form-group form-group1 text-right query_listing_bg_margin_bottom_15">
<div class="mobile_scrolling">
<span style="float:left; margin-left:5px; text-decoration: none; font-weight: bold;font-size: 16px;"><?=!empty($this->hotel_id)? $hotelDetails['Title'].'':'Add Villa'?></span>
<a href="<?php echo $this->baseUrl('accommodation/manage'); ?>" class="btn btn-danger btn-sm"><i class="fa fa-eye"></i> My Villas</a>
</div>
</div>
<div ng-view></div>
</div>
</div>
</div>
</div>
<div class="modal fade" id="myModactpopup" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
</div>
<!-- Main Content Element End-->
</div>
</div>
<?php echo $this->render('copyrightfooter.phtml'); ?>
</section>
<!--Page main section end -->
<?php include_once 'application/views/scripts/newfooter.phtml';?>
<script type="text/javascript" src="<?php echo $this->baseUrl('public/assets/js/jquery.validate.min.js'); ?>"></script>
<script src="<?php echo $this->baseUrl(); ?>/public/js/hotel/accommodation.js"></script>
<script src="<?php echo $this->baseUrl('public/assets/ckeditor/ckeditor.js'); ?>"></script>
<script src="<?php echo $this->baseUrl('public/assets/js/summernote.min.js'); ?>"></script>
<script type="text/javascript">
$(document).ready(function(){
$('a[pages="addvillas"]').trigger('click');
});
function getSearchInventoryHotel(cityId)
{
if(cityId!=='0')
{
$.ajax({
url : '<?php echo $this->baseUrl('/hotel/get-search-inventory-hotel') ?>',
data : { cityId : cityId},
type : 'POST',
dataType : 'html',
beforeSend : function() {
},
success : function(response) {
$("#select_hotel").html(response);
}
});
}
}
function getSupplierHotel(cityId)
{
if(cityId!=='0')
{
$.ajax({
url : '<?php echo $this->baseUrl('/hotel/get-search-supplier-hotel') ?>',
data : { cityId : cityId},
type : 'POST',
dataType : 'html',
beforeSend : function() {
},
success : function(response) {
$("#select_supplier").html(response);
}
});
}
}
function GetSupplierInfo(suppliersysID) {
$.ajax({
url: '/package/supplierinfo/',
data: {suppliersysID: suppliersysID},
type: 'POST',
dataType: 'html',
error: function () {
},
beforeSend: function () {
var image = "<div class= 'col-md-12' style='text-align: center; top: 150px;'><img id='imgId' src='<?php echo $this->baseUrl('public/images/load3.gif'); ?>'></div>";
$("#myModactpopup").html(image);
},
success: function (response) {
$("#myModactpopup").show();
$("#myModactpopup").html(response);
}
});
}
function closepopup() {
$("#myModactpopup").hide();
}
</script>
<script>
var app = angular.module("myApp", ["ngRoute"]);
app.config(function($routeProvider) {
$routeProvider
.when("/", {
templateUrl : "/accommodation/addvilla/id/<?=!empty($this->hotel_id)?$this->hotel_id:''?>",
controller: 'PageController',
activetab: 'addvilla'
})
.when("/villacontact", {
templateUrl : "/accommodation/villacontact/id/<?=!empty($this->hotel_id)?$this->hotel_id:''?>",
controller: 'PageController',
activetab: 'villacontact'
})
.when("/villafacility", {
templateUrl : "/accommodation/villafacility/id/<?=!empty($this->hotel_id)?$this->hotel_id:''?>",
controller: 'PageController',
activetab: 'villafacility'
})
.when("/villaaroundproperty/:AroundPId?", {
templateUrl: function(params) {
if(params.AroundPId == undefined){
return '/accommodation/villaaroundproperty/id/<?=!empty($this->hotel_id)?$this->hotel_id:''?>';
}else{
return '/accommodation/villaaroundproperty/id/<?=!empty($this->hotel_id)?$this->hotel_id:''?>/AroundPId/' + params.AroundPId;
}
},
controller: 'PageController',
activetab: 'villaaroundproperty'
})
.when("/villadetails/:RoomId?", {
templateUrl: function(params) {
if(params.RoomId == undefined){
return '/accommodation/villadetails/id/<?=!empty($this->hotel_id)?$this->hotel_id:''?>';
}else{
return '/accommodation/villadetails/id/<?=!empty($this->hotel_id)?$this->hotel_id:''?>/RoomId/' + params.RoomId;
}
},
controller: 'PageController',
activetab: 'villadetails'
})
.when("/villaroomdetails/:RoomId?", {
templateUrl: function(params) {
if(params.RoomId == undefined){
return '/accommodation/villaroomdetails/id/<?=!empty($this->hotel_id)?$this->hotel_id:''?>';
}else{
return '/accommodation/villaroomdetails/id/<?=!empty($this->hotel_id)?$this->hotel_id:''?>/RoomId/' + params.RoomId;
}
},
controller: 'PageController',
activetab: 'villaroomdetails'
})
.when("/villa-mealplanrates/:RoomId?", {
templateUrl: function(params) {
if(params.RoomId == undefined){
return '/accommodation/villa-mealplanrates/id/<?=!empty($this->hotel_id)?$this->hotel_id:''?>';
}else{
return '/accommodation/villa-mealplanrates/id/<?=!empty($this->hotel_id)?$this->hotel_id:''?>/RoomId/' + params.RoomId;
}
},
controller: 'PageController',
activetab: 'villa-mealplanrates'
})
.when("/villatnc/:RoomId?", {
templateUrl: function(params) {
if(params.RoomId == undefined){
return '/accommodation/villatnc/id/<?=!empty($this->hotel_id)?$this->hotel_id:''?>';
}else{
return '/accommodation/villatnc/id/<?=!empty($this->hotel_id)?$this->hotel_id:''?>/RoomId/' + params.RoomId;
}
},
controller: 'PageController',
activetab: 'villatnc'
})
.otherwise({ redirectTo: '/' });
});
app.directive('errSrc', function() {
return {
link: function(scope, element, attrs) {
element.bind('error', function() {
if (attrs.src !== attrs.errSrc) {
attrs.$set('src', attrs.errSrc);
}
});
}
}
});
app.controller('PageController', ['$scope', '$route', '$routeParams', "$http", '$filter' ,function($scope, $route, $routeParams, $http , $filter){
//var self=this;
$scope.preload = false;
$scope.aroundlist = [];
$scope.hoteldetail = [];
$scope.arrCity = [];
$scope.hotelimage = [];
$scope.hotelcontactdetail = [];
$scope.hotelfacilitydetail = [];
$scope.arrMasterAccomAminities = [];
$scope.arrSelectedFacilities = [];
$scope.roomdetailslist = [];
$scope.villaroomdetailslist = [];
$scope.temparoundData = {};
$scope.temphocontact = {};
$scope.aroudcontant = <?=json_encode($arrAroundProprty)?>;
$scope.cleanup = function(message) {
return message.replace(/\s/g, ' ');
};
$scope.Showpreloader = function () {
$('.preload').html('loading...');
};
// function to get records from the database
$scope.getAroundpr = function(){
$http({
method : "GET",
url: "/accommodation/getaroundpr/id/<?=!empty($this->hotel_id)?$this->hotel_id:''?>"
}).then(function success(response){
if(response.data.status === 'OK'){
$scope.aroundlist = response.data.records;
}
if(response.data.rooms > 0){
$('.mealplanrates,.roomwiserates,.promotion,.cancellation_policy').attr('disabled',false);
if(response.data.RateType == 0){
$('.roomwiserates,.promotion,.cancellation_policy').attr('disabled',true);
}
}else{
$('.mealplanrates,.roomwiserates,.promotion,.cancellation_policy').attr('disabled',true);
}
});
};
$scope.getHotelContact = function(){
$http({
method : "GET",
url: "/accommodation/getnghotelcontact/id/<?=!empty($this->hotel_id)?$this->hotel_id:''?>"
}).then(function success(response){
if(response.data.status === 'OK'){
$scope.hotelcontactdetail = response.data.records;
if(response.data.countrycode !==null){
$("#iti-flag").attr('class','iti-flag '+response.data.countrycode+'');
}
if(response.data.records.GeoLat.trim() !== ''){
$('#latitude').val(response.data.records.GeoLat.trim());
$scope.temphocontact = {GeoLat:response.data.records.GeoLat.trim()};
}
if(response.data.records.GeoLong.trim() !== ''){
$('#longitude').val(response.data.records.GeoLong.trim());
$scope.temphocontact = {GeoLong:response.data.records.GeoLong.trim()};
}
$scope.temphocontact = {PinCode:response.data.records.PinCode.trim()};
}
if(response.data.rooms > 0){
$('.mealplanrates,.roomwiserates,.promotion,.cancellation_policy').attr('disabled',false);
if(response.data.RateType == 0){
$('.roomwiserates,.promotion,.cancellation_policy').attr('disabled',true);
}
}else{
$('.mealplanrates,.roomwiserates,.promotion,.cancellation_policy').attr('disabled',true);
}
CKEDITOR.replace('aboutHotelBrief',{});
});
};
$scope.getHotelFacility = function(){
$http({
method : "GET",
url: "/accommodation/getnghotelfacility/id/<?=!empty($this->hotel_id)?$this->hotel_id:''?>"
}).then(function success(response){
if(response.data.status === 'OK'){
$scope.arrSelectedFacilities = response.data.arrSelectedFacilities;
$scope.hotelfacilitydetail = response.data.records;
$('#CheckinTime').val(response.data.records.CheckinTime.trim());
$('#CheckOutTime').val(response.data.records.CheckOutTime.trim());
}
if(response.data.rooms > 0){
$('.mealplanrates,.roomwiserates,.promotion,.cancellation_policy').attr('disabled',false);
if(response.data.RateType == 0){
$('.roomwiserates,.promotion,.cancellation_policy').attr('disabled',true);
}
}else{
$('.mealplanrates,.roomwiserates,.promotion,.cancellation_policy').attr('disabled',true);
}
});
};
$scope.getAddHotelDetails = function(){
var data = $.param({
id: '<?=!empty($this->hotel_id)?$this->hotel_id:''?>'
});
var config = {
headers : {
'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8;'
}
};
$http.post('/accommodation/getaddhoteldetails', data, config).then(function success(response){
if(response.data.rooms > 0){
$('.mealplanrates,.roomwiserates,.promotion,.cancellation_policy').attr('disabled',false);
if(response.data.RateType == 0){
$('.roomwiserates,.promotion,.cancellation_policy').attr('disabled',true);
}
}else{
$('.mealplanrates,.roomwiserates,.promotion,.cancellation_policy').attr('disabled',true);
}
if(response.data.status === 'OK'){
$.each(response.data.arrCity, function (index, value) {
$('#select-hotel-city').append('<option value="' + value.CityId + '">' + value.Title + '</option>');
});
$scope.hotelimage = response.data.resultimg;
$scope.hoteldetail = response.data.records;
$('#select_hotel_country').val(response.data.records.ContId.trim()).focus();
$('#select-hotel-city').val(response.data.records.CitySysId.trim()).focus();
$('#star_rating').val(response.data.records.Stars.replace(".00", "")).focus();
$('#ProprtyType').val(response.data.records.PropertyType).focus();
$('#CheckinTime').val(response.data.records.CheckinTime.trim()).focus();
$('#CheckOutTime').val(response.data.records.CheckOutTime.trim()).focus();
$('#AreaSysId').val(response.data.records.ZoneSysId.trim()).focus();
$('#SplitStayNights').val(response.data.records.SplitStayNights).focus();
$('#MinStayNights').val(response.data.records.MinStayNights).focus();
$('#CurrencyType').val(response.data.records.CurrencyType).focus();
$('#hidden_selected_supplier_sys_id').val(response.data.records.SupplierSysId).focus();
$('#supplier_name').val(response.data.records.suppliername).focus();
$('#RateType').val(response.data.records.RateType).focus();
$('#AreaName').val(response.data.records.AreaName).focus();
$('#hotel_name').focus();
}
});
};
$scope.getRoomDetailList = function(){
$http({
method : "GET",
url: "/accommodation/getroomdelist/id/<?=!empty($this->hotel_id)?$this->hotel_id:''?>"
}).then(function success(response){
if(response.data.status === 'OK'){
$scope.roomdetailslist = response.data.records;
}
if(response.data.rooms > 0){
$('.mealplanrates,.roomwiserates,.promotion,.cancellation_policy').attr('disabled',false);
if(response.data.RateType == 0){
$('.roomwiserates,.promotion,.cancellation_policy').attr('disabled',true);
}
}else{
$('.mealplanrates,.roomwiserates,.promotion,.cancellation_policy').attr('disabled',true);
}
CKEDITOR.replace('CancellationPolicy',{});
});
};
$scope.getVillaRoomDetailList = function(){
$http({
method : "GET",
url: "/accommodation/getvillaroomdelist/id/<?=!empty($this->hotel_id)?$this->hotel_id:''?>"
}).then(function success(response){
if(response.data.status === 'OK'){
$scope.villaroomdetailslist = response.data.records;
}
if(response.data.rooms > 0){
$('.mealplanrates,.roomwiserates,.promotion,.cancellation_policy').attr('disabled',false);
if(response.data.RateType == 0){
$('.roomwiserates,.promotion,.cancellation_policy').attr('disabled',true);
}
}else{
$('.mealplanrates,.roomwiserates,.promotion,.cancellation_policy').attr('disabled',true);
}
});
};
$scope.GetArval = function(id){
return $scope.aroudcontant[id];
};
// function to edit data
$scope.editAroundPr = function(values){
$scope.temparoundData = {
NearByPlaceSysId:values.NearByPlaceSysId,
NearByPlaceCat:values.NearByPlaceCat,
DistanceInKmTime:values.DistanceInKmTime,
Description:values.Description
};
$('#NearByPlaceCat').val(values.NearByPlaceCat);
$scope.index = $scope.aroundlist.indexOf(values);
};
$scope.editModeRoom = function(values){
window.location = '/accommodation/add-villas/id/<?=!empty($this->hotel_id)?$this->hotel_id:''?>#!/villadetails/'+values.room.ItemSysId;
};
$scope.editModeVillaRoom = function(values){
window.location = '/accommodation/add-villas/id/<?=!empty($this->hotel_id)?$this->hotel_id:''?>#!/villaroomdetails/'+values.room.ItemSysId;
};
$scope.updateStatusModeRoom = function(values,that){
var conf = confirm('Are you sure to delete?');
if(conf === true){
var IsActive = values.room.IsActive;
var ItemSysId = values.room.ItemSysId;
var hotelid = '<?=!empty($this->hotel_id)?$this->hotel_id:''?>';
var config = {
headers : {
'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8;'
}
};
$http({
method : "POST",
url: "/accommodation/update-room-status/ItemSysId/"+ItemSysId+"/hotelid/"+hotelid+"/IsActive/"+IsActive,
data: '',
headers:config,
dataType: 'json',
}).then(function success(response){
window.location.reload();
});
}
};
$scope.updateStatusModeVillaRoom = function(values,that){
var conf = confirm('Are you sure to delete?');
if(conf === true){
var IsActive = values.room.IsActive;
var ItemSysId = values.room.ItemSysId;
var hotelid = '<?=!empty($this->hotel_id)?$this->hotel_id:''?>';
var config = {
headers : {
'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8;'
}
};
$http({
method : "POST",
url: "/accommodation/update-villa-room-status/ItemSysId/"+ItemSysId+"/hotelid/"+hotelid+"/IsActive/"+IsActive,
data: '',
headers:config,
dataType: 'json',
}).then(function success(response){
window.location.reload();
});
}
};
$scope.deletearoundpro = function(values){
var conf = confirm('Are you sure to delete?');
if(conf === true){
var config = {
headers : {
'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8;'
}
};
$http({
method : "POST",
url: "/accommodation/deletearoundpro/DeleteId/"+values.NearByPlaceSysId,
data: 'DeleteId='+values.NearByPlaceSysId,
headers:config
}).then(function success(response){
if(response.data.success === true){
//$scope.aroundlist = response.data.records;
var index = $scope.aroundlist.indexOf(values);
$scope.aroundlist.splice(index,1);
}
});
}
};
$scope.deletehotelimg = function(values){
var conf = confirm('Are you sure to delete?');
if(conf === true){
var config = {
headers : {
'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8;'
}
};
$http({
method : "POST",
url: "/accommodation/deletehotelcontimg/DeleteId/"+values.ImgIndex+"/hotel_id/"+values.AccomSysId,
data: 'DeleteId='+values.ImgIndex,
//headers:config
}).then(function success(response){
if(response.data.success === true){
var index = $scope.hotelimage.indexOf(values);
$scope.hotelimage.splice(index,1);
}
});
}
};
$scope.deleteroomImg = function(img){
var conf = confirm('Are you sure to delete?');
if(conf === true){
var config = {
headers : {
'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8;'
}
};
$http({
method : "POST",
url: "/accommodation/deleteroomimg/DeleteId/"+img.ImgIndex,
data: 'DeleteId='+img.ImgIndex,
headers:config
}).then(function success(response){
if(response.data.success === true){
$('#hide_'+img.ImgIndex+'').hide();
}else{
alert('Oops something wrong!?');
return ;
}
});
}
};
$scope.deletevillaroomImg = function(img){
var conf = confirm('Are you sure to delete?');
if(conf === true){
var config = {
headers : {
'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8;'
}
};
$http({
method : "POST",
url: "/accommodation/deletevillaroomimg/DeleteId/"+img.ImgIndex,
data: 'DeleteId='+img.ImgIndex,
headers:config
}).then(function success(response){
if(response.data.success === true){
$('#hide_'+img.ImgIndex+'').hide();
}else{
alert('Oops something wrong!?');
return ;
}
});
}
};
$scope.getHotelMealPlanDetails = function(){
$http({
method : "GET",
url: "/accommodation/getnghotelmealplanrate/id/<?=!empty($this->hotel_id)?$this->hotel_id:''?>"
}).then(function success(response){
if(response.data.status === 'OK'){
$('.roomwiserates,.promotion,.cancellation_policy').attr('disabled',true);
if(response.data.IsRateType == 1){
$('.RateTypeClass').prop('disabled',true);
$('.roomwiserates,.promotion,.cancellation_policy').attr('disabled',false);
}
if(response.data.RateType > 0){
$('.RateTypeClass').prop('checked',false);
$('.RateTypeClass'+response.data.RateType).prop('checked',true).click();
$('#tableMealplan').show();
if(response.data.RateType == 1){
$('#MealPlan_Cp_html').show();
}else{
$('#MealPlan_Cp_html').hide();
}
$('#adult_rate_6').val(response.data.records[6].AdultAmount);
$('#child_rate_6').val(response.data.records[6].ChildAmount);
$('#adult_rate_7').val(response.data.records[7].AdultAmount);
$('#child_rate_7').val(response.data.records[7].ChildAmount);
$('#adult_rate_8').val(response.data.records[8].AdultAmount);
$('#child_rate_8').val(response.data.records[8].ChildAmount);
$('#adult_rate_3').val(response.data.records[3].AdultAmount);
$('#child_rate_3').val(response.data.records[3].ChildAmount);
$('#adult_rate_10').val(response.data.records[10].AdultAmount);
$('#child_rate_10').val(response.data.records[10].ChildAmount);
}
}
});
};
$scope.$route = $route;
}]);
function gotTotab(tab){
$("a[pages='"+tab+"']").trigger("click");
}
</script>