jQuery(window).load(function() {		
  jQuery(".fbbttm-loading").fadeOut("slow");
});	
function delete_confirm() {
	"use strict";
    if(jQuery('.checkbox:checked').length > 0){
        var result = confirm('Are you sure you want to delete ?');
        if (result){
            return true;
        }
        else {
            return false;
        }
    }
}
function status_confirm() {
	"use strict";
    if(jQuery('.checkbox:checked').length > 0){
        var result = confirm('Are you sure want to change the booking status ?');
        if (result){
            return true;
        }
        else {
            return false;
        }
    }
}
jQuery(document).ready(function(){
	"use strict";
    jQuery('#select_all').on('click',function(){
        jQuery("#delete").addClass("removeall");
        if(this.checked){
            jQuery('.checkbox').each(function(){
                this.checked = true;
            });
        }else{
             jQuery('.checkbox').each(function(){
                this.checked = false;
            });
        }
    });
    
    jQuery('.checkbox').on('click',function(){
        if(jQuery('.checkbox:checked').length == jQuery('.checkbox').length){
            jQuery('#select_all').prop('checked',true);
        }else{
            jQuery('#select_all').prop('checked',false);
        }
    });

        jQuery('#edit').on('click',function(e){
            e.preventDefault();
            jQuery('#update_form').modal('toggle');
    
        });




});
setTimeout(function fbbttm_user_insert_data() {
	"use strict";
      jQuery( ".fbbttm-popconfirm" ).hide();
    }, 4000);

jQuery(document).ready(function () {
	"use strict";
        jQuery('#datepicker').datepicker({
            format: 'dd-mm-yyyy',
            startDate: '+1d',
            defaultDate: -1,
            minDate:'0',
            beforeShowDay: function(date) {
        var day = date.getDay();
        return [(day != 0), ''];
    }
        });

   

        jQuery('.tab-content section').hide();
        jQuery('.tab-content section:first').show();
        jQuery('#fbbttm-tab li:first').addClass('tab-active');

        // Change tab class and display content
        jQuery('#fbbttm-tab .nav-item a').on('click', function(event){
          event.preventDefault();
          jQuery('#fbbttm-tab li').removeClass('tab-active');
          jQuery(this).parent().addClass('tab-active');
          jQuery('.tab-content section').hide();
          jQuery(jQuery(this).attr('href')).show();
        });


    });


(function () {
    "use strict";
    var showResults;
    jQuery('#search-box').keyup(function () {
        var searchText;
        searchText = jQuery('#search-box').val();
        return showResults(searchText);
    });
    showResults = function (searchText) {
        jQuery('tbody tr').hide();
        return jQuery('tbody tr:Contains(' + searchText + ')').show();
    };
    jQuery.expr[':'].Contains = jQuery.expr.createPseudo(function (arg) {
        return function (elem) {
            return jQuery(elem).text().toUpperCase().indexOf(arg.toUpperCase()) >= 0;
        };
    });
}.call(this));

