function xtraBookingDrawCalendar(canvas, cal_id){ $(canvas).update(''); new Ajax.Request('http://www.lescarrozchalets.com/wp-content/plugins/xtra_booking_calendars/draw_calendar.php?calendar_id=' + cal_id, { method:'post', parameters: {}, onSuccess: function(transport){ $(canvas).update(transport.responseText); }, onFailure: function(){ alert('Something went wrong...'); } }); } function xtraBookingDrawCalendarByDate(canvas, cal_id, cmonth, cyear, hide_controls){ $(canvas).update(''); new Ajax.Request('http://www.lescarrozchalets.com/wp-content/plugins/xtra_booking_calendars/draw_calendar.php?calendar_id=' + cal_id + '&month=' + cmonth + '&year=' + cyear + '&hide_controls=' + hide_controls, { method:'post', parameters: {}, onSuccess: function(transport){ $(canvas).update(transport.responseText); }, onFailure: function(){ alert('Something went wrong...'); } }); } function xtraBookingCheckDay(ts){ if($('chkbx_' + ts).checked){ $('chkbx_' + ts).checked = false; $('td_' + ts).removeClassName('booked_day'); $('td_' + ts).addClassName('free_day'); } else { $('chkbx_' + ts).checked = true; $('td_' + ts).removeClassName('free_day'); $('td_' + ts).addClassName('booked_day'); } } function xtraBookingSaveCalendarBookData(frm_data){ $('xtra_book_save_data_spinner_id').show(); new Ajax.Request('http://www.lescarrozchalets.com/wp-content/plugins/xtra_booking_calendars/dispatcher.php', { method:'post', parameters: frm_data, onSuccess: function(transport){ $('xtra_book_message_holder').update(transport.responseText); $('xtra_book_save_data_spinner_id').hide(); }, onFailure: function(){ alert('Something went wrong...'); $('xtra_book_save_data_spinner_id').hide(); } }); } function xtraBookingDrawUserCalendar(canvas, calendar_id, rdate){ $(canvas).update(''); var rdim = rdate.split('.'); var rmonth = rdim[0]; var ryear = rdim[1]; new Ajax.Request('http://www.lescarrozchalets.com/wp-content/plugins/xtra_booking_calendars/dispatcher.php', { method:'post', parameters: {'calendar_id' : calendar_id, 'rmonth' : rmonth, 'ryear' : ryear, 'action' : 'drawUserCalendar'}, onSuccess: function(transport){ $(canvas).update(transport.responseText); }, onFailure: function(){ alert('Something went wrong...'); } }); } function xtraBookingSavePriceRange(frm_data){ $('xtra_book_cal_prices').update(''); new Ajax.Request('http://www.lescarrozchalets.com/wp-content/plugins/xtra_booking_calendars/dispatcher.php', { method:'post', parameters: frm_data, onSuccess: function(transport){ $('xtra_book_cal_prices').update(transport.responseText); }, onFailure: function(){ alert('Something went wrong...'); } }); } function xtraBookingRemovePriceRange(cal_id, range_id){ if(confirm('Are you sure you want to delete it?')){ $('xtra_book_cal_prices').update(''); new Ajax.Request('http://www.lescarrozchalets.com/wp-content/plugins/xtra_booking_calendars/dispatcher.php', { method:'post', parameters: {'calendar_id' : cal_id, 'range_id' : range_id, 'action' : 'rmCalendarPrice'}, onSuccess: function(transport){ $('xtra_book_cal_prices').update(transport.responseText); }, onFailure: function(){ alert('Something went wrong...'); } }); } }