public function actualizarNoticia() { $response = 0; $id_noticia = e(Input::get('id_noticia')); $titulo_noticia = e(Input::get('titulo_noticia')); $contenido_noticia = e(Input::get('contenido_noticia')); $enlace_noticia = e(Input::get('enlace_noticia')); $area_gestion_notica = e(Input::get('area_gestion_notica')); $centro = e(Input::get('centro_linea_investigacion')); $noticia = Noticia::buscar_noticia($id_noticia); if (!is_null(Input::file('imagen_noticia'))) { $imagen_noticia_vieja = $noticia->imagen_noticia; $imagen_noticia = Input::file('imagen_noticia'); $imagen_noticia_nombre = $id_noticia . '_imagenNoticia.' . $imagen_noticia->getClientOriginalExtension(); } else { $imagen_noticia_nombre = $noticia->imagen_noticia; } $response = Centro::buscar_centro($centro); if (count($response) == 1) { $response = 0; $response = AreaGestion::buscar_area_gestion($area_gestion_notica); if (count($response) == 1) { $response = 0; $response = Noticia::actualizar_noticia($id_noticia, $titulo_noticia, $contenido_noticia, $enlace_noticia, $area_gestion_notica, $imagen_noticia_nombre); if (count($response) == 1) { if (!is_null(Input::file('imagen_noticia'))) { File::delete('img/noticia/' . $imagen_noticia_vieja); $imagen_noticia->move('img/noticia', $imagen_noticia_nombre); } return Redirect::to(URL::previous())->with('mensaje', 'Noticia Actualizado Correctamente'); } else { return Redirect::to(URL::previous())->with('mensaje', 'Ha ocurrido un error'); } } else { return Redirect::to(URL::previous())->with('mensaje', 'No ha Seleccionado una Area de Gestión Válida'); } } else { return Redirect::to(URL::previous())->with('mensaje', 'No ha Seleccionado una Area de Gestión Válido'); } }