usuario=$usuario; if(($this->usuario->tieneRol(1)) || ($this->usuario->tieneRol(4))){ if($mes < 10){ //Me aseguro de que no tenga cero delante $mes = $mes + 0; //Y le pongo el cero delante. $mes = "0".$mes; } $this->mes=$mes; $this->anio=$anio; $this->locale = $locale; }else{ $error = $this->locale['3028']; throw new Exception($error); return false; exit; } } /** * Acceso a las vacaciones de todos los empleados del mes. */ function getVacaciones(){ if($this->vacaciones == null){ $this->vacaciones = array(); $consulta = "SELECT oid FROM vacaciones WHERE fecha LIKE '".$this->anio."-".$this->mes."%' GROUP BY oid"; $bd = new BD(); if($resultado = $bd->execQuery($consulta)){ while($rows = mysql_fetch_array($resultado)){ $p = new Vacaciones($this->usuario,$rows["oid"],$this->mes,$this->anio, $this->locale); $this->vacaciones[] = $p; } } } return $this->vacaciones; } } ?>