<?php
//require_once("class.conectar.php");
//class ConsolHoraReprogramacion extends Conectar
class ConsolHoraReprogramacion
{
	
	private $con_hrsp=array();
	private $det_con_hrsp=array();
		
	
	public function consol_hrreprog_serv($con, $ugid,$anno,$mm,$idj,$idso,$idtp)
	{
		$sql="select chr_numgd as gd, chr_numgn as gn, chr_numho as ho, chr_numhe as he from tb_consolhreprog".$anno." where ug_id='$ugid' and uap_anno='$anno' and uap_mes='$mm' and ut_idserva='$idso' and tp_id='$idtp' and j_id='$idj'";
		//echo $sql."<br>";
		$res=mysqli_query($con, $sql);
		while ($reg=mysqli_fetch_assoc($res))
		{
			$this->det_con_hrsp[]=$reg;
		}
			return $this->det_con_hrsp;
	}
	
	public function consol_hrreprog($con, $ugid,$anno,$mm,$idtp)
	{
		$sql="select sum(chr_numgd) as tgd, sum(chr_numgn) as tgn, sum(chr_numho) as tho, sum(chr_numhe) as the from tb_consolhreprog".$anno." where ug_id='$ugid' and uap_anno='$anno' and uap_mes='$mm' and tp_id='$idtp'";
		//echo $sql."<br>";
		$res=mysqli_query($con, $sql);
		while ($reg=mysqli_fetch_assoc($res))
		{
			$this->con_hrsp[]=$reg;
		}
			return $this->con_hrsp;
	}
	
}
?>