
$(document).ready(function() 
  {	$("#station_availability_form_data").load("module/ground_water/station_availability_form_data.php");
});


function station_availability_data_list(){
	$('#cover-spin').show();
	$.ajax({
		url: 'module/ground_water/station_availability_datatable.php',
		//type: 'post',
		//data: datastr,
		cache: false,
		success: function (result) {
      // alert(result);
			$('#cover-spin').hide();
			$("#station_availability_datatable").html(result);
		}
	});
	//$("#ground_water_datatable").load("module/ground_water/ground_water_datatable.php");
}

function show_station_availabilit(){
  var division=$("#division").val();
  var sub_div=$("#sub_div").val();
  var district=$("#district").val();
  var from_date=$("#from_date").val();
  var to_date=$("#to_date").val();


	if (!division && !sub_div && !district) {
    alert("Please select Any field");
    $("#division").next().find("input").focus();

    return false;
}


  var datastr="division_id="+division+"&sub_division_id="+sub_div+"&district_id="+district+"&from_date="+from_date+"&to_date="+to_date;
  
  // alert(datastr);

  $('#cover-spin').show(0);
	$.ajax({
		url: 'module/ground_water/station_availability_datatable.php',
		type: 'post',
		data: datastr,
		cache: false,
		success: function (result) {
      // alert(result);

			$('#cover-spin').hide();
			$("#station_availability_datatable").html(result);
		}
	});
	//$


}
function summary_station_availabilit(){

	var division=$("#division").val();
  var sub_div=$("#sub_div").val();
  var district=$("#district").val();
  var from_date=$("#from_date").val();
  var to_date=$("#to_date").val();


	if (!division && !sub_div && !district) {
    alert("Please select Any field");
		$("#division").next().find("input").focus();

    return false;
}


  var datastr="division_id="+division+"&sub_division_id="+sub_div+"&district_id="+district+"&from_date="+from_date+"&to_date="+to_date;
  
  // alert(datastr);

  $('#cover-spin').show(0);
	$.ajax({
		url: 'module/ground_water/station_availability_summary_datatable.php',
		type: 'post',
		data: datastr,
		cache: false,
		success: function (result) {
      // alert(result);

			$('#cover-spin').hide();
			$("#station_availability_datatable").html(result);
		}
	});
	//$


}




function show_missing_date(well_id, start_date, end_date) {

	var datastr="well_id="+well_id+"&start_date="+start_date+"&end_date="+end_date;
	// alert(datastr);

	$.ajax({
		url: 'module/ground_water/missing_date.php',
		type: 'post',
		data: datastr,
		success: function (result) {
    //  alert(result);
			 $("#missing_date_modal_body").html(result);
		}
	});

}
function Summary_details_modal(well_id) {


 var from_date=$("#from_date").val();
  var to_date=$("#to_date").val();


	var datastr="well_id="+well_id+"&from_date="+from_date+"&to_date="+to_date;
	// alert(datastr);

	$.ajax({
		url: 'module/ground_water/missing_date_summary.php',
		type: 'post',
		data: datastr,
		success: function (result) {
          //  alert(result);
			 $("#missing_date_sumary_modal_body").html(result);
		}
	});

}

function print_station_availabiliti_data(){

	var division=$("#division").val();
  var sub_div=$("#sub_div").val();
  var district=$("#district").val();
  var from_date=$("#from_date").val();
  var to_date=$("#to_date").val();


	if (!division && !sub_div && !district) {
    alert("Please select Any field");
$("#division").next().find("input").focus();

    return false;
}


  var datastr="division_id="+division+"&sub_division_id="+sub_div+"&district_id="+district+"&from_date="+from_date+"&to_date="+to_date;

	window.open("module/ground_water/station_availabilty_datatable_report.php?" + datastr);

}
function print_station_availabiliti_summary_data(){

	var division=$("#division").val();
  var sub_div=$("#sub_div").val();
  var district=$("#district").val();
  var from_date=$("#from_date").val();
  var to_date=$("#to_date").val();


	if (!division && !sub_div && !district) {
    alert("Please select Any field");
$("#division").next().find("input").focus();

    return false;
}


  var datastr="division_id="+division+"&sub_division_id="+sub_div+"&district_id="+district+"&from_date="+from_date+"&to_date="+to_date;

	window.open("module/ground_water/station_availabilty_summary_report.php?" + datastr);

}



function print_missing_date(well_id, start_date, end_date){
	
	var datastr="well_id="+well_id+"&start_date="+start_date+"&end_date="+end_date;
	// alert(datastr);
	window.open("module/ground_water/missing_data_report.php?" + datastr);

}

function print_missing_date_list_details(well_id,from_date,to_date){
var datastr="well_id="+well_id+"&from_date="+from_date+"&to_date="+to_date;
// alert(datastr);
window.open("module/ground_water/missing_data_details_report.php?" + datastr);
}