<?php

include("../../../class/class.conectar.php");
include("../../../class/class.vacaciones.php");

$Objcon = new Conectar();
$conex = $Objcon->con();

$codigo = $_GET['ugid'];
$per = $_GET['per'];

$vacaprog = 0;
$cadenalis= "<table border='0'></tr>";

	$Obj_vp = new Vacaciones();
	$res_vp = array();
	$res_vp=$Obj_vp->aks_vacaciones($conex,$codigo,$per,0);
	if(count($res_vp)>0){
		if($res_vp[0]['suma']==$res_vp[0]['numdias']){
			$cadenalis=$cadenalis."<td align='center' width='50'><img src='../../img/b_check.png' width='17' height='17' border='0' ></td>";
			$vacaprog=1;
		}else{
			$cadenalis=$cadenalis."<td align='center' width='50'><img src='../../img/b_drop.png' width='17' height='17' border='0' ></td>";
		}
	}else{
	$cadenalis=$cadenalis."<td align='center' width='50'><img src='../../img/b_drop.png' width='17' height='17' border='0' ></td>";
	}

	//vacaciones ejecutadas
	$Obj_ve = new Vacaciones();
	$res_ve = array();
	$res_ve=$Obj_ve->aks_vacaciones($conex,$codigo,$per,1);
	if(count($res_ve)>0){
		if($res_ve[0]['suma']==$res_ve[0]['numdias']){
				$cadenalis=$cadenalis."<td align='center' width='50'><img src='../../img/b_check.png' border='0'></td>";
				$vacaprog=1;
		}else{
			$cadenalis=$cadenalis."<td align='center' width='50'><img src='../../img/b_drop.png' border='0'></td>";
		}
	}else{
	$cadenalis=$cadenalis."<td align='center' width='50'><img src='../../img/b_drop.png' border='0'></td>";
	}

	if($vacaprog==1){
		$cadenalis=$cadenalis."<td align='center' width='50'><img src='../../img/b_green.png' width='17' height='17' border='0' ></td>";
	}else{
		$cadenalis=$cadenalis."<td align='center' width='50'><img src='../../img/b_red.png' width='17' height='17' border='0' ></td>";
	}
	$cadenalis= $cadenalis."</table>";


 echo $cadenalis;
 ?>
