
<!-- Add Product -->
	$(document).on('click','#btn-proadd',function(e) {
		var data = $("#addproduct_form").serialize();
		$.ajax({
			data: data,
			type: "post",
			url: "save1.php",
			success: function(dataResult){
					var dataResult = JSON.parse(dataResult);
					if(dataResult.statusCode==200){
						$('#addProductModal').modal('hide');
						alert('Data added successfully !'); 
                        location.reload();						
					}
					else if(dataResult.statusCode==201){
					   alert(dataResult);
					}
			}
		});
	});
	$(document).on('click','.proupdate',function(e) {
		var id=$(this).attr("data-id");
		var catname=$(this).attr('data-category');
		var subcatname=$(this).attr("data-subcategory");
		$('#id_u').val(id);
		$('#category_u').val(catname);
		$('#subcategory_u').val(subcatname);
	});

	<!-- Update -->
	$(document).on('click','#proupdate',function(e) {
		var data = $("#proupdate_form").serialize();
		$.ajax({
			data: data,
			type: "post",
			url: "save1.php",
			success: function(dataResult){
					var dataResult = JSON.parse(dataResult);
					if(dataResult.statusCode==200){
						$('#editProductModal').modal('hide');
						alert('Data updated successfully !'); 
                        location.reload();						
					}
					else if(dataResult.statusCode==201){
					   alert(dataResult);
					}
			}
		});
	});
	$(document).on("click", ".prodelete", function() { 

		var id=$(this).attr("data-id");
		$('#id_pd').val(id);
		
		
	});
	$(document).on("click", "#prodelete", function() { 
		$.ajax({
			url: "save1.php",
			type: "POST",
			cache: false,
			data:{
				type:6,
				id: $('#id_pd').val()
			},
			success: function(dataResult){
					$('#deleteProductModal').modal('hide');
					$("#"+dataResult).remove();
					alert('Data deleted successfully !'); 
					location.reload();	

			
			}
		});
	});


	<!--Enquiry Form-->
	$(document).on('click','.enquiryview',function(e) {
		var prname=$(this).attr("data-pname");
		$('#pname').val(prname);
	});


	<!--Add Enquiry -->
	$(document).on('click','#btnOrder',function(e) {
		var data = $("#enquiryform").serialize();
		$.ajax({
			data: data,
			type: "post",
			url: "Admin/save.php",
			success: function(dataResult){
					var dataResult = JSON.parse(dataResult);
					if(dataResult.statusCode==200){
						$('#modalEnquiryForm').modal('hide');
						alert('Enquiry added successfully !'); 
                        location.reload();						
					}
					else if(dataResult.statusCode==201){
					   alert(dataResult);
					}
			}
		});
	});
