/********************************** Validation *******************************************************/
function operator_validation()
{
    var operator_name = document.getElementById("operator_name").value;
	if(operator_name=='')
	{
		document.getElementById("operator_name_validation_div").innerHTML="* This field is Required.";
		document.getElementById("operator_name").focus();
		return false;
	}
}

function operator_clear_validation(str)
{
	if(str!='')
	{
		document.getElementById("operator_name_validation_div").innerHTML="";
	}
}

/********************************** Mainlist Add *******************************************************/
function operator_mainlist_add(operator_name,operator_type,department,labour_type,edit_id,action)
{
if((operator_name!=''))
 {
  jQuery.ajax({
		type: "POST",
		url: "operator_entry_db.php",
		data: "operator_name="+operator_name+"&operator_type="+operator_type+"&department="+department+"&labour_type="+labour_type+"&edit_id="+edit_id+"&action="+action,
		success: function(msg){jQuery("#measurement_list_div").html(msg);	
		alert(msg);
		window.close();
		window.opener.location.reload(true);
		
 }
		});
 }
else
{
    operator_validation();
}
}

/********************************** Mainlist Delete *******************************************************/
function delete_list(id)
{
	
	if(confirm('Are You Sure! You Want To Delete?'))
	{
		jQuery.ajax({
		type: "POST",
		url: "operator_creation/operator_entry_db.php",
		data: "id="+id+"&action=delete_operator",
		success: function(msg){jQuery("#party_entry_list_div").html(msg);
	}
	});
    }
}


