
$(document).ready(function() {
$(document).on("click",".add",function() {
			var id = $(this).data('id');
			var dataStringg = 'id='+id;
			$.ajax({
				type: "POST",
				url: "/contact/add-contact",				
				cache: false,
				data: dataStringg,
                beforeSend: function(){ 
					$("#submitprofile").hide();
                    $("#waiting").show();
                    $("#suksesupdate").hide();
                    $("#gagalupdate").hide();
                },
                complete: function(e, xhr, settings){
                    if(e.status === 200){
                        $("#submitprofile").show();
                        $("#waiting").hide();
                        $("#suksesupdate").show();
						setTimeout(function(){
							location.reload();
						},2000);
                        //$("#gagalupdate").hide();
                    }else{
                        $("#submitprofile").show();
                        $("#waiting").hide();
                        //$("#suksesupdate").show();
                        $("#gagalupdate").show();
						setTimeout(function(){
							location.reload();
						},2000);
                    }
                }
			});
		
		});	
});