<?php

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

//class TipoContrato extends Conectar
class TipoContrato
{
	
	private $lis_tp_contrato=array();
	private $lis_tp_cont=array();
	
		
	public function listar_tp_cont_dep($con,$idj,$ids)
	{
		$sql="Select a.tc_idcont as cod, (select tc_abrev from tb_tipocont where tc_idcont=a.tc_idcont) as tipocont  FROM tb_usudep a inner join tb_usudep b on a.ug_id=b.ug_id where b.j_id='$idj' and b.s_id='$ids' and a.ua_estado not like ('0') group by a.tc_idcont";
		$res=mysqli_query($con, $sql);
		while ($reg=mysqli_fetch_assoc($res))
		{
			$this->lis_tp_contrato[]=$reg;
		}
			return $this->lis_tp_contrato;
	}
	
	public function listar_tp_cont($con)
	{
		$sql="select tc_idcont as cod, tc_abrev as descripcion from tb_tipocont";
		$res=mysqli_query($con, $sql);
		while ($reg=mysqli_fetch_assoc($res))
		{
			$this->lis_tp_cont[]=$reg;
		}
			return $this->lis_tp_cont;
	}
	
	public function busca_tp_cont($con,$idtc)
	{
		$sql="SELECT tc_desccont as descp FROM tb_tipocont where tc_idcont='$idtc'";
		$res=mysqli_query($con, $sql);
		while ($reg=mysqli_fetch_assoc($res))
		{
			$this->desc_cont=$reg['descp'];
		}
			return $this->desc_cont;
	}
	
	
}
?>