<?php

class Faltas
{
  private $lis_f=array();

  public function consultar_regfaltas_per($con,$anno,$mm,$dia,$codper,$idj,$ids,$idtp,$idga,$ida,$idh,$th)
	{
		$sql="select * from tb_regfaltas where uap_anno='$anno' and uap_mes='$mm' and f_dia='$dia' and ug_id='$codper' and tp_id='$idtp' and j_id='$idj' and f_idserva='$ids' and h_id='$idh' and a_id='$ida' and ga_id='$idga' and f_tipohora='$th'";
			//echo $sql;
		$res=mysqli_query($con, $sql);
		while ($reg=mysqli_fetch_assoc($res))
		{
			$this->lis_f[]=$reg;
		}
			return $this->lis_f;
	}

  public function registrar_faltas_per($con,$anno,$mm,$dia,$codprog,$codper,$idj,$ids,$idtp,$idsa,$idga,$ida,$idh,$th,$ugid)
	{
		$sql="insert into tb_regfaltas values ('$dia','$codprog','$idh','$ida','$idga','$idtp','$codper','$anno','$mm','$ids','$idj','$th','$idsa','$ugid')";
		$res=mysqli_query($con, $sql);
  }

  public function eliminar_faltas_mes($con,$anno,$mm,$idj,$ids,$idtp)
	{
		$sql="delete from tb_regfaltas where uap_anno='$anno' and uap_mes='$mm' and s_id='$ids' and j_id='$idj' and tp_id='$idtp'";
		$res=mysqli_query($con, $sql);
  }
}


 ?>
