Midas Parts Centre - Queenstown - MyDestination (2024)

Send an Enquiry

'); } }) .done(function (html) { $("#roomSelect").html(html); var bookingId = '0'; if (bookingId == '') { bookingId = $("#bookingIdSelected").val(); } $('#accommodationTotal').attr('data-total', 0); $('#accommodationTotal').html(formatMoney(0)); calcTotal(); //checkAvailable('en_US', bookingId, 'enquiryForm', 'Available', 'Not Available'); //getPriceCalc('en_US', bookingId, 'enquiryForm', 'bookingTotal', 'bookingTotalPayable', 'bookingTotalPaid'); docReady(); }); } function backClick(backTab) { if ($('#backDetailsButton').length <= 0) { return false; } $('#backDetailsButton').click(function () { $('#' + backTab).click(); }); } function nextClick() { var tabName = 'contactDetailsTab'; if (hasOptions) { tabName = 'roomItemsTab'; } $('#' + tabName).click(); } function bookRoom(bookButton) { $('#establishment_enquiry_room_ids').val(bookButton.attr('data-room-id')); $('#establishment_enquiry_room_names').val(bookButton.attr('data-room-names')); $('#accommodationTotal').html(formatMoney(bookButton.attr('data-total'))); $('#accommodationTotal').attr('data-total', bookButton.attr('data-total')); calcTotal(); nextClick(); getItenerary(); return false; } function bookPackage(bookButton) { $('#establishment_enquiry_room_ids').val(bookButton.attr('data-room-ids')); $('#establishment_enquiry_room_names').val(bookButton.attr('data-room-names')); $('#accommodationTotal').html(formatMoney(bookButton.attr('data-total'))); $('#accommodationTotal').attr('data-total', bookButton.attr('data-total')); calcTotal(); nextClick(); getItenerary(); return false; } function getItenerary() { refreshInProgress = $.ajax({ url: Routing.generate('iga_travel_booking_itenerary', {cultureString: 'en_US'}), data: $('#enquiryForm').serialize(), cache: false, beforeSend: function () { $("#travelItenerary").html('

Midas Parts Centre - Queenstown - MyDestination (2)

Loading itenerary

