/**********************************************          MAINLIST ADD       ***********************************************/
function unloading_destination_add(bill_date,tripsheet_no,vehicle_no,unload_branch,unload_place,hidden_checkbox,remarks,status_load,edit_id,action)
{ 
  jQuery.ajax({
		type: "POST",
		url: "transport_unloading_form_db.php",
		data: "bill_date="+bill_date+"&tripsheet_no="+tripsheet_no+"&vehicle_no="+vehicle_no+"&unload_branch="+unload_branch+"&unload_place="+unload_place+"&hidden_checkbox="+hidden_checkbox+"&remarks="+remarks+"&status_load="+status_load+"&edit_id="+edit_id+"&action="+action,
		success: function(msg){jQuery("#transport_unloading_destination_div").html(msg);
		alert(msg);
		window.opener.location.reload(true);
  	    window.close();
	 }	});
			 
}

/******************************       main list delte      *******************************************/
function unloading_delete(unload_id,tripsheet_no,load_tripsheet_no,place,vehicle_no,unload_branch)
{
	if(confirm('Are You Sure! You Want To Delete?'))
	{
		jQuery.ajax({
		type: "POST",
		url: "booking/transport_unloading/transport_unloading_form_db.php",
		data: "unload_id="+unload_id+"&tripsheet_no="+tripsheet_no+"&load_tripsheet_no="+load_tripsheet_no+"&place="+place+"&vehicle_no="+vehicle_no+"&unload_branch="+unload_branch+"&action=delete",
		success: function(msg){jQuery("#transport_unloading_destination_div").html(msg);
		alert("Deleted Successfully");
		//window.location.reload(true);
	}
	});
    }
}
/****************************  Checking the Check Box  ********************************/
function get_checkbox_values(tripsheet_nos)
{
	var tripsheet_nos = tripsheet_nos;
    var answers = [];
    jQuery.each(jQuery('.text_field:checked'), function() {
        answers.push(jQuery(this).val()); 
    });
	document.getElementById('hidden_checkbox').value=answers+"@"+tripsheet_nos;
	return false;
}

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

function search_unloading_details(vehicle_no,unload_branch,unload_place,edit_id,load_tripsheet_no,tripsheet_no,hidden_checkbox)
{
		jQuery.ajax({
		type: "POST",
		url: "transport_unloading_sublist.php",
		data: "vehicle_no="+vehicle_no+"&unload_branch="+unload_branch+"&unload_place="+unload_place+"&edit_id="+edit_id+"&load_tripsheet_no="+load_tripsheet_no+"&tripsheet_no="+tripsheet_no+"&hidden_checkbox="+hidden_checkbox,
		success: function(msg){jQuery("#transport_unloading_sublist_div").html(msg);
}	});
}

function get_vehicle_no(unload_place,unload_branch)
{
		jQuery.ajax({
		type: "POST",
		url: "vehicle_no.php",
		data: "unload_place="+unload_place+"&unload_branch="+unload_branch,
		success: function(msg){jQuery("#vehicle_no_div").html(msg);
	}
	});
}
