/**********************************************          MAINLIST ADD       ***********************************************/
function local_delivery_add(delivery_no,bill_date,loading_date,loading_no,branch,hidden_checkbox,remarks,status_load,edit_id,action)
{
  jQuery.ajax({
		type: "POST",
		url: "local_delivery_conform_form_db.php",
		data: "delivery_no="+delivery_no+"&bill_date="+bill_date+"&loading_date="+loading_date+"&loading_no="+loading_no+"&branch="+branch+"&hidden_checkbox="+hidden_checkbox+"&remarks="+remarks+"&status_load="+status_load+"&edit_id="+edit_id+"&action="+action,
		success: function(msg){jQuery("#local_delivery_conform_div").html(msg);
		alert(msg);
		window.opener.location.reload(true);
  	    window.close();
	 }	});
			 
}

/******************************       main list delte      *******************************************/
function local_delivery_conform_delete(id,loading_no,delivery_no)
{
	if(confirm('Are You Sure! You Want To Delete?'))
	{
		jQuery.ajax({
		type: "POST",
		url: "booking/local_delivery_conform/local_delivery_conform_form_db.php",
		data: "id="+id+"&loading_no="+loading_no+"&delivery_no="+delivery_no+"&action=delete",
		success: function(msg){jQuery("#local_delivery_conform_div").html(msg);
		alert("Deleted Successfully");
		window.location.reload(true);
	}
	});
    }
}


/****************************  Checking the Check Box  ********************************/
function get_checkbox_values(loading_nos)
{
	var loading_nos = loading_nos;
    var answers = [];
    jQuery.each(jQuery('.text_field:checked'), function() {
        answers.push(jQuery(this).val()); 
    });
	document.getElementById('hidden_checkbox').value=answers+"@"+loading_nos;
	return false;
}


/****************************  Searching Details  ********************************/

function search_local_delivery_details(loading_date,loading_no,edit_id,delivery_no,hidden_checkbox)
{
		jQuery.ajax({
		type: "POST",
		url: "local_delivery_conform_sublist.php",
		data: "loading_date="+loading_date+"&loading_no="+loading_no+"&edit_id="+edit_id+"&delivery_no="+delivery_no+"&hidden_checkbox="+hidden_checkbox,
		success: function(msg){jQuery("#local_delivery_sublist_div").html(msg);
}	});
}