$(document).on('click','#add_partcode',function(e)
{
e.preventDefault();
var m=1;
var count=$("#dynamic_field tr").last().length;
if(count == '0')
{
var n=0;
}
else
{
var n=$("#dynamic_field tr").last().attr("count");
}
var i= parseInt(m, 10) + parseInt(n, 10);
$('#dynamic_field').append('
| | | | | | | | | | |
');
});
$(document).on('click', '.removenewpartcode', function()
{
$(this).closest("tr").remove();
});
$(document).on('submit','#partcodeaddform', function(e)
{
e.preventDefault();
var addpartcode=1;
var formData = new FormData(this);
formData.append('addpartcode',addpartcode);
$.ajax({
type: 'POST',
url: 'action.php',
data: formData,
contentType: false,
cache: false,
processData:false,
success: function(data){
$("#add_product_all").html(data);
},
});
});
$(document).on('click','.clickdeleteproductdetails',function(e)
{
if(confirm("Are You Confirm"))
{
var clickdeleteproductdetailsremoveid=$(this).attr("removeid");
$.ajax({
url:'action.php',
type:'POST',
data:{clickdeleteproductdetailsremoveid:clickdeleteproductdetailsremoveid},
success:function(data){
$("#deleteproductid").html(data);
}
});
}
});
$(document).on('submit','#updateproductdetails', function(e)
{
e.preventDefault();
var productdetailscode=$("#productdetailscode").val();
var productdetailsname=$("#productdetailsname").val();
var productdetailsunit=$("#productdetailsunit").val();
var productdetailunittype=$("#suplier_unittype").val();
var productdetailscategory=$("#category").val();
var productdetailsprice=$("#price").val();
var productdetailssellingprice=$("#sellingprice").val();
var productdetailsgst=$("#productdetailsgst").val();
var productdetailshsn=$("#hsn").val();
var productdetailsdate=$("#date").val();
var productdetailsuid=$("#productdetailsuid").val();
if(productdetailscode == '')
{
alert('Please Enter Product Code');
return false;
}
if(productdetailsname == '')
{
alert('Please Enter Product Name');
return false;
}
if(productdetailsdate == '')
{
alert('Please Enter Product Date');
return false;
}
$.ajax({
url:'action.php',
type:'POST',
data:{uproductdetailscode:productdetailscode,uproductdetailsname:productdetailsname,uproductdetailsunit:productdetailsunit,uproductdetailunittype:productdetailunittype,uproductdetailscategory:productdetailscategory,uproductdetailsprice:productdetailsprice,uproductdetailssellingprice:productdetailssellingprice,uproductdetailsgst:productdetailsgst,uproductdetailshsn:productdetailshsn,uproductdetailsdate:productdetailsdate,uproductdetailsuid:productdetailsuid},
success:function(data)
{
$("#update_product_details").html(data);
}
});
});