// JavaScript Document
/*************************************validation********************************/
function rate_fix_validation()
{
    var place_name = document.getElementById("place_name").value;
	if(place_name=='')
	{
		document.getElementById("place_name_validation_div").innerHTML="* This field is Required.";
		document.getElementById("place_name").focus();
		return false;
	}
	
	 var measre_qty = document.getElementById("measre_qty").value;
	if(measre_qty=='')
	{
		document.getElementById("measre_qty_validation_div").innerHTML="* This field is Required.";
		document.getElementById("measre_qty").focus();
		return false;
	}
	
	 var rate = document.getElementById("rate").value;
	if(rate=='')
	{
		document.getElementById("rate_validation_div").innerHTML="* This field is Required.";
		document.getElementById("rate").focus();
		return false;
	}
}

function rate_fix_clear_validation(str)
{
	if(str!='')
	{
		document.getElementById("place_name_validation_div").innerHTML="";
	}
	
	if(str!='')
	{
		document.getElementById("measre_qty_validation_div").innerHTML="";
	}
	
	if(str!='')
	{
		document.getElementById("rate_validation_div").innerHTML="";
	}
}
/*************************************Main list add********************************/

function place_ratefix_main(place_name,measre_qty,rate,edit_id,action)
{ 	
if((place_name!='')&&(measre_qty!='')&&(rate!=''))
 {
        jQuery.ajax({
		type: "POST",
		url: "place_ratefix_entry_db.php",
		data: "place_name="+place_name+"&measre_qty="+measre_qty+"&rate="+rate+"&edit_id="+edit_id+"&action="+action,
		success: function(msg){jQuery("#place_rate_list_div").html(msg);	
		alert(msg);
		window.close();
		window.opener.location.reload(true);
 }
		});
 }
else
{
    rate_fix_validation()
}
}
/***********************************delete************************************/
function rate_fix_delete_row(id)
{
	if(confirm('Are You Sure! You Want To Delete?'))
	{
		jQuery.ajax({
		type: "POST",
		url: "master_entry/place_ratefix/place_ratefix_entry_db.php",
		data: "id="+id+"&action=delete_rate_fix",
		success: function(msg){jQuery("#place_rate_list_div").html(msg);
	}
	});
    }
}