'); } }) .done(function (html) { $("#travelItenerary").html(html); }); } function setGuestChildCount() { var noGuests = 0; var noChildren = 0; for (rCnt = 0; rCnt < roomCnt; rCnt++) { noGuests += parseInt($('#establishment_enquiry_number_of_guests_' + rCnt).val()); noChildren += parseInt($('#establishment_enquiry_number_of_children_' + rCnt).val()); } $('#establishment_enquiry_number_of_guests').val(noGuests); $('#establishment_enquiry_number_of_children').val(noChildren); } function setRoomCount() { roomCnt = parseInt($('#establishment_enquiry_number_of_rooms').val()); if (roomCnt > 1) { $('#switchRoomView').fadeOut('slow'); } else { $('#switchRoomView').fadeIn('slow'); } var firstRoom = $('#travelRoomAround').html(); var allRooms = ''; for (rCnt = 1; rCnt < roomCnt; rCnt++) { var oneRoom = findAndReplace(firstRoom, 'oom 1', 'oom ' + (rCnt + 1)); oneRoom = findAndReplace(oneRoom, 'oom_0', 'oom_' + rCnt); oneRoom = findAndReplace(oneRoom, 'guests_0', 'guests_' + rCnt); oneRoom = findAndReplace(oneRoom, 'children_0', 'children_' + rCnt); allRooms += oneRoom; } $('#travelRoomsMore').html(allRooms); for (rCnt = 0; rCnt < roomCnt; rCnt++) { //console.log(rCnt + ' - ' + parseInt($('#establishment_enquiry_number_of_guests_0').val()) + ' - ' + parseInt($('#establishment_enquiry_number_of_guests_' + rCnt).val()) + ' - #establishment_enquiry_number_of_guests_' + rCnt); if (rCnt > 0 && parseInt($('#establishment_enquiry_number_of_guests_0').val()) > 1 && ($('#establishment_enquiry_number_of_guests_' + rCnt).val() == '' || parseInt($('#establishment_enquiry_number_of_guests_' + rCnt).val()) <= 0)) { $('#establishment_enquiry_number_of_guests_0').val(parseInt($('#establishment_enquiry_number_of_guests_0').val()) - 1); $('#establishment_enquiry_number_of_guests_' + rCnt).val(1); } if ($('#establishment_enquiry_number_of_guests_' + rCnt).val() == '' || parseInt($('#establishment_enquiry_number_of_guests_' + rCnt).val()) <= 0) { $('#establishment_enquiry_number_of_guests_' + rCnt).val(1); } if ($('#establishment_enquiry_number_of_children_' + rCnt).val() == '' || parseInt($('#establishment_enquiry_number_of_children_' + rCnt).val()) <= 0) { $('#establishment_enquiry_number_of_children_' + rCnt).val(0); } //if (parseInt($('#establishment_enquiry_number_of_children_' + rCnt).val()) <= 0) { // $('#establishment_enquiry_number_of_children_' + rCnt).val(0); //} $('#establishment_enquiry_number_of_guests_' + rCnt).off('change'); $('#establishment_enquiry_number_of_guests_' + rCnt).change(function () { setGuestChildCount(); refreshRooms(groupByTypeMain); }); $('#establishment_enquiry_number_of_children_' + rCnt).off('change'); $('#establishment_enquiry_number_of_children_' + rCnt).attr('room-cnt', rCnt); setChildAges($('#establishment_enquiry_number_of_children_' + rCnt)); $('#establishment_enquiry_number_of_children_' + rCnt).change(function () { setGuestChildCount(); thisRoomCnt = $(this).attr('room-cnt'); setChildAges($(this)); refreshRooms(groupByTypeMain); }); } //for setGuestChildCount(); } function setChildAges(childrenInput) { var firstChild = $('#childAge').html(); var allChildren = ''; var numChildren = parseInt(childrenInput.val()); var roomCnt = parseInt(childrenInput.attr('room-cnt')); childrenSelected[roomCnt] = new Array(); $('.children').each(function () { if ($(this).attr('room-cnt') == 'room_cnt' || $(this).attr('child-cnt') == 'child_cnt') { return; } var thisRoom = parseInt($(this).attr('room-cnt')); //console.log('Populating selected ages: ' + thisRoom + ' == ' + roomCnt); if (thisRoom == roomCnt) { childrenSelected[thisRoom][childrenSelected[thisRoom].length] = $(this).val(); } }); for (chCnt = 0; chCnt < numChildren; chCnt++) { var oneChild = findAndReplace(firstChild, ' 0 ', ' ' + (chCnt + 1) + ' '); //oneChild = findAndReplace(oneChild, 'child_age"', 'child_age" required'); oneChild = findAndReplace(oneChild, 'room_cnt', roomCnt); oneChild = findAndReplace(oneChild, 'child_cnt', chCnt); oneChild = findAndReplace(oneChild, 'child_age', 'child_age_' + chCnt + '_room_' + roomCnt); allChildren += oneChild; } $('#childAges_room_' + roomCnt).html(allChildren); //console.log(childrenSelected); $('.children').each(function () { if ($(this).attr('room-cnt') == 'room_cnt' || $(this).attr('child-cnt') == 'child_cnt') { return; } $(this).change(function () { refreshRooms(groupByTypeMain); }); var thisRoom = parseInt($(this).attr('room-cnt')); var childCnt = parseInt($(this).attr('child-cnt')); if (thisRoom == roomCnt) { //console.log(thisRoom + ' == ' + roomCnt + ' child: ' + childCnt + ' setting age: ' + childrenSelected[thisRoom][childCnt]); $('#establishment_enquiry_child_age_' + childCnt + '_room_' + roomCnt).val(childrenSelected[thisRoom][childCnt]); } }); } function docReady() { $('.bookNow').each(function () { $(this).click(function () { bookRoom($(this)); return false; }) }); $('.bookPackageNow').each(function () { $(this).click(function () { bookPackage($(this)); return false; }) }); $('#ratesButton').click(function () { $('#contactDetailsTab').click(); }); } function changeRoomItem(bookingItemId) { console.log(bookingItemId); checkBox = $('#roomItem_' + bookingItemId + '_booked'); if (checkBox.is(':checked')) { if ($('#roomItem_' + bookingItemId + '_adults').length > 0) { $('#roomItem_' + bookingItemId + '_adults').attr('required', 1); if ($('#roomItem_' + bookingItemId + '_adults').val() <= 0) { $('#roomItem_' + bookingItemId + '_adults').val(1); } } if ($('#roomItem_' + bookingItemId + '_children').length > 0) { $('#roomItem_' + bookingItemId + '_children').attr('required', 1); if ($('#roomItem_' + bookingItemId + '_children').val() <= 0) { $('#roomItem_' + bookingItemId + '_children').val(0); } } if ($('#roomItem_' + bookingItemId + '_date_time').length > 0) { $('#roomItem_' + bookingItemId + '_date_time').attr('required', 1); if ($('#roomItem_' + bookingItemId + '_date_time').val() == '') { $('#roomItem_' + bookingItemId + '_date_time').val($('#establishment_enquiry_start_date').val()); } } } else { if ($('#roomItem_' + bookingItemId + '_adults').length > 0) { $('#roomItem_' + bookingItemId + '_adults').removeAttr('required'); } if ($('#roomItem_' + bookingItemId + '_children').length > 0) { $('#roomItem_' + bookingItemId + '_children').removeAttr('required'); } if ($('#roomItem_' + bookingItemId + '_date_time').length > 0) { $('#roomItem_' + bookingItemId + '_date_time').removeAttr('required'); } } calcTotal(); } function calcTotal() { var optionsTotal = 0; var roomItemId = ''; $('.roomItem').each(function () { if ($(this).is(':checked')) { if ($(this).attr('data-choose-guests') > 0) { roomItemId = $(this).attr('data-id'); //console.log('Options now: ' + optionsTotal); optionsTotal += parseFloat($(this).attr('data-price-per-guest')) * parseInt($('#roomItem_' + roomItemId + '_adults').val()); //console.log('Options after adults: ' + optionsTotal); if ($(this).attr('data-choose-children') > 0) { optionsTotal += parseFloat($(this).attr('data-price-per-child')) * parseInt($('#roomItem_' + roomItemId + '_children').val()); } //console.log($(this).attr('data-price-per-guest') + ' per guest = ' + optionsTotal); } else { optionsTotal += parseFloat($(this).attr('data-price')); } } }); $('#optionsTotal').html(formatMoney(optionsTotal)); $('#optionsTotal').attr('data-total', optionsTotal); $('#bookingTotal').html(formatMoney(parseFloat($('#accommodationTotal').attr('data-total')) + parseFloat($('#optionsTotal').attr('data-total')))); if (parseFloat($('#accommodationTotal').attr('data-total')) + parseFloat($('#optionsTotal').attr('data-total')) > 0) { $('#bookingTotalBlockMessage').attr('style', 'display: none;'); $('#bookingTotalBlock').removeAttr('style'); } else { $('#bookingTotalBlock').attr('style', 'display: none;'); $('#bookingTotalBlockMessage').removeAttr('style'); } } $(document).ready(function () { $.datepicker.setDefaults($.datepicker.regional[ "" ]); $(".datepicker").datepicker({ dateFormat: 'dd-mm-yy', changeMonth: true, changeYear: true }); $(".datetimepicker").datetimepicker({ format: 'Y-m-d H:i', dateFormat: 'Y-m-d', timeFormat: 'HH:mm', changeMonth: true, changeYear: true, changeTime: true }); $('#establishment_enquiry_start_date').change(function () { moveEndDate($('#establishment_enquiry_start_date'), $('#establishment_enquiry_end_date'), $('#establishment_enquiry_duration')); var startDate = stringToDate($('#establishment_enquiry_start_date').val(), 'dd-mm-yyyy', '-'); var endDate = stringToDate($('#establishment_enquiry_end_date').val(), 'dd-mm-yyyy', '-'); if (checkDates(startDate, endDate, 'Check-in date can not be after check-out date', 'Check-in date can not be before')) { calculateDuration(startDate, endDate, $('#establishment_enquiry_duration')); refreshRooms(groupByTypeMain); } }); $('#establishment_enquiry_end_date').change(function () { var startDate = stringToDate($('#establishment_enquiry_start_date').val(), 'dd-mm-yyyy', '-'); var endDate = stringToDate($('#establishment_enquiry_end_date').val(), 'dd-mm-yyyy', '-'); if (checkDates(startDate, endDate, 'Check-in date can not be after check-out date', 'Check-in date can not be before')) { calculateDuration(startDate, endDate, $('#establishment_enquiry_duration')); refreshRooms(groupByTypeMain); } } ); $('#establishment_enquiry_duration').change(function () { moveEndDate($('#establishment_enquiry_start_date'), $('#establishment_enquiry_end_date'), $('#establishment_enquiry_duration')); var startDate = stringToDate($('#establishment_enquiry_start_date').val(), 'dd-mm-yyyy', '-'); var endDate = stringToDate($('#establishment_enquiry_end_date').val(), 'dd-mm-yyyy', '-'); if (checkDates(startDate, endDate, 'Check-in date can not be after check-out date', 'Check-in date can not be before')) { refreshRooms(groupByTypeMain); } } ); $('#establishment_enquiry_number_of_rooms').change(function () { setRoomCount(); refreshRooms(groupByTypeMain); }); $('#switchRoomView').click(function () { if ($(this).attr('data-group-by-type') == 1) { $(this).attr('data-group-by-type', 0); $(this).html('Show Room Types'); refreshRooms(0); groupByTypeMain = 0; } else { $(this).attr('data-group-by-type', 1); $(this).html('Show Individual Rooms'); refreshRooms(1); groupByTypeMain = 1; } return false; }); setRoomCount(); refreshRooms(1); $('.roomItem').each(function () { $(this).change(function () { changeRoomItem($(this).attr('data-id')); }); changeRoomItem($(this).attr('data-id')); }); $('.guestsChildren').each(function () { $(this).change(calcTotal); }); $('#optionsButton').click(function () { $('.roomItem').each(function () { bookingItemId = $(this).attr('data-id'); if ($(this).is(':checked')) { if ($('#roomItem_' + bookingItemId + '_adults').length > 0 && $('#roomItem_' + bookingItemId + '_adults').val() <= 0) { $('#roomItem_' + bookingItemId + '_adults').focus(); alert('Please specify number of adults'); return; } if ($('#roomItem_' + bookingItemId + '_date_time').length > 0 && $('#roomItem_' + bookingItemId + '_date_time').val() == '') { $('#roomItem_' + bookingItemId + '_date_time').focus(); alert('Please specify date and time'); return; } } }); $('#contactDetailsTab').click(); }); backClick('ratesTab'); });

Midas Parts Centre - Queenstown - MyDestination (2024)
Top Articles
Latest Posts
Article information

Author: Amb. Frankie Simonis

Last Updated:

Views: 5362

Rating: 4.6 / 5 (76 voted)

Reviews: 91% of readers found this page helpful

Author information

Name: Amb. Frankie Simonis

Birthday: 1998-02-19

Address: 64841 Delmar Isle, North Wiley, OR 74073

Phone: +17844167847676

Job: Forward IT Agent

Hobby: LARPing, Kitesurfing, Sewing, Digital arts, Sand art, Gardening, Dance

Introduction: My name is Amb. Frankie Simonis, I am a hilarious, enchanting, energetic, cooperative, innocent, cute, joyous person who loves writing and wants to share my knowledge and understanding with you.