' ,marker_class:content_class,marker_text:content,ipcp_id: data.ipcp_area_id,id: data.id}); ilogs_widget_8537_09d778086ce439a4f7220f6b433bcc68_markers.push(marker); ilogs_widget_8537_09d778086ce439a4f7220f6b433bcc68_marker_ids.push(data.id);marker.addListener('click', function() {if('' == 'Y') {var modal = jQuery('div#ilogs_widget_8537_09d778086ce439a4f7220f6b433bcc68_detailmodal').iziModal({title: json.name,headerColor: '#2A5B55',closeOnEscape: true,zindex: 40999,padding: 20,width: 750,bodyOverflow: true,onOpening: function(modal) { modal.startLoading(); jQuery.get('https://www.ecolonial.com/wp-admin/admin-ajax.php?action=simplefacility&id=' + data.id + "&praefix=ilogs_widget_8537_09d778086ce439a4f7220f6b433bcc68" , function(data) { jQuery("div#ilogs_widget_8537_09d778086ce439a4f7220f6b433bcc68_detailmodal .iziModal-content").html(data); modal.stopLoading(); }); },onClosed: function() {jQuery('div#ilogs_widget_8537_09d778086ce439a4f7220f6b433bcc68_detailmodal').iziModal('destroy');},});modal.iziModal('open');} else {if (ilogs_widget_8537_09d778086ce439a4f7220f6b433bcc68_infowindow) { ilogs_widget_8537_09d778086ce439a4f7220f6b433bcc68_infowindow.close(); }jQuery.ajax({url: 'https://www.ecolonial.com/wp-admin/admin-ajax.php?action=mapinfo&type=',action: "mapinfo",data: "id="+data.id + "&type="+jQuery('input[name=type]').val(),success: function (infodata) {var w = jQuery(window).width();if(w<=576) {var modal = jQuery('div#ilogs_widget_8537_09d778086ce439a4f7220f6b433bcc68_mapinfomodal').iziModal({title: data.name,headerColor: '#2A5B55',closeOnEscape: true,zindex: 40999,padding: 20,width: 750,bottom: 10,appendTo: 'div#ilogs_widget_8537_09d778086ce439a4f7220f6b433bcc68',onOpening: function(modal){ jQuery("div#ilogs_widget_8537_09d778086ce439a4f7220f6b433bcc68_mapinfomodal .iziModal-content").html(infodata);},onClosed: function() {jQuery('div#ilogs_widget_8537_09d778086ce439a4f7220f6b433bcc68_mapinfomodal input').datetimepicker( "destroy" );jQuery('div#ilogs_widget_8537_09d778086ce439a4f7220f6b433bcc68_mapinfomodal').iziModal('destroy');},});modal.iziModal('open');} else {ilogs_widget_8537_09d778086ce439a4f7220f6b433bcc68_infowindow.setContent(infodata);ilogs_widget_8537_09d778086ce439a4f7220f6b433bcc68_infowindow.open(ilogs_widget_8537_09d778086ce439a4f7220f6b433bcc68_map, marker);}ilogs_widget_8537_09d778086ce439a4f7220f6b433bcc68_initDetailClick(); }});}}); } });if(ilogs_widget_8537_09d778086ce439a4f7220f6b433bcc68_type == 'daily') {ilogs_widget_8537_09d778086ce439a4f7220f6b433bcc68_doPriceCalculate();} }, complete: function() { ilogs_widget_8537_09d778086ce439a4f7220f6b433bcc68_isSearchRun = false; } });}function ilogs_widget_8537_09d778086ce439a4f7220f6b433bcc68_initDetailClick() {ilogs_widget_8537_09d778086ce439a4f7220f6b433bcc68_syncCalendar();jQuery('#ilogs_widget_8537_09d778086ce439a4f7220f6b433bcc68 a.detail').on('click', function (event) {event.preventDefault();var fromDate = jQuery('#ilogs_widget_8537_09d778086ce439a4f7220f6b433bcc68_period_from').datepicker( "getDate" );var toDate = jQuery('#ilogs_widget_8537_09d778086ce439a4f7220f6b433bcc68_period_to').datepicker( "getDate" );var act = new Date();if(!ilogs_widget_8537_09d778086ce439a4f7220f6b433bcc68_isValidDate(fromDate)) {fromDate =act; } if(!ilogs_widget_8537_09d778086ce439a4f7220f6b433bcc68_isValidDate(toDate)) { var to = new Date(); to.setHours(to.getHours() + 2); toDate=to; }var f_id = jQuery( this ).data( "id" );var f_name = jQuery( this ).data( "facilityname" );var modal = jQuery('div#ilogs_widget_8537_09d778086ce439a4f7220f6b433bcc68_detailmodal').iziModal({title: f_name,headerColor: '#2A5B55',closeOnEscape: true,zindex: 40999,padding: 20,width: 750,bodyOverflow: true,onOpening: function(modal) { modal.startLoading(); jQuery.get('https://www.ecolonial.com/wp-admin/admin-ajax.php?action=simplefacility&id=' + f_id + "&showdates=Y&praefix=ilogs_widget_8537_09d778086ce439a4f7220f6b433bcc68&showdmb=&startdate="+encodeURIComponent(fromDate.toLocaleString())+"&enddate="+encodeURIComponent(toDate.toLocaleString()) , function(data) { jQuery("div#ilogs_widget_8537_09d778086ce439a4f7220f6b433bcc68_detailmodal .iziModal-content").html(data); modal.stopLoading(); }); },onClosed: function() {jQuery('div#ilogs_widget_8537_09d778086ce439a4f7220f6b433bcc68_detailmodal').iziModal('destroy');},});modal.iziModal('open');});// reserve button jQuery( "#ilogs_widget_8537_09d778086ce439a4f7220f6b433bcc68 a.reserve" ).click(function(event) {event.preventDefault();var fromDate = jQuery('#ilogs_widget_8537_09d778086ce439a4f7220f6b433bcc68_period_from').datepicker( "getDate" );var toDate = jQuery('#ilogs_widget_8537_09d778086ce439a4f7220f6b433bcc68_period_to').datepicker( "getDate" );var act = new Date();if(!ilogs_widget_8537_09d778086ce439a4f7220f6b433bcc68_isValidDate(fromDate)) {fromDate =act; } if(!ilogs_widget_8537_09d778086ce439a4f7220f6b433bcc68_isValidDate(toDate)) { var to = new Date(); to.setHours(to.getHours() + 2); toDate=to; }var link = jQuery(this).attr('href');var query = "begin_time=" + ilogs_widget_8537_09d778086ce439a4f7220f6b433bcc68_addZero(fromDate.getHours()) + ":" + ilogs_widget_8537_09d778086ce439a4f7220f6b433bcc68_addZero(fromDate.getMinutes());query = query + "&begin_date=" + fromDate.getFullYear() + "-" + ilogs_widget_8537_09d778086ce439a4f7220f6b433bcc68_addZero(fromDate.getMonth()+1) + "-" + ilogs_widget_8537_09d778086ce439a4f7220f6b433bcc68_addZero(fromDate.getDate());query = query + "&end_time=" + ilogs_widget_8537_09d778086ce439a4f7220f6b433bcc68_addZero(toDate.getHours()) + ":" + ilogs_widget_8537_09d778086ce439a4f7220f6b433bcc68_addZero(toDate.getMinutes());query = query + "&end_date=" + toDate.getFullYear() + "-" + ilogs_widget_8537_09d778086ce439a4f7220f6b433bcc68_addZero(toDate.getMonth()+1) + "-" + ilogs_widget_8537_09d778086ce439a4f7220f6b433bcc68_addZero(toDate.getDate());window.open(link + "&" + query, '_blank');});}function ilogs_widget_8537_09d778086ce439a4f7220f6b433bcc68_fetchPriceCalculation(fetchids,fromDate,toDate) {if (fetchids.length == 0) {return;}console.log("fetchids / " + fetchids.join(',') + " - " + fromDate + "/" + toDate);var query = "startdate=" + fromDate.toLocaleString() + "&enddate=" + toDate.toLocaleString() + "&fetchids=" + fetchids.join(',');jQuery.ajax({ type: "get", url: "https://www.ecolonial.com/wp-admin/admin-ajax.php?action=calculateprice", action: "calculateprice",data: query,dataType: 'json', success: function(json, status, jqXHR) { jQuery.each(json, function (key, data) { console.log("ipcpId = " + data.ipcpId); ilogs_widget_8537_09d778086ce439a4f7220f6b433bcc68_markers.forEach(function(marker){ if(marker.ipcp_id > 0 && marker.ipcp_id==data.ipcpId) { marker.setContent('
' + data.currency + " " + data.amount/100 + '
'); marker.marker_text = data.currency + " " + data.amount/100;}}); }); }, error: function (xhr,status,errorThrown) { console.log('An error occurred.'); console.log('xhr.responseText= ' + xhr.responseText); console.log('xhr.status= ' + xhr.status); console.log('status= ' + status); console.log('errorThrown= ' + errorThrown); } });}function ilogs_widget_8537_09d778086ce439a4f7220f6b433bcc68_fetchSinglePriceCalculation(fetchid,fromDate,toDate,marker,type) {console.log("fetchSindlePriceCalculation / " + fetchid+ " - " + fromDate + "/" + toDate);var query = "type=" + type + "&startdate=" + fromDate.toLocaleString() + "&enddate=" + toDate.toLocaleString() + "&id=" + fetchid;jQuery.ajax({ type: "get", url: "https://www.ecolonial.com/wp-admin/admin-ajax.php?action=calculatesingleprice", action: "calculatesingleprice",data: query,dataType: 'json', success: function(json, status, jqXHR) { var mclass = marker.marker_class; if(typeof json.open !== 'undefined') { if(json.open) { mclass = "marker_open"; if(json.reservable) { mclass = "marker_reservable"; } } else { mclass = "marker_closed"; } } else { mclass = "marker_open"; } price = json.price; if(price=='') { price = "P"; } marker.setContent('
' + price + '
'); }, error: function (data) { console.log('An error occurred.'); console.log(data); }, });}function ilogs_widget_8537_09d778086ce439a4f7220f6b433bcc68_locationMarker() {}function ilogs_widget_8537_09d778086ce439a4f7220f6b433bcc68_updateMarkers() {ilogs_widget_8537_09d778086ce439a4f7220f6b433bcc68_syncCalendar();var fromDate = jQuery('#ilogs_widget_8537_09d778086ce439a4f7220f6b433bcc68_period_from').datepicker( "getDate" );var toDate = jQuery('#ilogs_widget_8537_09d778086ce439a4f7220f6b433bcc68_period_to').datepicker( "getDate" );ilogs_widget_8537_09d778086ce439a4f7220f6b433bcc68_markers.forEach(function(marker){var query = "period_from=" + fromDate.toLocaleString() + "&period_to=" + toDate.toLocaleString() +"&id=" + marker.remoteid;jQuery.ajax({ type: "get", url: "https://www.ecolonial.com/wp-admin/admin-ajax.php?action=mapmarker", action: "mapmarker", data: query, dataType: 'json', success: function(json, status, jqXHR) { var mclass = "marker_open"; if(typeof json.open !== 'undefined') { if(json.open) { mclass = "marker_open";if(json.reservable) { mclass = "marker_reservable"; } } else { mclass = "marker_closed"; } } else { mclass = "marker_open"; } if (json.contractprice !== "" && ilogs_widget_8537_09d778086ce439a4f7220f6b433bcc68_type == "monthly") {marker.marker_text = json.contractprice;} else {marker.marker_text = "P";} marker.setContent('
' + marker.marker_text + '
'); }, error: function (data) { console.log('An error occurred.'); console.log(data); }, complete: function (jqXHR, status) { console.log("type" + ilogs_widget_8537_09d778086ce439a4f7220f6b433bcc68_type); if(ilogs_widget_8537_09d778086ce439a4f7220f6b433bcc68_type == 'daily') {setTimeout(function(){ ilogs_widget_8537_09d778086ce439a4f7220f6b433bcc68_doPriceCalculate() }, 500);} }});});}function ilogs_widget_8537_09d778086ce439a4f7220f6b433bcc68_addMarker(id, checkbounds) {ilogs_widget_8537_09d778086ce439a4f7220f6b433bcc68_syncCalendar();var fromDate = jQuery('#ilogs_widget_8537_09d778086ce439a4f7220f6b433bcc68_period_from').datepicker( "getDate" );var toDate = jQuery('#ilogs_widget_8537_09d778086ce439a4f7220f6b433bcc68_period_to').datepicker( "getDate" );var query = "period_from=" + fromDate.toLocaleString() + "&period_to=" + toDate.toLocaleString() + "&id=" + id;jQuery.ajax({ type: "get", url: "https://www.ecolonial.com/wp-admin/admin-ajax.php?action=mapmarker", action: "mapmarker", data: query, dataType: 'json', success: function(json, status, jqXHR) { var mclass = "marker_open"; if(typeof json.open !== 'undefined') { if(json.open) { mclass = "marker_open";if(json.reservable) { mclass = "marker_reservable"; } } else { mclass = "marker_closed"; } } else { mclass = "marker_open"; } var content = "P"; var marker = new RichMarker({map: ilogs_widget_8537_09d778086ce439a4f7220f6b433bcc68_map,shadow: '2px 2px 10px rgba(88,88,88,0.7)',anchor: RichMarkerPosition.MIDDLE,position: new google.maps.LatLng(json.latitude, json.longitude),content: '
' + content + '
' ,marker_class:mclass,marker_text:content,ipcp_id: json.ipcp_area_id,id: json.id,remoteid:id});ilogs_widget_8537_09d778086ce439a4f7220f6b433bcc68_markers.push(marker); marker.addListener('click', function() {if('' == 'Y') {var modal = jQuery('div#ilogs_widget_8537_09d778086ce439a4f7220f6b433bcc68_detailmodal').iziModal({title: json.name,headerColor: '#2A5B55',closeOnEscape: true,zindex: 40999,padding: 20,width: 750,bodyOverflow: true,onOpening: function(modal) { modal.startLoading(); jQuery.get('https://www.ecolonial.com/wp-admin/admin-ajax.php?action=simplefacility&id=' + json.id + "&praefix=ilogs_widget_8537_09d778086ce439a4f7220f6b433bcc68" , function(data) { jQuery("div#ilogs_widget_8537_09d778086ce439a4f7220f6b433bcc68_detailmodal .iziModal-content").html(data); modal.stopLoading(); }); },onClosed: function() {jQuery('div#ilogs_widget_8537_09d778086ce439a4f7220f6b433bcc68_detailmodal').iziModal('destroy');},});modal.iziModal('open');} else {if (ilogs_widget_8537_09d778086ce439a4f7220f6b433bcc68_infowindow) { ilogs_widget_8537_09d778086ce439a4f7220f6b433bcc68_infowindow.close(); }jQuery.ajax({url: 'https://www.ecolonial.com/wp-admin/admin-ajax.php?action=mapinfo&type=',action: "mapinfo",data: "id="+ json.id + "&type="+jQuery('input[name=type]').val(),success: function (infodata) {var w = jQuery(window).width();if(w<=576) {var modal = jQuery('div#ilogs_widget_8537_09d778086ce439a4f7220f6b433bcc68_mapinfomodal').iziModal({title: json.name,headerColor: '#2A5B55',closeOnEscape: true,zindex: 40999,padding: 20,width: 750,bottom: 10,appendTo: 'div#ilogs_widget_8537_09d778086ce439a4f7220f6b433bcc68',onOpening: function(modal){ jQuery("div#ilogs_widget_8537_09d778086ce439a4f7220f6b433bcc68_mapinfomodal .iziModal-content").html(infodata);},onClosed: function() {jQuery('div#ilogs_widget_8537_09d778086ce439a4f7220f6b433bcc68_mapinfomodal input').datetimepicker( "destroy" );jQuery('div#ilogs_widget_8537_09d778086ce439a4f7220f6b433bcc68_mapinfomodal').iziModal('destroy');},});modal.iziModal('open');} else {ilogs_widget_8537_09d778086ce439a4f7220f6b433bcc68_infowindow.setContent(infodata);ilogs_widget_8537_09d778086ce439a4f7220f6b433bcc68_infowindow.open(ilogs_widget_8537_09d778086ce439a4f7220f6b433bcc68_map, marker);}ilogs_widget_8537_09d778086ce439a4f7220f6b433bcc68_initDetailClick(); }});}}); }, error: function (data) { console.log('An error occurred.'); console.log(data); }, complete: function (jqXHR, status) {if(ilogs_widget_8537_09d778086ce439a4f7220f6b433bcc68_type == 'daily') {setTimeout(function(){ ilogs_widget_8537_09d778086ce439a4f7220f6b433bcc68_doPriceCalculate() }, 500);} }});}var ilogs_widget_8537_09d778086ce439a4f7220f6b433bcc68_markers = [];var ilogs_widget_8537_09d778086ce439a4f7220f6b433bcc68_marker_ids = [];var ilogs_widget_8537_09d778086ce439a4f7220f6b433bcc68_map;function ilogs_widget_8537_09d778086ce439a4f7220f6b433bcc68_initMap() {ilogs_widget_8537_09d778086ce439a4f7220f6b433bcc68_infowindow = new google.maps.InfoWindow({content: "Content...",maxWidth: 350});console.log('Google Maps API version: ' + google.maps.version);var initlat = 38.88707507800965;var initlng = -77.09536720912558;var initzoom = 16;var divid = "ilogs_widget_8537_09d778086ce439a4f7220f6b433bcc68_map";ilogs_widget_8537_09d778086ce439a4f7220f6b433bcc68_map = new google.maps.Map(document.getElementById(divid), { center: { lat: initlat, lng: initlng }, mapTypeId: 'roadmap', scrollwheel: true, fullscreenControl: false, zoom: initzoom }); var opt = { minZoom: 4, maxZoom: 19, clickableIcons: false };ilogs_widget_8537_09d778086ce439a4f7220f6b433bcc68_map.setOptions(opt);}//]]>