tieneRol("6")){ header("Location: aplicacion.php?e=permiso"); echo "no puedes"; exit; } include_once("html/cabecera.php"); ?>
getValor("oid"),$mes_hoy,$ano_hoy,$locale); $permisos=new Permisos($usuario,$usuario->getValor("oid"),$mes_hoy,$ano_hoy,$locale); $back="vacaciones.php"; if($_POST['action']){ switch ($_POST['action']) { case "pedir": $ultimo_dia = verifica_long_mes($mes_hoy,$ano_hoy); // Recorremos todos los valores de los d�as $dias=array(); for($i=1;$i<=$ultimo_dia;$i++){ if($_POST['d'.$i.'-'.$mes_hoy]=="on"){ //if($vacaciones->esSolicitable($i)){ $dias[$i]=""; //} } } try{ $vacaciones->solicitar($dias); $tipo="ok"; $msg=$locale['290']; foreach($dias as $diaShow => $mensaje){ $msg.=$diaShow." "; } } catch (Exception $e){ $tipo="error"; $msg=$e->getMessage(); } break; case "anular": $ultimo_dia = verifica_long_mes($mes_hoy,$ano_hoy); // Recorremos todos los valores de los d�as $dias=array(); for($i=1;$i<=$ultimo_dia;$i++){ if($_POST['a'.$i.'-'.$mes_hoy]=="on"){ //if($vacaciones->esAnulable($i)){ $dias[$i]=""; //} } } try{ $vacaciones->solicitarAnulacion($dias); $tipo="ok"; $msg=$locale['464']; foreach($dias as $diaShow){ $msg.=$diaShow." "; } } catch (Exception $e){ $tipo="error"; $msg=$e->getMessage(); } break; case "eliminar": $ultimo_dia = verifica_long_mes($mes_hoy,$ano_hoy); // Recorremos todos los valores de los d�as $dias=array(); for($i=1;$i<=$ultimo_dia;$i++){ if($_POST['e'.$i.'-'.$mes_hoy]=="on"){ //if($vacaciones->esAnulableSolicitud($i)){ $dias[$i]=""; //} } } try{ $vacaciones->eliminarSolicitud($dias); $tipo="ok"; $msg=$locale['471']; foreach($dias as $diaShow => $mensaje){ $msg.=$diaShow." "; } } catch (Exception $e){ $tipo="error"; $msg=$e->getMessage(); } break; default: break; } } if($msg!=""){ echo "