function recycler_showCustomers_() {

	var from =document.getElementById("recycler_report_from").value;
	var to =document.getElementById("recycler_report_to").value;

	console.log(from);
	console.log(to);

	$.ajax({
		type : 'GET',
		url : 'create/get_customers/'+from+"/"+to,
		/*data : {
			'_token' : $('meta[name="csrf-token"]').attr('content')
		},
		headers: {
			'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
		  },*/
		
		success : function(data) {
			console.log("data.customers_", data.customers_);
			var sel = $('#recycler_customer_id').empty();
			 $('#resycler_supplier_id').empty();
			var customers = data.customers_ ;
			sel.append('<option> Choose Customer</option>');
			 
			for (var i = 0; i < customers.length; ++i) {
				sel.append('<option value="' + customers[i].customer.id + '">' + customers[i].customer.name + '</option>');			
			}
	  console.log(data);
		},
		error : function(request, status, error) {
			console.log(error);
		}
	});
}

function showSuppliers_() {
		var from =document.getElementById("recycler_report_from").value;
		var to =document.getElementById("recycler_report_to").value;
		var customer_id=$("#recycler_customer_id").val();

		 

		$.ajax({
			type : 'GET',
			url : 'create/show_suppliers/' + customer_id +"/"+from+"/"+to,
			/*data : {
				'_token' : $('meta[name="csrf-token"]').attr('content')
			},
			headers: {
				'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
			  },*/
			
			success : function(data) {
				console.log("data.suppliers", data.suppliers_);
				var sel = $('#resycler_supplier_id').empty();
			     $('#resycler_supplier_id').empty();
				var suppliers = data.suppliers_ ;
				sel.append('<option> Choose Suppliers</option>');
				console.log(suppliers.length);
				for (var i = 0; i < suppliers.length; ++i) {
					sel.append('<option value="' + suppliers[i].supplier.id + '">' + suppliers[i].supplier.name + '</option>');			
				}
		  console.log(data);
			},
			error : function(request, status, error) {
				console.log(error);
			}
		});
	}

	function showWastes_() {

	var from =document.getElementById("recycler_report_from").value;
	var to =document.getElementById("recycler_report_to").value;
	var customer_id=$("#recycler_customer_id").val();
	var arr_of_suppliers=$("#resycler_supplier_id").val();
        
	$.ajax({
		type : 'GET',
		url : 'create/show_wastes/'+ arr_of_suppliers+"/"+customer_id +"/"+from+"/"+to,
		/*data : {
			'_token' : $('meta[name="csrf-token"]').attr('content')
		},
		headers: {
			'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
		  },*/
		
		success : function(data) {
			console.log("data.wastes_", data.wastes_);
			var sel = $('#resycler_waste_id').empty();
			 $('#resycler_waste_id').empty();
			var wastes = data.wastes_ ;
			sel.append('<option> Choose Wastes</option>');
			for (var i = 0; i < wastes.length; ++i) {
				sel.append('<option value="' + wastes[i].waste.id + '">' + wastes[i].waste.name + '</option>');			
			}
	  console.log(data); 
	  
		},
		error : function(request, status, error) {
			console.log(error);
		}
	});
  
		 
	}
	