function chart_report_showSuppliers_() {

	var from =document.getElementById("chart_report_from").value;
	var to =document.getElementById("chart_report_to").value;
	console.log( from ,"  " ,  to );
        
	$.ajax({
		type : 'GET',
		url : 'create/get_suppliers/' +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 = $('#chart_supplier_id').empty();
			 $('#chart_supplier_id').empty();
			 $('#chart_class_id').empty();
			 $('#chart_group_id').empty();
			 $('#chart_classification_id').empty();
			var suppliers = data.suppliers_ ;
			sel.append('<option> Choose Supplier</option>');
			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 chart_report_showClasses_(  ) {

		var from =document.getElementById("chart_report_from").value;
		var to =document.getElementById("chart_report_to").value;
		
		var supplier_id=$("#chart_supplier_id").val();

		console.log( from ,"  " ,  to , " " , supplier_id);

		$.ajax({
			type : 'GET',
			url : 'create/get_classes/' +supplier_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 = $('#chart_class_id').empty();
				 $('#chart_class_id').empty();
				$('#chart_group_id').empty();
				$('#chart_classification_id').empty();
				var classes = data.classes_ ;
				sel.append('<option> Choose Class</option>');
				for (var i = 0; i < classes.length; ++i) {
					sel.append('<option value="' + classes[i].id + '">' + classes[i].name + '</option>');			
				}
		  console.log(data); 
		  
			},
			error : function(request, status, error) {
				console.log(error);
			}
		});
	  
			 
		}


function chart_report_showGroups_() {

	var from =document.getElementById("chart_report_from").value;
	var to =document.getElementById("chart_report_to").value;
	var supplier_id=$("#chart_supplier_id").val();
	var class_id=$("#chart_class_id").val();
	console.log( from ,"  " ,  to , " " ,  supplier_id , "  " ,class_id  );
        
	$.ajax({
		type : 'GET',
		url : 'create/get_groups/' +supplier_id +"/"+class_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.groups_", data.groups_);
			var sel = $('#chart_group_id').empty();
			 	$('#chart_group_id').empty();
				$('#chart_classification_id').empty();
			var groups = data.groups_ ;
			sel.append('<option> Choose Group</option>');
			for (var i = 0; i < groups.length; ++i) {
				sel.append('<option value="' + groups[i].id + '">' + groups[i].name + '</option>');			
			}
	  console.log(data); 
	  
		},
		error : function(request, status, error) {
			console.log(error);
		}
	});
  
		 
	}


	
function chart_report_showClassifications_() {

	var from =document.getElementById("chart_report_from").value;
	var to =document.getElementById("chart_report_to").value;
	var supplier_id=$("#chart_supplier_id").val();
	var class_id=$("#chart_class_id").val();
	var group_id=$("#chart_group_id").val();
	console.log( from ,"  " ,  to , " " ,  supplier_id , "  " ,class_id ," ",  group_id );
        
	$.ajax({
		type : 'GET',
		url : 'create/get_classifications/' +supplier_id +"/"+class_id+"/"+group_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.classifications_", data.classifications_);
			var sel = $('#chart_classification_id').empty();
			 $('#chart_classification_id').empty();
			var classifications = data.classifications_ ;
			sel.append('<option> Choose Classification</option>');
			for (var i = 0; i < classifications.length; ++i) {
				sel.append('<option value="' + classifications[i].id + '">' + classifications[i].name + '</option>');			
			}
	  console.log(data); 
	  
		},
		error : function(request, status, error) {
			console.log(error);
		}
	});
  
		 
	}



