public function calendarioDia($proyecto = 0, $year = '', $month = '', $day = '') { $this->pagina = 'dia'; $this->carpeta = 'empleado'; $this->menu = 'menu_empleado_calendario'; $this->titulo = 'Calendario'; $this->estilo = array('backend', 'calendario'); $this->javascript = 'tooltip'; if ($this->uri->segment(1) == 'admin') { $this->permisos('admin'); $datos['user'] = '******'; } else { $this->permisos('empleado'); $datos['user'] = '******'; } if ($year == '') { $year = date('Y'); } if ($month == '') { $month = date('m'); } if ($day == '') { $day = date('d'); } if ($this->input->post('opciones') != '') { $proyecto = $this->input->post('opciones'); } $datos['proyecto'] = $proyecto; if (Proyecto_model::existe($proyecto) || $proyecto == 0) { $datos['opciones'] = Proyecto_model::empleado($this->session->userdata('email')); $arrayMeses = array('', 'Enero', 'Febrero', 'Marzo', 'Abril', 'Mayo', 'Junio', 'Julio', 'Agosto', 'Septiembre', 'Octubre', 'Noviembre', 'Diciembre'); $arrayDias = array('Domingo', 'Lunes', 'Martes', 'Miércoles', 'Jueves', 'Viernes', 'Sábado'); $fecha = $year . '-' . $month . '-' . $day; $datos['eventos'] = $this->Evento->evento($fecha, $this->session->userdata('email')); $tareas = array(); if ($proyecto == 0) { $datos['tareas'] = $this->_cargarFechas($tareas, $year, $month, $day); } else { $datos['tareas'] = $this->_cargarFechas($tareas, $year, $month, $day, $proyecto); } $mes = date('m', strtotime($fecha)); if ($mes < 10) { $mes = $mes % 10; } $fecha = $arrayDias[date('w', strtotime($fecha))] . ", " . date('d', strtotime($fecha)) . " de " . $arrayMeses[$mes] . " de " . date('Y', strtotime($fecha)); $datos['fecha'] = $fecha; $fecha = $month . '/' . $day . '/' . $year; $datos['yearAdd'] = date('Y', strtotime($fecha . "+1 day")); $datos['yearLess'] = date('Y', strtotime($fecha . "-1 day")); $datos['monthAdd'] = date('m', strtotime($fecha . "+1 day")); $datos['monthLess'] = date('m', strtotime($fecha . "-1 day")); $datos['dayAdd'] = date('d', strtotime($fecha . "+1 day")); $datos['dayLess'] = date('d', strtotime($fecha . "-1 day")); } else { $this->error = array('nivel' => '1', 'mensaje' => 'No existe el proyecto indicado'); } $this->mostrar($datos); }