function showSuppliers_Tracking( ) {
	
		var from =document.getElementById("tracking_from").value;
		var to =document.getElementById("tracking_to").value;
			
        console.log(" showSuppliers_Tracking", from , to );
		$.ajax({
			type : 'GET',
			url : 'create/ajaxsuppliers' +"/"+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 = $('#supplier_id').empty();
				$('#class_id').empty();
				$('#group_id').empty();
				$('#classification_id').empty();

				var suppliers = data.suppliers_ ;
				sel.append('<option> Choose Suppliers</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 showClasses_(supplier_id) {

		console.log(supplier_id);
		console.log("here");
		var from =document.getElementById("tracking_from").value;
		var to =document.getElementById("tracking_to").value;
		console.log(from);
		console.log(to);
		$.ajax({
			type : 'GET',
			url : 'create/ajaxclass/' + 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) {
				var sel = $('#class_id').empty();
			     $('#group_id').empty();
				 $('#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 showGroups(class_id) {

		console.log(class_id);
		console.log("herevvv");
		$.ajax({
			type : 'GET',
			url : 'create/ajaxgroup/' + class_id ,
			/*data : {
				'_token' : $('meta[name="csrf-token"]').attr('content')
			},
			headers: {
				'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
			  },*/
			
			success : function(data) {
				var sel = $('#group_id').empty();
				$('#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 showClassification(group_id) {

		console.log(group_id);
		console.log("heregggg");
		$.ajax({
			type : 'GET',
			url : 'create/ajaxclassification/' + group_id ,
			/*data : {
				'_token' : $('meta[name="csrf-token"]').attr('content')
			},
			headers: {
				'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
			  },*/
			
			success : function(data) {
				var sel = $('#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);
			}
		});
	}




	function showCustomers(classification_id) {

		console.log(classification_id);
		console.log("customers ");
		$.ajax({
			type : 'GET',
			url : 'create/ajaxcustomers/' + classification_id ,
			/*data : {
				'_token' : $('meta[name="csrf-token"]').attr('content')
			},
			headers: {
				'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
			  },*/
			
			success : function(data) {
				
				var sel_cust = $('#customer_id').empty();
				var customers = data.customers;
				sel_cust.append('<option> Choose Customers</option>');
				for (var i = 0; i < customers.length; ++i) {
					sel_cust.append('<option value="' + customers[i].id + '">' + customers[i].name + '</option>');			
				}



		  console.log(data);

			},
			error : function(request, status, error) {
				console.log(error);
			}
		});
	}

