| 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
$fromdatepost = $this->fromdate;
$todatepost = $this->todate;
$my_arr = $this->rateCardList;
$period = $this->period;
$hotelDetails = $this->hotelDetails;
$rowFromDate = array_values($my_arr['rowFromDate']);
$hotelname = !empty($hotelDetails['Title']) ? $hotelDetails['Title'] . ', ' . $hotelDetails['City_title'] : '';
//echo '<pre>';print_r($this->searchArr);echo '</pre>';die;
function searchForDate($date, $array) {
foreach ($array as $key => $val) {
if ($val['FromDate'] === $date) {
return $key;
}
}
return null;
}
$Suppliername = Zend_Controller_Action_HelperBroker::getStaticHelper('Supplier')->getSupplierName($this->searchArr['SupplierSysId']);
$datewiseArray = isset($this->rateCardList['datewiseArray']) ? $this->rateCardList['datewiseArray'] : array();
$RoomDetailsList = isset($this->RoomDetailsList) ? $this->RoomDetailsList : array();
//echo '<pre>';print_r($RoomDetailsList);echo '</pre>';die;
?>
<link rel="stylesheet" href="<?php echo $this->baseUrl('public/assets/css/plugins/fullcalendar/fullcalendar.css'); ?>">
<!--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="active">Accommodation</li><li class="active">Inventory Manage </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>
<style>
.remark-pub {
background:#cc4707;
padding:1px 3px;
color:#fff;
font-size:13px;
text-decoration:none;
width: 65px;
display: block;
}
.remark-net {
background:#39ac73;
padding:1px 3px;
color:#fff;
font-size:13px;
text-decoration:none;
width: 65px;
display: block;
}
.remark-pub1 {
background:#cc4707;
padding:1px 3px;
color:#fff;
font-size:13px;
text-decoration:none;
}
.remark-net1 {
background:#39ac73;
padding:1px 3px;
color:#fff;
font-size:13px;
text-decoration:none;
}
</style>
<!-- Main Content Element Start-->
<div class="row">
<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">
<!--<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>-->
<!--<span style="float:left; margin-left:5px; text-decoration: none;">Supplier - <?= $Suppliername ?></span>-->
<a href="<?php echo $this->baseUrl('accommodation/manage'); ?>" class="btn btn-danger btn-sm"><i class="fa fa-fw fa-arrows"></i> My Hotel</a>
<a href="<?php echo $this->baseUrl('accommodation/add-hotels'); ?>" class="btn btn-danger btn-sm"><i class="fa fa-fw fa-arrows"></i> Add Hotel</a>
<a href="<?php echo $this->baseUrl('accommodation/inventory'); ?>" class="btn btn-danger btn-sm"><i class="fa fa-fw fa-arrows"></i> Hotel Rates List</a>
<a href="<?php echo $this->baseUrl('accommodation/rate-card'); ?>" class="btn btn-warning btn-sm"><i class="fa fa-fw fa-arrows"></i> Add Hotel Rates</a>
</div>
<div class="col-md-12 no-padding" style="margin-top: 10px;">
<?php //echo '<pre>';print_r($my_arr);echo '</pre>'; ?>
<form name="searchinven" id="searchinven" class="" role="form" method="post" action="<?php echo $this->baseUrl('accommodation/inventory-calendar'); ?>">
<input type="hidden" name="posteddata">
<div>
<div class="col-md-2">
<div class="form-group active">
<label>From Date <span class="red">*</span></label>
<div class="input-group ls-group-input">
<input class="form-control fromdate" type="text" name="fromdate" id="fromdate" value="<?= $this->searchArr['fromdate'] ?>"/>
<span class="input-group-addon dateTimePickerCustom1" ><i class="fa fa-calendar"></i></span>
</div>
</div>
</div>
<div class="col-md-2">
<div class="form-group active">
<label>To Date <span class="red">*</span></label>
<div class="input-group ls-group-input">
<input class="form-control todate" type="text" name="todate" id="todate" value="<?= $this->searchArr['todate'] ?>"/>
<span class="input-group-addon dateTimePickerCustom1" ><i class="fa fa-calendar"></i></span>
</div>
</div>
</div>
<div class="col-md-3">
<div class="form-group active">
<label>Hotel </label>
<input type="text" name="hotel_name" id="hotel_name" value="<?= !empty($this->searchArr['hotel_name']) ? $this->searchArr['hotel_name'] : $hotelname ?>" class="form-control whbg">
<input type="hidden" name="hotel_id" id="hidden_selected_hotel_id" value="<?= $this->searchArr['hotel_id'] ?>">
</div>
</div>
<div class="col-md-2 ">
<div class="form-group active" id="roomTypeData">
<label>Room Type</label>
<select id="room_type" name="room_type" class="demo-default select-country" placeholder="Select room types" >
<option value="">Select</option>
<?php
foreach ($RoomDetailsList as $key => $val) {
echo '<option value="' . $val['room']['RoomTypeId'] . '" '.((int)$this->searchArr['room_type']==(int)$val['room']['RoomTypeId'] ? 'selected' : '').'>' . trim($val['room']['RoomType']) . '</option>';
}
?>
</select>
</div>
</div>
<div class="col-md-1 no-padding">
<div class="form-group">
<!--<label> </label>
<br>-->
<button type="submit" class="btn btn-warning saveaction" >Search</button>
</div>
</div>
</div>
</form>
<div class="col-md-12">
<div id='calendar'></div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="modal fade" id="myModactpopup" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
</div>
<div class="modal fade" id="myModactpopupbulk" 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';
foreach ($datewiseArray as $key => $value) {
$PublishQtyColumn = array_column($value, 'PublishQty');
$PublishQty = array_sum($PublishQtyColumn);
$BlockQtyColumn = array_column($value, 'BlockQty');
$BlockQty = array_sum($BlockQtyColumn);
$SoldQtyColumn = array_column($value, 'SoldQty');
$SoldQty = array_sum($SoldQtyColumn);
$NetInHandQtyColumn = array_column($value, 'NetInHandQty');
$NetInHandQty = array_sum($NetInHandQtyColumn);
$title = 'Inventory: ' . $PublishQty . ',Block: ' . $BlockQty . ', Sold: ' . $SoldQty . ', Net In Hand: ' . $NetInHandQty;
$hotel_id = '';
if($this->searchArr['hotel_id']>0){
$hotel_id = '/hid/'.$this->searchArr['hotel_id'];
}
$room_type = '';
if($this->searchArr['room_type']>0){
$room_type = '/rtp/'.$this->searchArr['room_type'];
}
$inputArray[] = array(
'title' => $title,
'start' => $key,
'end' => $key,
'url' => $this->baseUrl('/accommodation/inventory-calendar-detail/date/' . $key.$hotel_id.$room_type),
);
}
$fromdateArray = (isset($this->searchArr['fromdate'])) ? explode('-', $this->searchArr['fromdate']) : '';
//echo "<pre>";print_r($array_key_first);die('mangal');
$dateArray = json_encode($inputArray);
$todofromdate = '';
$defaultDate = '';
$year = $fromdateArray['2'];
$month = $fromdateArray['1'] - 1;
$day = $fromdateArray['0'];
?>
<script type="text/javascript" src='<?php echo $this->baseUrl('public/assets/js/moment.min.js'); ?>'></script>
<script type="text/javascript" src='<?php echo $this->baseUrl('public/assets/js/fullcalendar.min.js'); ?>'></script>
<script type="text/javascript">
var posteddata = '<?php echo json_encode($this->searchArr); ?>';
</script>
<script src="<?php echo $this->baseUrl('public/js/hotel/newinventory.js'); ?>"></script>
<script type="text/javascript">
$(function () {
function getFormattedDateC(date) {
var getdates = new Date(date.getFullYear(), date.getMonth() + 1, date.getDate() - 1);
var year = getdates.getFullYear();
var month = (1 + getdates.getMonth()).toString();
month = month.length > 1 ? month : '0' + month;
var day = getdates.getDate().toString();
day = day.length > 1 ? day : '0' + day;
//return getdates.getFullYear()+"/"+(1+getdates.getMonth())+"/"+getdates.getDate();
return day + '-' + month + '-' + year;
}
fromdate = $('#fromdate').datetimepicker({
timepicker: false,
datepicker: true,
formatDate: 'd-m-Y',
format: 'd-m-Y',
// minDate: 0,
mask: true,
defaultSelect: false,
onChangeDateTime: function (d) {
var day = d.getDate();
var day2 = d.getDate();
var month = d.getMonth() + 2;
var year = d.getFullYear();
todate.datetimepicker({value: getFormattedDateC(d)});
todate.datetimepicker({minDate: day + "-" + month + "-" + year});
todate.datetimepicker({maxDate: day2 + "-" + month + "-" + year});
},
});
todate = $('#todate').datetimepicker({
timepicker: false,
datepicker: true,
defaultDate: false,
formatDate: 'd-m-Y',
format: 'd-m-Y',
mask: true,
defaultSelect: false,
onChangeDateTime: function (d) {
},
onShow: function (ct) {
var day = ct.getDate();
var day2 = ct.getDate();
var month = ct.getMonth() + 2;
var year = ct.getFullYear();
this.setOptions({
value: ($('#todate').val() != '' && $('#todate').val() != '') ? $('#todate').val() : '',
minDate: ($('#fromdate').val() != '' && $('#fromdate').val() != '') ? $('#fromdate').val() : false,
});
}
});
});
$(document).ready(function () {
$('#calendar').fullCalendar({
month: '<?php echo $month; ?>',
year: '<?php echo $year; ?>',
day: '<?php echo $day; ?>',
header: {
left: '',
center: 'title',
right: ''
},
dayClick: function (date, allDay, jsEvent, view) {
var moment2 = $('#calendar').fullCalendar('getDate');
d1 = date.getDate();
m1 = date.getMonth();
y1 = date.getFullYear();
d2 = moment2.getDate();
m2 = moment2.getMonth();
y2 = moment2.getFullYear();
var firstDate = d1 + '/' + m1 + '/' + y1;
var secondDate = d2 + '/' + m2 + '/' + y2;
if (date <= moment2) {
if (firstDate == secondDate) {
$('#myModaladdCustomer').modal({
show: 'true'
});
var formDate = $.fullCalendar.formatDate(date, 'dd/MM/yyyy HH:mm:ss');
$("#todostartdate").val(formDate);
$("#todoenddate").datetimepicker({
minDate: formDate,
});
} else {
return false;
}
}
//var title = prompt('Event Title:');
$('#myModaladdCustomer').modal({
show: 'true'
});
var formDate = $.fullCalendar.formatDate(date, 'dd/MM/yyyy HH:mm:ss');
$("#todostartdate").val(formDate);
$("#todoenddate").datetimepicker({
minDate: formDate,
});
/**
* again : ajax call to store event in DB
*/
},
eventClick: function (calEvent, jsEvent, view) {
//alert('Event: ' + calEvent.title);
//alert('Coordinates: ' + jsEvent.pageX + ',' + jsEvent.pageY);
//alert('View: ' + view.name);
//$(this).attr('data-target','#test');
// change the border color just for fun
$(this).css('border-color', 'red');
},
eventRender: function (event, element) {
// element.attr('data-toggle', "modal");
// element.attr('data-target', "#myModalviewToDoDetail");
element.attr('href', $(this).attr('href'));
},
//defaultView: 'agendaWeek',
defaultDate: '2022-01-02',
navLinks: true, // can click day/week names to navigate views
select: function (start, end, allDay) {
bootbox.prompt("Event name?", function (result) {
if (result === null) {
} else {
full_calendar.fullCalendar('renderEvent',
{
title: result,
start: start,
end: end,
allDay: allDay
},
true // make the event "stick"
);
}
full_calendar.fullCalendar('unselect');
});
},
editable: false,
eventLimit: true, // allow "more" link when too many events
events: <?php echo $dateArray; ?>,
droppable: true, // this allows things to be dropped onto the calendar !!!
drop: function (date, allDay) { // this function is called when something is dropped
//console.log("Dropped on " + date + " with allDay=" + allDay);
// retrieve the dropped element's stored Event Object
var originalEventObject = $(this).data('eventObject');
// we need to copy it, so that multiple events don't have a reference to the same object
var copiedEventObject = $.extend({}, originalEventObject);
// assign it the date that was reported
copiedEventObject.start = date;
copiedEventObject.allDay = allDay;
// render the event on the calendar
// the last `true` argument determines if the event "sticks" (http://arshaw.com/fullcalendar/docs/event_rendering/renderEvent/)
$('#full-calendar').fullCalendar('renderEvent', copiedEventObject, true);
// is the "remove after drop" checkbox checked?
if ($('#drop-remove').is(':checked')) {
// if so, remove the element from the "Draggable Events" list
$(this).remove();
}
},
eventDragStart: eventDragStart,
/*events: "json-events.php",*/
loading: function (bool) {
if (bool)
$('#loading').show();
else
$('#loading').hide();
}
});
});
function full_calendar_control() {
'use strict';
$('button.addEvent').click(function () {
bootbox.prompt("Draggable Event name?", function (result) {
if (result != null && result != "") {
var $html = "<div class='external-event'>" + result + "</div>";
$("div.eventList").append($html);
dragablaeElementSet();
}
});
});
$trash.droppable({
drop: function (event, ui) {
/*console.log(event);*/
/*console.log($(ui));*/
$(ui.draggable).remove();
$('#trash').removeClass('active');
}
});
}
function eventDragStart(event, jsEvent, ui, view) {
'use strict';
/*console.log(event);
console.log(jsEvent);
console.log(ui);
console.log(view);*/
}
function dragablaeElementSet() {
'use strict';
$('#external-events div.external-event').each(function () {
// create an Event Object (http://arshaw.com/fullcalendar/docs/event_data/Event_Object/)
// it doesn't need to have a start or end
var eventObject = {
title: $.trim($(this).text()) // use the element's text as the event title
};
// store the Event Object in the DOM element so we can get to it later
$(this).data('eventObject', eventObject);
// make the event draggable using jQuery UI
$(this).draggable({
zIndex: 999,
revert: true, // will cause the event to go back to its
revertDuration: 0, // original position after the drag
start: startDraging,
stop: stopDraging
});
});
}
function startDraging() {
'use strict';
$('#trash').addClass('active');
}
function stopDraging() {
'use strict';
$('#trash').removeClass('active');
}
function filterValidation() {
var todofromdate = $.trim($("#todofromdate").val());
var todotodate = $.trim($("#todotodate").val());
if (todofromdate == '' || todofromdate == '__/__/____') {
alert('From date can not be empty.');
$("#todofromdate").focus();
return false;
}
if (todotodate == '' || todotodate == '__/__/____') {
alert('To date can not be empty.');
$("#todotodate").focus();
return false;
}
}
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);
}
});
}
}
$("#supplier_name").autocomplete({
source: '/flight/get-supplier-auto-search',
minLength: 2,
select: function (event, ui) {
var SupplierSysId = ui.item.SupplierSysId;
if (SupplierSysId === 0)
{
$("#hidden_selected_supplier_sys_id").val(SupplierSysId);
$("#supplier_name").val('');
} else {
$("#hidden_selected_supplier_sys_id").val(SupplierSysId);
}
}
});
$("#CountryName").autocomplete({
source: '/hotel/get-country-auto-search',
minLength: 2,
select: function (event, ui) {
var CountryId = ui.item.ContId;
$("#ContId").val(CountryId);
}
});
$("#hotel_name").focus(function () {
var country = $("#CountryName").val();
var ContId = $("#ContId").val();
if ((country == '0' || country == '')) {
//$.notify({title: 'Please select country.'}, {position:'top center',style: 'metro',className: 'error',hideDuration: 100});
alert("Please select country");
$("#CountryName").focus();
return false;
}
if ((country == '0' || country == '') || (ContId == '0' || ContId == '')) {
$.notify({title: 'Please select valid country.'}, {position: 'top center', style: 'metro', className: 'error', hideDuration: 100});
//alert("Please select valid country");
$("#CountryName").focus();
return false;
}
});
$("input[name=hotel_name]").autocomplete({
source: function (request, response) {
$.getJSON("/hotel/autosuggestnew", {term: request.term, countryId: $("#ContId").val()},
response);
},
focus: function (event, ui) {
event.preventDefault();
$("#tags").val(ui.item.label);
},
messages: {
noResults: '',
results: function () {}
},
minLength: 3,
select: function (event, ui) {
event.preventDefault();
if (ui.item.value == '-1') {
$("#hidden_new_hotel_added_via_page").val('BULK');
window.open('/accommodation/add-hotels', '_blank');
//addNewHotelPopup();
} else {
$("input[name=hotel_name]").val(ui.item.label);
$("#hidden_selected_hotel_id").val(ui.item.value).trigger('change');
}
var AccomSysId = $("#hidden_selected_hotel_id").val();
checkHotelRoomType(AccomSysId);
}
});
function checkHotelRoomType(AccomSysId) {
$.ajax({
url: '/accommodation/check-hotel-roomtype',
data: {
AccomSysId: AccomSysId
},
type: 'POST',
dataType: 'html',
error: function() {},
beforeSend: function() {
},
success: function(response) {
var shtmldata = '<label>Room Type</label><select id="room_type" name="room_type" class="demo-default select-state" placeholder="Select room types"><option value="">Select</option>';
shtmldata += response;
shtmldata += '</select>';
$('#roomTypeData').html(shtmldata);
$('#room_type').selectize({
maxItems: 1,
create: true
});
console.log(response);
}
});
}
</script>