<?php
//require_once("class.conectar.php");

//class ConsolHoraProgramacion extends Conectar
class ConsolHoraProgramacion
{
	
	private $con_hrsp_serv=array();
	private $con_hrsp=array();
		
	
	public function consol_hrprog_serv($con, $ugid,$anno,$mm,$idj,$idso,$idtp)
	{
		$sql="select chp_numgd as gd, chp_numgn as gn, chp_numho as ho, chp_numhe as he from tb_consolhprog".$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->con_hrsp_serv[]=$reg;
		}
			return $this->con_hrsp_serv;
	}
	
	public function consol_hrprog($con, $ugid,$anno,$mm,$idtp)
	{
		$sql="select sum(chp_numgd) as tgd, sum(chp_numgn) as tgn, sum(chp_numho) as tho, sum(chp_numhe) as the from tb_consolhprog".$anno." where ug_id='$ugid' and uap_anno='$anno' and uap_mes='$mm' and tp_id='$idtp'";
		$res=mysqli_query($con, $sql);
		while ($reg=mysqli_fetch_assoc($res))
		{
			$this->con_hrsp[]=$reg;
		}
			return $this->con_hrsp;
	}
	
}
?>