function load_upazila_by_district_id(district) {
  var datastr = "sel_district_id=" + district;
  //$("#wl_sva_btn").css({"display":"none"});
  //   $("#view_wli_data").html("");
  //   $("#curve_chart").html("");

  $("#upazila_list_holder").load("module/ground_water_ex/gwq_upz_by_dis.php",datastr);
}

function flushData() {
  $("#gw_sva_btn").css({ display: "none" });
  $("#view_wli_data").html("");
  $("#curve_chart").html("");
}
function loadDeForm(){
	$("#gw_sva_btn").css({ display: "none" });
	$('#data-table').html("");
	$('#curve_chart').html("");
	$('#district').val('');
	$('#upz').val('');
	$('#from_year_1').val('');
	$('#to_year_1').val('');
	$('#sub_div').val('').trigger('liszt:updated');
	$('#act_tab_name').val('sub_div_wise');
	$('.nav-tabs a[href="#sal_data_list"]').tab('show');
}

function loadExcelData(){
  //alert('dis_wise');
	var sub_div = 0;
	$("#gw_sva_btn").css({ display: "none" });
	$('#data-table').html("");
	$('#curve_chart').html("");
	$('#sub_div').val(sub_div);
	$('#from_year').val('');
	$('#to_year').val('');
	$('#district').val('').trigger('liszt:updated');
	$('#upazila').val('').trigger('liszt:updated');
	$('#act_tab_name').val('dis_wise');
	$('.nav-tabs a[href="#sal_data_list"]').tab('show');
}
function show_weekly_record_info() {
	var sub_id = $("#sub_div").val();
	var sub_div_arr = sub_id.split("#");
	var sd_name = sub_div_arr[1];
	var sub_div = sub_div_arr[0];
	var datastr = "";
	//alert(sub_div);
	if (sub_div == 0){
		var district = $("#district").val();
		var upazila = $("#upz").val();
		var from_year = $("#from_year_1").val();
		var to_year = $("#to_year_1").val();
		datastr = "district="+district+"&upazila="+upazila+"&from_year="+from_year+"&to_year="+to_year;
	}
	else{
		var from_year = $("#from_year").val();
		var to_year = $("#to_year").val();
		var to_month = $("#to_month").val();
		datastr = "sub_div="+sub_div+"&from_year="+from_year+"&to_year="+to_year+"&sd_name="+sd_name;
	}
	//alert(datastr);
	$.ajax({
		url: "module/ground_water_ex/av_gwt_weekly_datatbl.php",
		type: "get",
		data: datastr,
		cache: false,
		success: function (data) {
			$("#data-table").html(data);
		},
	});
}

function download_excel_rf_info() {
  //alert("download");
  var sub_id = $("#sub_div").val();
  var sub_div_arr = sub_id.split("#");
	var sd_name = sub_div_arr[1];
	var sub_div = sub_div_arr[0];
  //alert(sub_div);
  if (sub_div == 0){
    var district = $("#district").val();
    var upazila = $("#upz").val();
    var from_year = $("#from_year_1").val();
    var to_year = $("#to_year_1").val();
    var datastr = "district="+district+"&upazila="+upazila+"&from_year="+from_year+"&to_year="+to_year;
    //alert(datastr);
  }
  else{
    var from_year = $("#from_year").val();
    var to_year = $("#to_year").val();
    var datastr = "sub_div="+sub_div+"&sd_name="+sd_name+"&from_year="+from_year+"&to_year="+to_year;
    //alert(datastr);
  }
  window.open("module/ground_water_ex/av_gwt_weekly_excel_dl.php?" + datastr);
}
