Código PHP:
Ver original
public function getNotificaciones($unread = false){ # SI HAY MAS DE 5 NOTIS MOSTRAMOS TODAS LAS NO LEIDAS if($this->show_type == 1) // VIEW TYPE $not_view = ($unread == true) ? '= 2' : ' > 0'; $not_del = ($unread == true) ? 1 : 0; // if($this->notificaciones > 5 || $unread == true ){ // CONSULTA $query = $this->db->ejecutarConsulta("SELECT m.*, u.user_name AS usuario FROM u_monitor AS m LEFT JOIN u_miembros AS u ON m.obj_user = u.user_id WHERE m.user_id = {$this->User->uid} AND m.not_menubar {$not_view} ORDER BY m.not_id DESC"); $data = $this->db->fetch_array($query); $this->db->free($query); } else { // CONSULTA $query = $this->db->ejecutarConsulta("SELECT m.*, u.user_name AS usuario FROM u_monitor AS m LEFT JOIN u_miembros AS u ON m.obj_user = u.user_id WHERE m.user_id = {$this->User->uid} ORDER BY m.not_id DESC LIMIT 5"); $data = $this->db->fetch_array($query); $this->db->free($query); } // SI VA AL MONITOR ENTONCES ACTUALIZAMOS PARA QUE YA NO SE VEAN EN EL MENUBAR if($this->show_type == 2) // DATOS $sql = "SELECT m.*, u.user_name AS usuario FROM u_monitor AS m LEFT JOIN u_miembros AS u ON m.obj_user = u.user_id WHERE m.user_id = {$this->User->uid} ORDER BY m.not_id DESC"; // CARGAMO LAS ESTADISTICAS $cuery = $this->db->query("SELECT COUNT(follow_id) AS total FROM u_follows WHERE f_user = {$this->User->uid} AND f_type = 2"); $stats = $this->db->fetch_assoc($cuery); $this->db->free($cuery); // ARMAMOS PARA MAS COMODIDAD # CARGO LOS FILTROS $cuery = $this->db->select("u_portal","c_monitor","user_id = {$this->User->uid}","",1); $filtros = $this->db->fetch_assoc($cuery); $this->db->free($cuery); // foreach($filtros as $key => $val){ $dataDos['filtro'][$val] = true; } // ACTUALIZAMOS if($this->show_type == 1) $this->db->update("u_monitor","not_menubar = {$not_del}","user_id = {$this->User->uid} AND not_menubar > 0"); else $this->db->update("u_monitor","not_menubar = 0, not_monitor = 0","user_id = {$this->User->uid} AND not_monitor = 1"); // ARMAR TEXTOS Y LINKS :) $dataDos['data'] = $this->armNotificaciones($data); // TOTAL DE NOTIDICACIONES // return $dataDos; }
estos son algunos de los errores que me da
Warning: Invalid argument supplied for foreach() in C:\xampp\htdocs\redsocial.com\redsocial\app\modelo s\Monitor.php on line 320
Notice: Undefined index: not_type in C:\xampp\htdocs\redsocial.com\redsocial\app\modelo s\Monitor.php on line 429
al final me da este
Notice: Undefined index: not_total in C:\xampp\htdocs\redsocial.com\redsocial\app\modelo s\Monitor.php on line 439
Query was empty
error: