<?php

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

//class SubhoraReprogramado extends Conectar
class SubhoraReprogramado
{
	
	private $ask_hrsprog=array();

	
	public function ask_hrsreprog_per($con,$ugid,$anno,$mm,$idtp,$idj,$ids,$idso,$thora)
	{
		$sql="select ug_id from tb_subhorareprog".$anno." where ug_id='$ugid' and uap_anno='$anno' and uap_mes='$mm' and  tp_id='$idtp'  and hr_idserva='$idso' and hr_idserva not in ('$ids')  and j_id='$idj' and shr_tipohora='$thora'";
		//echo $sql."<br>";
		$res=mysqli_query($con, $sql);
		while ($reg=mysqli_fetch_assoc($res))
		{
			$this->ask_hrsprog[]=$reg;
		}
			return $this->ask_hrsprog;
	}
	
	public function ask_reprog_mes($con,$anno,$mm,$idtp,$idj,$ids,$idga)
	{
		$sql="select ug_id from tb_subhorareprog".$anno." where ga_id='$idga' and uap_anno='$anno' and uap_mes='$mm' and  tp_id='$idtp'  and hr_idserva='$ids' and j_id='$idj' and (shr_numho + shr_numhe) > 0 limit 1";
		//echo $sql."<br>";
		$res=mysqli_query($con, $sql);
		while ($reg=mysqli_fetch_assoc($res))
		{
			$this->ask_hrsprog[]=$reg;
		}
			return $this->ask_hrsprog;
	}
	
	
}
?>