//-------------------------------------------------------//
// Author:Rodolfo Machon
// Company:WebSoft, SA de CV 
// Nombre del archivo: inmuebles_comm.js
// Created: 2016-08-12
// Updates: 2016-08-12;2022-04-04
// Copyright - All Rights Reserved
//-------------------------------------------------------//
//-------------------------------------------------------//
let windowObjectReference = null;
//-------------------------------------------------------//
window.onload = function(){
	resizeTo(800,900);
	const d = new Date();
	let text = d.toLocaleString();
	document.getElementById("fecha").innerHTML = "GENERADO EL :"+text;
};
//-------------------------------------------------------//
//LEVEL 1
function OpenSectorEntidad(id,sector,zona,vzona){
	let entidad = document.getElementById('entidad').value;	
	let url = "../pl/agua_sector_"+entidad+"_rept.pl?c11_sector_id="+id+"&v64_sector="+sector+"&zona="+zona+"&v64_zona="+vzona;
	let windowName = "AguaSector"+entidad;
	let features = "left=100,top=20,width=675,height=550,scrollbars=yes,toolbar=no,menubar=yes,resizable=yes";
	if (windowObjectReference === null || windowObjectReference.closed) {
		windowObjectReference = window.open(url, windowName, features);
	} else {
		windowObjectReference.focus();
	}
}
function OpenEntidad(){
	let entidad = document.getElementById('entidad').value;	
	let year = document.getElementById('year').value;
	let month= document.getElementById('month').value;
	let url = "../pl/agua_"+entidad+"_rept.pl?year="+year+"&month="+month;	
	let windowName = "Agua"+entidad;
	let features = "left=100,top=20,width=675,height=550,scrollbars=yes,toolbar=no,menubar=yes,resizable=yes";
	if (windowObjectReference === null || windowObjectReference.closed) {
		windowObjectReference = window.open(url, windowName, features);
	} else {
		windowObjectReference.focus();
	}
}
/*
function OpenLectura(){
	let year = document.getElementById('year').value;
	let url = "../pl/agua_lecturas_rept.pl?year="+year;	
	let windowName = "AguaSectorLectura";
	let features = "left=100,top=20,width=675,height=550,scrollbars=yes,toolbar=no,menubar=yes,resizable=yes";
	if (windowObjectReference === null || windowObjectReference.closed) {
		windowObjectReference = window.open(url, windowName, features);
	} else {
		windowObjectReference.focus();
	}
}
function OpenSectorConsumo(id,sector){
	let year = document.getElementById('year').value;
	let url = "../pl/agua_sector_consumos_rept.pl?c11_sector_id="+id+"&v64_sector="+sector+"&year="+year;
	let windowName = "AguaSectorConsumos";
	let features = "left=100,top=20,width=675,height=550,scrollbars=yes,toolbar=no,menubar=yes,resizable=yes";
	if (windowObjectReference === null || windowObjectReference.closed) {
		windowObjectReference = window.open(url, windowName, features);
	} else {
		windowObjectReference.focus();
	}
}
function OpenSectorLectura(id,sector){
	let year = document.getElementById('year').value;
	let url = "../pl/agua_sector_lecturas_rept.pl?c11_sector_id="+id+"&v64_sector="+sector+"&year="+year;	
	let windowName = "AguaSectorConsumos";
	let features = "left=100,top=20,width=675,height=550,scrollbars=yes,toolbar=no,menubar=yes,resizable=yes";
	if (windowObjectReference === null || windowObjectReference.closed) {
		windowObjectReference = window.open(url, windowName, features);
	} else {
		windowObjectReference.focus();
	}
}
*/