public function registrarNotificacion() { try { $asunto = isset($_POST['asunto']) ? $_POST['asunto'] : NULL; $mensaje = isset($_POST['mensaje']) ? $_POST['mensaje'] : NULL; $fecha_evento = isset($_POST['fecha']) ? $_POST['fecha'] : NULL; $hora = isset($_POST['hora']) ? $_POST['hora'] : NULL; $destino = isset($_POST['destino']) ? $_POST['destino'] : NULL; $fecha = getdate(); $fecha_ingreso = $fecha["year"] . "-" . $fecha["mon"] . "-" . $fecha["mday"]; $notificacion = new Notificacion(); $notificacion->setAsunto($asunto); $notificacion->setMensaje($mensaje); $notificacion->setFecha_ingreso($fecha_ingreso); $notificacion->setFecha_evento($fecha_evento); $notificacion->setHora($hora); $notificacion->setDestino($destino); $notificacion->crearNotificacion($notificacion); echo json_encode(1); } catch (Exception $exc) { echo json_encode('Error de aplicacion: ' . $exc->getMessage()); } }