var list_booking_id_for_show = []; var prices_per_day = []; var cost_curency = ''; var wpdev_bk_weekday_conditions_for_range_selection = []; var wpdev_bk_seasons_conditions_for_range_selection = []; var wpdev_bk_seasons_conditions_for_start_day = []; var bk_2clicks_mode_days_selection__saved_variables = []; // Saved initial values of varibales: bk_2clicks_mode_days_specific , bk_2clicks_mode_days_min, bk_2clicks_mode_days_max function addBKForm(param){ document.getElementById('bk_form_plus').style.display='none'; document.getElementById('bk_form_addbutton').style.display='block'; setTimeout(function ( ) { jQuery('#booking_form_new_name').focus(); } ,100); } function delete_bk_form(form_name){ var wpdev_ajax_path = wpdev_bk_plugin_url+'/' + wpdev_bk_plugin_filename; //Ajax adding new type to the DB document.getElementById('ajax_working').innerHTML = '
\n\
Deleting...
\n\
\n\ \n\
\n\
'; jQuery.ajax({ // Start Ajax Sending // url: wpdev_ajax_path, url: wpbc_ajaxurl, type:'POST', success: function (data, textStatus){if( textStatus == 'success') jQuery('#ajax_respond').html( data );}, error:function (XMLHttpRequest, textStatus, errorThrown){window.status = 'Ajax sending Error status:'+ textStatus;alert(XMLHttpRequest.status + ' ' + XMLHttpRequest.statusText);if (XMLHttpRequest.status == 500) {alert('Please check at this page according this error:' + ' http://wpbookingcalendar.com/faq/#ajax-sending-error');}}, // beforeSend: someFunction, data:{ // ajax_action : 'DELETE_BK_FORM', action : 'DELETE_BK_FORM', formname : form_name, wpbc_nonce: document.getElementById('wpbc_admin_panel_nonce').value } }); return false; } function changeBookingFormForAdvancedCost(selectObj){ var idx = selectObj.selectedIndex; var my_form = selectObj.options[idx].value; jQuery('.wpdev_forms_div').hide(); jQuery( '#' + my_form ).show(); } function changeBookingForm(selectObj){ var idx = selectObj.selectedIndex; var my_form = selectObj.options[idx].value; var loc = location.href; if (loc.substr((loc.length-1),1)=='#') { loc = loc.substr(0,(loc.length-1) ); } if ( loc.indexOf('booking_form=') == -1 ) { loc = loc + '&booking_form=' +my_form;} else { // Alredy have this paremeter at URL var start = loc.indexOf('&booking_form='); var fin = loc.indexOf('&', (start+15)); if (fin == -1) {loc = loc.substr(0,start) + '&booking_form=' +my_form;} // at the end of row else { // at the middle of the row var loc1 = loc.substr(0,start) + '&booking_form=' +my_form;//alert(loc) loc = loc1 + loc.substr(fin); } } location.href = loc; } function changeFilter(selectObj){ var idx = selectObj.selectedIndex; // get the value of the selected option var which = selectObj.options[idx].value; var loc = location.href; if ( loc.indexOf('sybtypefilter=') == -1 ) { loc = location.href + '&sybtypefilter=' +which;} else { // Alredy have this paremeter at URL var start = loc.indexOf('&sybtypefilter='); var fin = loc.indexOf('&', (start+15)); if (fin == -1) {loc = loc.substr(0,start) + '&sybtypefilter=' +which;} // at the end of row else { // at the middle of the row var loc1 = loc.substr(0,start) + '&sybtypefilter=' +which;//alert(loc) loc = loc1 + loc.substr(fin); } } location.href = loc; } function filterBookingRowsApply(){ // alert(list_booking_id_for_show); hide_bk_rows = []; for(var i=0; i'; return tooltip_time + cost_curency + prices_per_day[bk_type][td_class] ; } } return tooltip_time ; } // Admin panel - Add additional row with cost, which is depends from number of selected days function addRowForCustomizationCostDependsFromNumSellDays(row__id) { jQuery('#cost_days_row_help'+row__id ).html( getRowForCustomizationCostDependsFromNumSellDays(row__id)) ; } function getRowForCustomizationCostDependsFromNumSellDays(row__id) { return ''; } function addRowForCustomizationCostDependsFromNumSellDays4Summ(row__id) { jQuery('#cost_days_row_help'+row__id ).html( getRowForCustomizationCostDependsFromNumSellDays4Summ(row__id)) ; } function getRowForCustomizationCostDependsFromNumSellDays4Summ(row__id) { return ''; } function getBookingFormElements(bk_type){ var submit_form = document.getElementById('booking_form' + bk_type ); var formdata = ''; if (submit_form != null) { var count = submit_form.elements.length; var inp_value; var element; var el_type; // Serialize form here for (i=0; i