function obtenerComentarios($idpincho) { $comentario = new Comentarios(); return $comentario->listarPorPincho($idpincho); }
function guardarComentario($idpincho, $login, $coment) { $comentario = new Comentarios(); return $comentario->insertarComentario($idpincho, $login, $coment); }
public function postElimPub() { if (Request::ajax()) { $id = Input::get('id'); $pub = Publicaciones::find($id); $titulo = $pub->titulo; $comment = Comentarios::where('pub_id', '=', $id)->get(); $resp = Respuestas::where('pub_id', '=', $id)->get(); if (count($comment) > 0) { foreach ($comment as $c) { $c->deleted = 1; $c->save(); } } if (count($resp) > 0) { foreach ($resp as $r) { $r->deleted = 1; $r->save(); } } $userid = $pub->user_id; $user = User::find($userid); $subject = "Correo de Aviso"; $pub->deleted = 1; $pub->save(); $data = array('subject' => $subject, 'publicacion' => $titulo, 'motivo' => 'Eliminado por el usuario'); $to_Email = $user->email; Mail::send('emails.elimPubUser', $data, function ($message) use($titulo, $to_Email, $subject) { $message->to($to_Email)->from('*****@*****.**')->subject($subject); }); return Response::json(array('type' => 'success', 'msg' => 'Publicación eliminada satisfactoriamente. Hemos enviado un email al correo.')); } }
require_once '../../comentarios.inc.php'; session_start(); $usuario = $_SESSION['user']; $cliente = $_SESSION['cliente']; $datos = $_SESSION['datos']; $idUsuario = $datos['idUser']; //Pasamos la fecha del ultimo comentario que hizo en esta sesion para este producto $fecha = $_SESSION['fechaComentario']; //Si no esta inicializada la inicializamos if ($fecha == null) { $fecha = date("Y-m-d h:i:sa"); } $producto = "sobremesa_asus_RogTytan_20150101"; $url = "sobremesa_asus_RogTytan_20150101.php"; //Obtenemos el comentario de texto del usuario $comentario = new Comentarios(); $comentarioTaux = $comentario->obtenerDatos($idUsuario, $producto); $comentarioTexto = $comentarioTaux[0]; ?> </head> <body> <header> <section id="cabecera"> <img src="../../imagenes/decsai.png" alt="imagen publicidad" height="190" width="1300"> <h1 style="text-align: center;font-size: 50px"><a href="../../index.php">PCNOW!</a></h1> </section>
public function postElimCommentrecividos() { $comment_id = Input::get('comment_id'); $comment = Comentarios::find($comment_id); $comment->respondido = 1; if ($comment->save()) { return Response::json(array('type' => 'success', 'msg' => 'Comentario marcado como respondido sactisfactoriamente.')); } else { return Response::json(array('type' => 'danger', 'msg' => 'Error al marcar el comentario.')); } }
/** * Returns the data model based on the primary key given in the GET variable. * If the data model is not found, an HTTP exception will be raised. * @param integer the ID of the model to be loaded */ public function loadModel($id) { $model = Comentarios::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'La página solicitada no existe.'); } return $model; }
public function actionDeleteAjax($id) { //$this->loadModel($id)->delete(); Comentarios::model()->loadModel($id)->delete(); // if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser if (!isset($_GET['ajax'])) { $this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin')); } }
public function getVerifyComment() { if (Request::ajax()) { $comment = Comentarios::leftJoin('publicaciones', 'publicaciones.id', '=', 'comentario.pub_id')->where('publicaciones.user_id', '=', Auth::user()->id)->where('comentario.is_read', '=', 0)->where('publicaciones.deleted', '=', 0)->where('comentario.deleted', '=', 0)->count(); $responses = Respuestas::where('user_id', '=', Auth::user()->id)->where('is_read', '=', 0)->where('deleted', '=', 0)->count(); return $comment + $responses; } }