| 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
$arrStarRatings = Zend_Controller_Action_HelperBroker::getStaticHelper('Hotel')->getStarRatings();
$arrProprtyType = Zend_Controller_Action_HelperBroker::getStaticHelper('Hotel')->getProprtyType();
$arrcurrency = Zend_Controller_Action_HelperBroker::getStaticHelper('Currency')->getCurrencyTypes();
$sessionLogin_user = new Zend_Session_Namespace('sessionLogin_user');
$IsHotelInventory = $sessionLogin_user->agencyDetails['IsHotelInventory'];
$IsHotelOnlyRates = $sessionLogin_user->agencyDetails['IsHotelOnlyRates'];
$baseCurrency = $sessionLogin_user->agencyDetails['TrxCurrency'];
$begin = new DateTime("00:00");
$end = new DateTime("24:00");
$interval = DateInterval::createFromDateString('60 min');
$times = new DatePeriod($begin, $interval, $end);
$VillaTypeArr = array('1'=>'Deluxe','2'=>'Luxury','3'=>'Super Deluxe','4'=> 'Standard');
$cityArray = array();
$cityArrayData = json_encode($cityArray);
$arrWeekend = Zend_Controller_Action_HelperBroker::getStaticHelper('Hotel')->getWeekend();
$defaultSelectedWeekend = array('Sat','Sun');
//echo "<pre>";print_r();die;
$DefaultCountryCode = $sessionLogin_user->agencyDetails['DefaultCountryCode'];
$AgencyUser = new Zend_Session_Namespace('AgencyUser');
$IsShowSupplier = $AgencyUser->user->IsShowSupplier;
?>
<style>
.tab-pane {
padding: 20px 10px;
}
.blur{
filter: blur(2px);
}
.addhotelclose {
position: absolute;
top: -15px;
right: -15px;
width: 32px;
height: 32px;
border: none !important;
border-radius: 50%;
background: #d6d6d6 !important;
color: #333 !important;
font-size: 18px;
font-weight: bold;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
transition: background 0.3s ease-in-out;
}
.addhotelclose:hover {
background: #e0e0e0 !important;
}
</style>
<!--Page main section start-->
<section id="min-wrapper" class="active">
<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="">Accommodation</li>
<li class="">Manage</li>
<li class="active">My Hotel List</li>
</ol>
<!--Top breadcrumb start -->
</div>
<!--for display message div-->
<?php if (count($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>
<!-- Main Content Element Start-->
<div class="row">
<div class="col-md-12">
<div class="panel panel-primary">
<div class="panel-heading minus" style="padding:0">
<h3 class="panel-title" onclick="$('.minus').trigger('click')" style="padding:12px 15px 10px 15px;"><img src="<?php echo $this->baseUrl('public/images/query_dashboard/filtericon.png'); ?>">
Filter Results </h3>
<ul class="panel-control">
<li><a class="minus active" href="javascript:void(0)"><i
class="fa fa-angle-down large"></i></a></li>
</ul>
</div>
<div class="panel-body" style="display:none;">
<form name="search" id="search" class="ls_form" role="form" method="post"
action="<?php echo $this->baseUrl('accommodation/manage'); ?>">
<div class="row">
<div class="col-md-4">
<div class="active form-group DestinationIdDropdown active">
<label>Destination</label>
<select id="DestinationId" name="DestinationId"
class="demo-default select-country" placeholder="Select Destination"
onchange="getSearchHotelByCityId(this.value);">
<option value="">Select Destination </option>
<?php foreach ($this->cityList as $city) { ?>
<option value="<?php echo $city['CityId']; ?>" <?php if (isset($this->searchArr['DestinationId']) && ($city['CityId'] == $this->searchArr['DestinationId'])) {
echo "Selected";
} ?>>
<?php echo $city['Title']; ?></option>
<?php } ?>
</select>
</div>
</div>
<div class="col-md-4">
<div class="active form-group hotelIdDropdown active">
<label>Hotel Name</label>
<div id="select_hotel">
<select id="hotelId" name="hotelId" class="demo-default select-country"
placeholder="Select Hotel">
<option value="">Select Hotel </option>
<?php foreach ($this->inventoryHotelList as $inventory_hotel) { ?>
<option value="<?php echo $inventory_hotel['AccomSysId']; ?>"
<?php if (isset($this->searchArr['hotelId']) && ($inventory_hotel['AccomSysId'] == $this->searchArr['hotelId'])) {
echo "Selected";
} ?>><?php echo $inventory_hotel['Title'].'('.$inventory_hotel['AccomSysId'].')'; ?></option>
<?php } ?>
</select>
</div>
</div>
</div>
<div class="col-md-4">
<div class="active form-group hotelIdDropdown active">
<label>Property Type</label>
<div id="select_hotel">
<select id="ProprtyType_search" name="ProprtyType" class="demo-default select-country" placeholder="Select Property Type">
<option>select property type</option>
<?php
if(!empty($arrProprtyType) ) {
foreach($arrProprtyType as $key => $value) {
?>
<option value="<?php echo $key; ?>" <?php if (isset($this->searchArr['ProprtyType']) && ($this->searchArr['ProprtyType'] == $key)) {
echo "Selected";
} ?>><?php echo $value; ?></option>
<?php
}
}
?>
</select>
</div>
</div>
</div>
<div class="col-md-4">
<div class="active form-group ratingDropdown active ">
<label>Star Rating</label>
<select id="rating" name="rating" class="demo-default select-country form-cantrol"
placeholder="Select">
<option value="">Select</option>
<?php
if (!empty($arrStarRatings) ) {
// while (list($key, $value) = each($arrStarRatings)) {
foreach($arrStarRatings as $key => $value){
?>
<option value="<?php echo $key; ?>" <?php if ((isset($this->searchArr['rating']) && ($key == $this->searchArr['rating']))) {
echo "Selected";
} ?>><?php echo $value; ?>
</option>
<?php
}
}
?>
</select>
</div>
</div>
<div class="col-md-12">
<div class="form-group form-group1 flexipadding text-right">
<button type="button" class="btn btn-primarygray"
onclick="window.location.href = '<?php echo $this->baseUrl('accommodation/manage'); ?>'">Reset</button>
<button type="submit" class="btn btn-primary"><i class="fa fa-search"></i>
Filter</button>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
<div class="col-md-12">
<div class="query_listing_bg3">
<div class="panel-body no-padding">
<div class="form-group form-group1 text-right align_paddingbottom_20">
<div class="mobile_scrolling">
<!--<a href="<?php echo $this->baseUrl('hotel/manage'); ?>" style="float:left;" class="btn btn-default btn-sm"><i class="fa fa-fw fa-arrows"></i> Rate Expired (10)</a>
<a href="<?php echo $this->baseUrl('hotel/manage'); ?>" style="float:left; margin-left:5px;" class="btn btn-default btn-sm"><i class="fa fa-fw fa-arrows"></i> Promotion (20)</a>-->
<!--<a href="<?php //echo $this->baseUrl('accommodation/bulk-upload'); ?>" class="btn btn-danger btn-sm">Bulk Upload </a>-->
<?php //if($this->intLoggedinUserAgencySysId == 1 || $this->intLoggedinUserAgencySysId == 21 || $this->intLoggedinUserAgencySysId == 2656){ ?>
<a href="javascript://"class="btn btn-primary btn-sm" onclick="AddHotelDetails()"><i class="fa fa-plus"></i> Add Hotel</a>
<?php //} else{ ?>
<!-- <a href="<?php // echo $this->baseUrl('accommodation/add-hotels'); ?>"
class="btn btn-danger btn-sm"><i class="fa fa-plus"></i> Add Hotel
</a>-->
<?php //} ?>
<?php if($this->intLoggedinUserAgencySysId == '112339'){ ?>
<a href="<?php echo $this->baseUrl('accommodation/add-villas'); ?>"
class="btn btn-danger btn-sm"><i class="fa fa-plus"></i> Add Villa</a>
<?php } ?>
<?php if((!empty($IsHotelInventory) && ($IsHotelInventory==1)) || (!empty($IsHotelOnlyRates) && ($IsHotelOnlyRates==1))){ ?>
<a href="<?php echo $this->baseUrl('accommodation/inventory'); ?>"
class="btn btn-danger btn-sm"><i class="fa fa-eye"></i> Hotel Rates
List</a>
<!-- <a href="<?php // echo $this->baseUrl('accommodation/rate-card'); ?>"
class="btn btn-warning btn-sm"><i class="fa fa-plus"></i> Add Hotel
Rates</a>-->
<?php } ?>
</div>
</div>
<div class="form-group form-group1 text-right AddHotelDetailsHtml" style="border: 1px solid #ddd;background:#fdfdfd !important;display:none;-webkit-box-shadow: 0 0px 10px 0px #a9a3a3;">
<button type="button" class="close addhotelclose" data-dismiss="modal" aria-hidden="true" onclick="AddHotelDetails();">×</button>
<form name="addHotel" id="addHotel" class="ls_form" role="form" method="post" action="javascript://" >
<div class="tab-pane fade active in" id="addhotels" style="padding-bottom: 10px;">
<input type="hidden" name="save_page" value="list" class="form-control">
<div class="col-md-2 no-padding">
<div class="form-group select-hotel-cityDropdown active">
<label>Hotel Name<span class="red">*</span> </label>
<input type="text" name="hotel_name" id="hotel_name" class="form-control" maxlength="200">
</div>
</div>
<div class="col-md-2 no-padding-right">
<div class="form-group select-hotel-cityDropdown active">
<label>City Name<span class="red">*</span> </label>
<input type="text" name="select_hotel_city_name" id="select_hotel_city_name" class="form-control">
<input type="hidden" name="select_hotel_city" id="select_hotel_city" class="form-control">
<input type="hidden" name="select_hotel_country" id="select_hotel_country" class="form-control">
</div>
</div>
<div class="col-md-2 no-padding-right">
<div class="form-group select-hotel-cityDropdown active">
<label>Contact Email</label>
<input type="text" name="contact_email" id="contact_email" class="form-control">
</div>
</div>
<div class="col-md-2 no-padding-right">
<div class="no-margin">
<div class="txtfieldMain textfieldMain_mobile form-group active" style="border: #0069ff 0px solid;">
<label for="mobilenum" class="mobilenumber_labelshow" style="color: #000; z-index: 999;left: 87px !important;">Contact No. </label>
<div class="country_details country_box_wrap1">
<div id="iti-flag" class="iti-flag in"></div>
<div class="iti-arrow"></div>
</div>
<div class="country_dropdown">
<div class="search_country">
<input type="text" name="" class="txtfield form-control" placeholder="Search countries" id="countries_list">
<div class="search_icon"></div>
</div>
<ul class="allcountries"></ul>
</div>
<input type="text" class="txtfield country_code stdcode_padding country_box_wrap2" readonly="readonly" id="Countrycode" name="countrycode" value="<?php echo (isset($DefaultCountryCode) && $DefaultCountryCode !='') ? trim($DefaultCountryCode) : '+91'; ?>">
<input type="text" name="mobile_number" id="mobile_number" maxlength="15" value="" class="form-control whbg notalphabet" style="width: calc(100% - 84px) !important; float: right; border-bottom:#0069ff 1px solid !important; ">
</div>
</div>
</div>
<div class="col-md-1 no-padding-right">
<div class="form-group active">
<label class="no-padding">Star Rating </label>
<select id="star_rating" name="star_rating" class="form-control">
<option value="">Select</option>
<?php
if(!empty($arrStarRatings) ) {
foreach($arrStarRatings as $key=>$value) {?>
<option value="<?php echo $key; ?>" ><?php echo $value; ?> <?php echo $key > 0 ? 'Star' : ''; ?></option>
<?php }
}
?>
</select>
</div>
</div>
<div class="col-md-1 no-padding-right">
<div class="form-group active">
<label class="no-padding">Property Type <span class="red">*</span> </label>
<select id="ProprtyType" name="ProprtyType" class="form-control">
<?php
if(!empty($arrProprtyType) ) {
// while ( list($key, $value) = each($arrProprtyType) ) {
foreach($arrProprtyType as $key => $value) {
if($key != 12){
?>
<option value="<?php echo $key; ?>" <?php echo $key == 1 ? 'selected' : ''; ?>><?php echo $value; ?></option>
<?php
} }
}
?>
</select>
</div>
</div>
<div class="col-md-1 no-padding-right" >
<div class="form-group">
<label class="no-padding">Check In Time </label>
<select id="CheckinTime" name="CheckinTime" class="form-control">
<option value="">select</option>
<?php
if(!empty($times) ) {
foreach ($times as $time) { ?>
<option value="<?php echo $time->format('H:i'); ?>" <?=($time->format('H:i')=='11:00')?'selected':''?>><?php echo $time->format('H:i'); ?></option>
<?php
}
}
?>
</select>
</div>
</div>
<div class="col-md-1 no-padding-right" >
<div class="form-group">
<label class="no-padding"> Out Time </label>
<select id="CheckOutTime" name="CheckOutTime" class="form-control">
<option value="">select</option>
<?php
if(!empty($times) ) {
foreach ($times as $time) { ?>
<option value="<?php echo $time->format('H:i'); ?>" <?=($time->format('H:i')=='12:00')?'selected':''?>><?php echo $time->format('H:i'); ?></option>
<?php
}
}
?>
</select>
</div>
</div>
<div class="col-md-2 no-padding" >
<div class="form-group active">
<label for="room_type">Weekend </label>
<select id="weekend" name="weekend[]" class="demo-default select-country" multiple>
<?php
foreach ($arrWeekend as $key => $week) {
?>
<option value='<?= $key ?>' <?php echo (in_array($key,$defaultSelectedWeekend)) ? 'selected' : '';?>><?= $week ?></option>
<?php } ?>
</select>
</div>
</div>
<?php if((!empty($IsHotelInventory) && ($IsHotelInventory==1)) || (!empty($IsHotelOnlyRates) && ($IsHotelOnlyRates==1))){ ?>
<div class="col-md-2 no-padding-right">
<div class="form-group active">
<label>Supplier <span class="red">*</span></label>
<input type="text" name="supplier_name" id="supplier_name" value="" class="form-control" maxlength="200">
<input type="hidden" name="hidden_selected_supplier_sys_id" id="hidden_selected_supplier_sys_id" value="">
</div>
</div>
<div class="col-md-1 no-padding-right">
<div class="form-group active">
<label>Currency <span class="red">*</span></label>
<select id="CurrencyType" name="CurrencyType" class="form-control SupplierCurrencyType">
<option value="">Select</option>
<?php
if (!empty($arrcurrency) ) {
foreach($arrcurrency as $cKey => $cValue){ ?>
<option value="<?php echo (int)$cValue['CurrencyType']; ?>" <?php echo ($baseCurrency == (int)$cValue['CurrencyType']) ? 'selected' : '';?> ><?php echo trim($cValue['Symbol']);?></option>
<?php
}
}
?>
</select>
</div>
</div>
<div class="col-md-1 no-padding-right">
<div class="form-group active">
<label>Rate Type <span class="red">*</span></label>
<select id="NetRateType" name="NetRateType" class="form-control no-padding-right" onchange='changeRateType()'>
<option value="1">Net Rate</option>
<option value="0">Commissionable Rate</option>
</select>
</div>
</div>
<div class="col-md-1 no-padding-right CommissionableRateDiv" style="display:none;">
<div class="form-group active">
<label>Value (%) <span class="red">*</span></label>
<input type='text' id='RackCommission' name="RackCommission" class="form-control">
</div>
</div>
<?php } ?>
<input type="hidden" name="total_room" id="total_room" value="10" class="form-control integer" maxlength="200">
<input type="hidden" name="RateType" value="0" class="form-control integer">
<div class="col-md-3 no-padding-right" >
<div class="form-group active">
<label for="room_type">Room Type </label>
<input name="RoomType" id="RoomType" class="form-control whbg RoomType" data-selectize-values='<?php echo $cityArrayData; ?>' value='' type="text" onkeyup="other_loc_city_multiautosuggest('RoomType');" />
</div>
</div>
<div class="col-md-1 no-padding-right">
<div class="form-group active">
<label>Child Age </label>
<select id="ChildAge" name="ChildAge" class="form-control no-padding-right">
<?php for ($i = 3; $i <= 12; $i++) { ?>
<option value="<?php echo $i; ?>"><?php echo $i; ?> year</option>
<?php } ?>
</select>
</div>
</div>
<div class="col-md-2 no-padding-right pull-right" >
<a class="btn btn-primarygray saveaction" onclick="return saveHotelDetails(2)" style="margin-right: 10px;">Save & More</a>
<a class="btn btn-primary saveaction" onclick="return saveHotelDetails(1)">Save</a>
</div>
<div class="clearfix"></div>
</div>
</form>
</div>
<div class="panel-body table-responsive no-padding">
<?php //echo '<pre>';print_r($this->HotelList);
?>
<table class="table tablestyle hotel_list_table">
<tr class="alert alert-graylight">
<th class="small smallbold">S.No.</th>
<th class="small smallbold">Hotel ID</th>
<th class="small smallbold">Hotel Name</th>
<th class="small smallbold">City</th>
<th class="small smallbold" style="display:none;">Area</th>
<th class="small smallbold">Contact Email</th>
<th class="small smallbold">Contact Number</th>
<th class="small smallbold">Category</th>
<th class="small smallbold">Type</th>
<th class="small smallbold">Check in</th>
<th class="small smallbold">Check Out</th>
<?php if($IsShowSupplier == 1) { ?>
<th class="small smallbold">Supplier</th>
<?php } ?>
<th class="small smallbold">Currency</th>
<th class="small smallbold" style="display:none;">Rates</th>
<th class="small smallbold" title="Display on website">DOW</th>
<th class="small smallbold">Action</th>
</tr>
<tbody class="hotel_list_rows">
<?php
$page = $this->page;
$count = 1;
$IsB2CSite = $this->IsB2CSite;
if (!empty($this->paginator) ) {
foreach ($this->paginator as $k => $val) {
$objAccoModel = new Travel_Model_AccommodationModel();
$Rooms = $objAccoModel->HotelRoomDetailsList($val['AccomSysId'], $this->intLoggedinUserAgencySysId);
$RateExist = $objAccoModel->GetRateExist($val['AccomSysId'], $this->intLoggedinUserAgencySysId);
$ICSourceSysId = in_array($val['ICSourceSysId'], array(3, 4)) ? "API" : "Internal";
$Rooms_count = count($Rooms);
if ($page > 1) {
$serialStart = ($this->paginator->getCurrentPageNumber() - 1) * $this->paginator->getItemCountPerPage() + $count;
} else {
$serialStart = ($count);
}
$Active = ($val['IsActive'] == 1) ? 'Active' : 'Deactive';
if ($val['IsActive'] === 1 && $IsB2CSite === 1 && is_array($RateExist) && isset($RateExist['id']) && $RateExist['id'] > 0) {
$dow = '';
} else {
$dow = 'disabled="disabled"';
}
$HotelRateType = isset($val['HotelRateType']) ? $val['HotelRateType'] : '';
// echo '<pre>';print_r($val['HotelRateType']);echo '</pre>';
?>
<tr id="row_<?php echo $val['AccomSysId'] ?>" style="<?php echo ($HotelRateType == 3) ? 'background: #fcfbed': '' ; ?>">
<td class="serialStart"><?php echo ($serialStart); ?></td>
<td><?php echo !empty($val['AccomSysId']) ? $val['AccomSysId'] : '--'; ?></td>
<td><?php echo !empty($val['Title']) ? $val['Title'] : '--'; ?></td>
<td><?php echo !empty($val['City_title']) ? $val['City_title'] : '--'; ?></td>
<td style="display:none;" ><?php echo !empty($val['AreaName']) ? $val['AreaName'] : '--'; ?></td>
<td><?php echo !empty($val['EmailID']) ? $val['EmailID'] : '--'; ?></td>
<td><?php echo !empty($val['PrimaryContact']) ? trim($val['countrycode']).' '.trim($val['PrimaryContact']) : '--'; ?></td>
<td style="display:none;"><?php echo (!empty($ICSourceSysId)) ? $ICSourceSysId : "NA"; ?></td>
<td><?php echo (!empty($val['Stars']) && $val['Stars'] != ".00") ? (int) $val['Stars'] : "NA"; ?> Star</td>
<td><?php echo !empty($val['PropertyType']) ? $arrProprtyType[$val['PropertyType']] : ''; ?></td>
<td><?php echo !empty($val['CheckinTime']) ? trim($val['CheckinTime']) : ''; ?></td>
<td><?php echo !empty($val['CheckOutTime']) ? trim($val['CheckOutTime']) : ''; ?></td>
<?php if($IsShowSupplier == 1) { ?>
<td><?php echo !empty($val['SupplierName']) ? $val['SupplierName'] : ''; ?></td>
<?php } ?>
<td><?php echo !empty($val['Symbol']) ? $val['Symbol'] : ''; ?></td>
<td style="display:none;"><?= count($Rooms); ?></td>
<td style="display:none;"><?= (!empty($RateExist)) ? 'Yes' : 'na' ?> </td>
<td >
<label class="checkbox_popup" id="IsWebsite" title="Display on website">
<input action="content" <?= $dow ?>
onClick="IsWebsite('<?php echo $val['AccomSysId'] ?>');"
id="IsWebsite_<?php echo $val['AccomSysId'] ?>"
<?php echo !empty($val['IsWebsite']) && $val['IsWebsite'] == 1 ? 'checked="checked"' : '' ?>
name="IsWebsite" value="1" class="" type="checkbox">
<span class="checkmark"></span>
<span class="loader<?php echo $val['AccomSysId'] ?>"></span>
</label>
<!--<label class="" id="IsWebsite" title="Display on website"
style="display: inline-table; margin: 0px;">
<input action="content" <?/*= $dow */?>
onClick="IsWebsite('<?php /*echo $val['AccomSysId'] */?>');"
id="IsWebsite_<?php /*echo $val['AccomSysId'] */?>"
<?php /*echo !empty($val['IsWebsite']) && $val['IsWebsite'] == 1 ? 'checked="checked"' : '' */?>
name="IsWebsite" value="1" class="" type="checkbox">
<span class="loader<?php /*echo $val['AccomSysId'] */?>"></span>
</label>-->
</td>
<td nowrap="nowrap">
<?php if(!empty($val['PropertyType']) && ($val['PropertyType']==12)){ ?>
<a href="<?php echo $this->baseUrl('accommodation/add-villas/id'); ?>/<?php echo !empty($val['AccomSysId']) ? $val['AccomSysId'] : ''; ?>"
title="Update Content" class="view_text1 tooltipLink">
<i class="fa fa-pencil-square-o"></i>
</a>
<?php } else { ?>
<a href="<?php echo $this->baseUrl('accommodation/add-hotels/id'); ?>/<?php echo !empty($val['AccomSysId']) ? $val['AccomSysId'] : ''; ?>"
title="Update Content" class="view_text1 tooltipLink">
<i class="fa fa-pencil-square-o"></i>
</a>
<?php } ?>
<?php
if((!empty($IsHotelInventory) && ($IsHotelInventory==1)) || (!empty($IsHotelOnlyRates) && ($IsHotelOnlyRates==1) && ($HotelRateType != 3))) {
if ($Rooms_count > 0) { ?>
<a style="display:none;" href="<?php echo $this->baseUrl('accommodation/rate-card/id'); ?>/<?php echo !empty($val['AccomSysId']) ? $val['AccomSysId'] : ''; ?>"
title="Rates" class="view_text1 tooltipLink">
<i class="fa fa-money" aria-hidden="true"></i>
</a>
<a href="javascript://" onclick="postUrlToAddNewRate(<?php echo !empty($val['AccomSysId']) ? $val['AccomSysId'] : 0; ?>)" title="Rates" class="view_text1 tooltipLink"> <i class="fa fa-money" aria-hidden="true"></i></a>
<?php } else { ?>
<a href="<?php echo $this->baseUrl('accommodation/rate-card/ids'); ?>/<?php echo !empty($val['AccomSysId']) ? $val['AccomSysId'] : ''; ?>/mode/add"
title="Rates" class="view_text1 tooltipLink">
<i class="fa fa-money" aria-hidden="true"></i>
</a>
<?php } } ?>
<?php
if($val['HotelRateType'] != 2) {
if (!empty($RateExist)) { if($val['HotelRateType'] == 1) { ?>
<a style="display:none;" class="view_text1 tooltipLink"
onclick="NewRedirect('<?= $RateExist['AccomSysId'] ?>', '<?= $RateExist['ContSysId'] ?>', '<?= $RateExist['SupplierSysId'] ?>', '<?= date('d-m-Y', strtotime($RateExist['FromDate'])) ?>')"
href="javascript:void(0);" title="View and update rate"><i
class="fa fa-tasks" aria-hidden="true"></i></a>
<!-- <a class="view_text1 tooltipLink"
href="<?php // echo $this->baseUrl('hotel-extra-services/index/hotelId/'); ?><?php // echo !empty($val['AccomSysId']) ? $val['AccomSysId'] : ''; ?>"
title="add extra services"><i class="fa fa-plus"
aria-hidden="true"></i></a>-->
<a class="view_text1 tooltipLink"
href="<?php echo $this->baseUrl('/accommodation/transport-rate-card/id/'); ?><?php echo !empty($val['AccomSysId']) ? $val['AccomSysId'] : ''; ?>"
title="add extra services"><i class="fa fa-plus"
aria-hidden="true"></i>
</a>
<a class="view_text1 tooltipLink"
href="<?php echo $this->baseUrl('inventory-detail/hotel/id/'); ?><?php echo !empty($val['AccomSysId']) ? $val['AccomSysId'] : ''; ?>"
title="View Inventory"><i class="fa fa-th"
aria-hidden="true"></i></a>
<?php } } }
if ($ICSourceSysId == 'Internal') { ?>
<a href="javascript://"
onclick="deleteHotel('<?php echo $val['AccomSysId']; ?>')"
class="view_text1 delete_margin_left tooltipLink" title="Delete Hotel">
<i class="fa fa-minus-circle"></i>
</a>
<?php } ?>
</td>
</tr>
<?php
$count++;
}
} else {
?>
<tr>
<td colspan="10">No record found</td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
<!--Table Wrapper Finish-->
<div class="panel-box clearfix">
<?php if (!empty($this->paginator) ) { ?>
<?php
echo $this->paginationControl($this->paginator, 'Sliding', 'hotel_inventory_pagination.phtml', array(
'DestinationId' => @$this->searchArr['DestinationId'],
'hotelId' => @$this->searchArr['hotelId'],
'supplierId' => @$this->searchArr['supplierId'],
'rating' => @$this->searchArr['rating']
));
?>
<?php } ?>
</div>
</div>
</div>
</div>
<?php
$strToDates = date("d-m-Y", strtotime("+6 day", strtotime(date("Y/m/d"))));
?>
<form method="post" id="NewRedirect" target="_blank"
action="<?php echo $this->baseUrl('accommodation/inventorynew'); ?>">
<input type="hidden" name="ContId" value="" id="CountryId">
<input type="hidden" name="hotel_id" value="" id="hotel_ids">
<input type="hidden" name="SupplierSysId" value="" id="SupplierSysIds">
<input type="hidden" name="fromdate" value="<?= date("d-m-Y") ?>" id="from_date">
<input type="hidden" name="todate" value="<?= $strToDates ?>" id="to_date">
<input type="hidden" name="ratetype" value="2" id="ratetype">
<input type="hidden" name="posteddata">
</form>
</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>
<?php echo $this->render('supplier/add.phtml'); ?>
<!--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/newinventory.js'); ?>"></script>
<script src="<?php echo $this->baseUrl('public/assets/js/bootstrap3-typeahead.js'); ?>"></script>
<script type="text/javascript">
function Active(a) {
//var ele = $('#Active_'+a).prop("checked");
if ($('#Active_' + a).prop("checked") === true) {
var values = 1;
$('#rate_' + a).addClass("hide");
} else if ($('#Active_' + a).prop("checked") === false) {
values = 0;
$('#rate_' + a).removeClass("hide");
}
var type = $('#Active_' + a).attr("action");
//alert(values); return false;
$.ajax({
url: '<?php echo $this->baseUrl('/accommodation/active') ?>',
data: {
hotel_id: a,
val: values,
type: type
},
type: 'POST',
dataType: 'json',
success: function(result) {
if (result.success) {
if (values === 1) {
$("#IsWebsite_" + a).removeAttr("disabled", true);
$('.conactive' + a).html('Active');
} else {
$("#IsWebsite_" + a).removeAttr("checked");
$("#IsWebsite_" + a).attr("disabled", true);
$('.conactive' + a).html('Deactive');
}
alert(result.message);
} else {
alert(result.message);
}
},
error: function(result) {
alert('activation error!!');
}
});
}
function IsWebsite(a) {
//var ele = $('#Active_'+a).prop("checked");
if ($('#IsWebsite_' + a).prop("checked") === true) {
var values = 1;
//$('#rate_'+a).addClass("hide");
} else if ($('#IsWebsite_' + a).prop("checked") === false) {
values = 0;
//$('#rate_'+a).removeClass("hide");
}
//alert(values); return false;
$.ajax({
url: '<?php echo $this->baseUrl('/accommodation/iswebsite') ?>',
data: {
hotel_id: a,
val: values
},
type: 'POST',
dataType: 'json',
beforeSend: function() {
var image =
"<img id='imgId' src='<?php echo $this->baseUrl('public/images/load1.gif'); ?>' style='width: 18px;'>";
$(".loader" + a).html(image);
},
success: function(result) {
if (result.successs) {
$(".loader" + a).hide();
alert(result.message);
} else {
$(".loader" + a).hide();
alert(result.message);
}
},
error: function(result) {
$(".loader" + a).hide();
alert('Is website activation error!!');
}
});
}
function ActiveRate(a) {
//var ele = $('#Active_'+a).prop("checked");
if ($('#ActiveRate_' + a).prop("checked") === true) {
var values = 1;
$('#rate_' + a).addClass("hide");
} else if ($('#ActiveRate_' + a).prop("checked") === false) {
values = 0;
$('#rate_' + a).removeClass("hide");
}
var type = $('#ActiveRate_' + a).attr("action");
$.ajax({
url: '<?php echo $this->baseUrl('/accommodation/active ') ?>',
data: {
hotel_id: a,
val: values,
type: type
},
type: 'POST',
dataType: 'json',
success: function(result) {
if (result.success) {
if (values === 1) {
$('.rtactive' + a).html('Active');
} else {
$('.rtactive' + a).html('Inactive');
}
alert(result.message);
} else {
alert(result.message);
}
},
error: function(result) {
alert('Execution error activation!!');
}
});
}
function getSearchHotelByCityId(cityId) {
if (cityId !== '0') {
$.ajax({
url: '<?php echo $this->baseUrl('/hotel/get-search-hotel-by-city') ?>',
data: {
cityId: cityId
},
type: 'POST',
dataType: 'html',
beforeSend: function() {
//$("#select_hotel").empty();
},
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() {
//$("#select_hotel").empty();
},
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);
//alert(response);
}
});
}
function deleteHotel(n) {
var d = confirm("Are you sure you want to delete this hotel?");
if (d) {
$.ajax({
url: '<?php echo $this->baseUrl("/accommodation/delete-hotel")?>',
data: {
hotelId: n
},
type: 'POST',
dataType: 'html',
beforeSend: function() {},
success: function(response) {
var d = 1;
if (response == 1) {
var t = confirm(
"This hotel has been used in package(s). Are you sure you still want to delete this hotel?"
);
if (t) {
d = 1;
} else {
d = 0;
}
} else {
d = 1
}
if (d == 1) {
$.ajax({
url: '<?php echo $this->baseUrl("/accommodation/delete-hotel-tolist") ?>',
data: {
hotelId: n
},
type: 'POST',
dataType: 'html',
error: function() {},
beforeSend: function() {
},
success: function(response) {
if (response == '1') {
$("#row_" + n).remove();
alert('This hotel successfully deleted');
} else {
alert(
'This hotel is not delete. Please contact to administrator'
);
}
}
});
}
}
});
}
}
function closepopup() {
$("#myModactpopup").hide();
}
function AddHotelDetails(){
$('.AddHotelDetailsHtml').toggle('show');
$('.hotel_list_table').toggleClass('blur');
}
function saveHotelDetails(submittype){
if($('#addhotels input[name="hotel_name"]').val().trim() === ''){
alert('Please enter hotel name');
$('#addhotels input[name="hotel_name"]').focus();return false;
}
if($('#addhotels input[name="select_hotel_city"]').val() === 0 || $('#addhotels input[name="select_hotel_city"]').val().trim() === ''){
alert('Select city name');
$('#addhotels input[name="select_hotel_city_name"]').focus();return false;
}
<?php if(!empty($IsHotelInventory) && $IsHotelInventory==1){ ?>
if($('#addhotels input[name="supplier_name"]').val().trim() === ''){
alert('Please enter Supplier');
$('#addhotels input[name="supplier_name"]').focus();return false;
}
if($('#addhotels select[name="CurrencyType"]').val().trim() === ''){
alert('Select CurrencyType');
$('#addhotels select[name="CurrencyType"]').focus();return false;
}
<?php }?>
var addHotel = $('#addHotel').serialize();
$('.saveaction').attr('disabled',true);
$.ajax({
url: '/accommodation/addupdatehotels',
data: addHotel,
type: 'POST',
dataType: 'json',
error: function() {},
beforeSend: function() {
},
success: function(response) {
$('.hotel_list_table').removeClass('blur');
$('.saveaction').attr('disabled',false);
var hotel_name = $('#hotel_name').val();
var select_hotel_city_name = $('#select_hotel_city_name').val();
var contact_email = $('#contact_email').val();
var Countrycode = $('#Countrycode').val();
var mobile_number = $('#mobile_number').val();
var star_rating = $('#star_rating').val();
var ProprtyType = $('#ProprtyType option:selected').text();
var CheckinTime = $('#CheckinTime').val();
var CheckOutTime = $('#CheckOutTime').val();
var supplier_name = $('#supplier_name').val();
var CurrencyType = $('#CurrencyType option:selected').text();
var html = '<tr id="row_'+response.HotelId+'"><td class="serialStart">-</td><td>'+response.HotelId+'</td><td>'+hotel_name+'</td>'+
'<td>'+select_hotel_city_name+'</td><td>'+contact_email+'</td><td>'+Countrycode+' '+mobile_number+'</td>'+
'<td>'+star_rating+' Star</td><td>'+ProprtyType+'</td><td>'+CheckinTime+'</td><td>'+CheckOutTime+'</td>'+
'<td>'+supplier_name+'</td><td>'+CurrencyType+'</td><td><label class="checkbox_popup" id="IsWebsite" title="Display on website">'+
'<input action="content" disabled="disabled" name="IsWebsite" value="1" class="" type="checkbox"><span class="checkmark"></span></label></td>'+
'<td nowrap="nowrap"><a href="/accommodation/add-hotels/id/'+response.HotelId+'" title="Update Content" class="view_text1 tooltipLink">'+
'<i class="fa fa-pencil-square-o"></i> <i class="fa fa-server-square-o"></i></a>'+
'<a href="javascript://" onclick="postUrlToAddNewRate('+response.HotelId+')" title="Rates" class="view_text1 tooltipLink">'+
' <i class="fa fa-money" aria-hidden="true"></i></a>'+
'<a href="javascript://" onclick="deleteHotel('+response.HotelId+')" class="view_text1 delete_margin_left tooltipLink" title="Delete Hotel">'+
'<i class="fa fa-minus-circle"></i></a></td></tr>';
$('.hotel_list_rows').prepend(html);
$("#addHotel").trigger("reset");
$('#RoomType')[0].selectize.setValue('');
$('.serialStart').each(function(i) {
$(this).html(parseInt(i)+1);
})
if(submittype == 2){
window.location.href = '/accommodation/add-hotels/id/'+response.HotelId+'#!/';
}
}
});
}
$('#select_hotel_city_name').typeahead({
items: 'all',
source: function (query, process) {
//$('.passenger_city').val('');
return $.ajax({
url: '/buyhotel/autosuggestcity',
type: 'post',
data: {query: query},
dataType: 'json',
success: function (result) {
var resultList = result.map(function (item) {
var aItem = {CityId: item.CityId, label: item.label,ContSysId:item.ContId};
return JSON.stringify(aItem);
});
return process(resultList);
}
});
},
sorter: function (items) {
var beginswith = [], caseSensitive = [], caseInsensitive = [], item;
while (aItem = items.shift()) {
var item = JSON.parse(aItem);
if (!item.label.toLowerCase().indexOf(this.query.toLowerCase()))
beginswith.push(JSON.stringify(item));
else if (~item.label.indexOf(this.query))
caseSensitive.push(JSON.stringify(item));
else
caseInsensitive.push(JSON.stringify(item));
}
return beginswith.concat(caseSensitive, caseInsensitive)
},
highlighter: function (obj) {
var item = JSON.parse(obj);
var query = this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, '\\$&');
return item.label.replace(new RegExp('(' + query + ')', 'ig'), function ($1, match) {
return '<strong>' + match + '</strong>'
})
},
updater: function (item) {
var item = JSON.parse(item);
$('#select_hotel_city').val(item.CityId);
$('#select_hotel_country').val(item.ContSysId);
return item.label;
},
minLength: 2
// displayField: 'label',
});
$('#supplier_name').typeahead({
items: 'all',
showHintOnFocus: true,
minLength: 3,
source: function(query, process) {
if (query.replace(/ /g, '').length > 2) {
$('#hidden_selected_supplier_sys_id').val('');
return $.ajax({
url: '/flight/get-supplier-auto-search',
type: 'post',
//async: false,
data: {
query: query
},
dataType: 'json',
success: function(result) {
var resultList = result.map(function(item) {
var aItem = {
SupplierSysId: item.SupplierSysId,
CurrencyType: item.CurrencyType,
label: item.label,
value: item.value,
};
return JSON.stringify(aItem);
});
return process(resultList);
}
});
}
},
sorter: function(items) {
var beginswith = [],
caseSensitive = [],
caseInsensitive = [],
item;
if(items.length == 0){
items = ['{"SupplierSysId":"0","label":"Add new Supplier","value":"Add new Supplier"}'];
}
while (aItem = items.shift()) {
var item = JSON.parse(aItem);
if (!item.label.toLowerCase().indexOf(this.query.toLowerCase()))
beginswith.push(JSON.stringify(item));
else if (~item.label.indexOf(this.query))
caseSensitive.push(JSON.stringify(item));
else
caseInsensitive.push(JSON.stringify(item));
}
return beginswith.concat(caseSensitive, caseInsensitive)
},
highlighter: function(obj) {
var item = JSON.parse(obj);
var query = this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, '\\$&');
return item.label.replace(new RegExp('(' + query + ')', 'ig'), function($1, match) {
return '<strong>' + match + '</strong>'
})
},
updater: function(item) {
var item = JSON.parse(item);
if(item.SupplierSysId == 0){
$("#hidden_selected_supplier_sys_id").val(item.SupplierSysId);
$("#supplier_name").val('');
addNewSupplierPopup();
}else{
$("#hidden_selected_supplier_sys_id").val(item.SupplierSysId);
if(item.CurrencyType > 0){
$(".SupplierCurrencyType").val(item.CurrencyType);
$(".SupplierCurrencyType option").removeAttr('hidden');
$(".SupplierCurrencyType option").each(function () {
if ($(this).val() != item.CurrencyType) {
$(this).attr('hidden', true);
}
})
}
return item.value;
}
},
afterSelect: function(item) {
$('#supplier_name').typeahead('close', {
showHintOnFocus: false,
minLength: 3,
});
}
// displayField: 'label',
});
function addNewSupplierPopup() {
document.getElementById("frmAddSupplierInventory").reset();
$("#supplier-popup-error-message-box").hide();
//$("#hidden_module_name").val('package');
// $("#CitySysId").html('<option value="0">Select</option>');
$("#addNewSupplierForm").modal();
}
other_loc_city_multiautosuggest('RoomType');
function other_loc_city_multiautosuggest(inputId) {
$("#" + inputId).selectize({
onInitialize: function () {
var existingOptions = JSON.parse(this.$input.attr('data-selectize-values'));
//console.log(existingOptions);
var self = this;
if (Object.prototype.toString.call(existingOptions) === "[object Array]") {
existingOptions.forEach(function (existingOption) {
self.addOption(existingOption);
self.addItem(existingOption[self.settings.valueField]);
});
} else if (typeof existingOptions === 'object') {
self.addOption(existingOptions);
self.addItem(existingOptions[self.settings.valueField]);
}
},
preload: true,
//options: [],
openOnFocus: false,
valueField: 'RoomType',
labelField: 'label',
searchField: 'label',
create: true,
render: {
option: function (item, escape) {
return '<div>' + escape(item.label) + '</div>';
}
},
load: function (query, callback) {
$.ajax({
url: '/publicpackage/suggest-room-type',
type: 'post',
data: {query: query},
dataType: 'json',
success: function (result) {
callback(result);
}
});
},
});
}
function postUrlToAddNewRate(AccomSysId){
var form = '';
form += '<input type="hidden" name="hid" value="' + AccomSysId + '">';
$('<form target="_blank" action="/accommodation/inventory" method="POST">'+form+'</form>').appendTo($(document.body)).submit();
}
function changeRateType(){
var RateType = $('#NetRateType').val();
if(RateType == 0){
$('.CommissionableRateDiv').show();
}else{
$('.CommissionableRateDiv').hide();
}
}
</script>