<?php

class RegPersonal
{
  private $lis_regpersonal=array();
  
  public function listar_regpersonal($con,$dni)
	{
		$sql="Select a.p_dni as dni, (select concat(p_apepat,' ',p_apemat,' ',p_nom) from tb_personal where p_dni=a.p_dni) as nom, a.rp_codplanilla as codplanilla, (select go_desc from tb_grupoocupacional where go_id=a.go_id) as grupoocupacional,(select tc_desc from tb_tipocont where tc_id=a.tc_id) as contrato,(select s_desc from tb_servicio where s_id=a.s_id and j_id=a.j_id) as servicio, (select j_desc from tb_jefatura where j_id=a.j_id) as jefatura from tb_regpersonal a where a.p_dni='$dni' and a.rp_estado='1' ";
        //echo $sql;
		$res=mysqli_query($con, $sql);
		while ($reg=mysqli_fetch_assoc($res))
		{
			$this->lis_regpersonal[]=$reg;
		}
			return $this->lis_regpersonal;
	}

}

?>