App.order = App.cable.subscriptions.create('BillChannel', {
//	App.messages = App.cable.subscriptions.create('MessagesChannel', {  

  connected: function() {},

  disconnected: function() {},

  received: function(data) { 
    var hostname = location.hostname.trim();
    if(data.from == "" || hostname == data.from)
    {
    	if($('.table_'+data.table.id).hasClass('blue')){
    		$('.table_'+data.table.id).removeClass('blue');
       	$('.table_'+data.table.id).addClass('red');
    	}else{
    		$('.table_'+data.table.id).removeClass('orange');
       	$('.table_'+data.table.id).addClass('red');
    	} 
      $('.new_text_'+data.table.id).removeClass('hide');
      $('.new_text_'+data.table.id).text('billed');
    }
 }
});

