A PHP Error was encountered

Severity: Notice

Message: Undefined index: longitud

Filename: controllers/Buscador.php

Line Number: 116

Backtrace:

File: /homepages/24/d787549085/htdocs/eventonia/application/controllers/Buscador.php
Line: 116
Function: _error_handler

File: /homepages/24/d787549085/htdocs/eventonia/index.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at /homepages/24/d787549085/htdocs/eventonia/system/core/Exceptions.php:271)

Filename: core/Common.php

Line Number: 564

Backtrace:

File: /homepages/24/d787549085/htdocs/eventonia/application/models/Model_Buscador.php
Line: 296
Function: query

File: /homepages/24/d787549085/htdocs/eventonia/application/controllers/Buscador.php
Line: 118
Function: get_events_by_poblacion

File: /homepages/24/d787549085/htdocs/eventonia/index.php
Line: 315
Function: require_once

Database Error

A Database Error Occurred

Error Number: 1064

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')) * COS(RADIANS(coo1_lat_evento)) * COS(RADIANS()) ) ' at line 4

SELECT id_evento,id_grupo,nombre,tel_publico,ubicacion,poblacion,poblacionseo,coo1_lat_evento as c1,coo2_lng_evento as c2,e.estilo,titulo,e.direccion as evento_direccion,e.descripcion as evento_descripcion,b.tipo,b.direccion as bar_direccion,b.descripcion as bar_descripcion,e.estilo,precio,precio_explicacion,fecha_inicio,fecha_fin,IFNULL(fecha_fin, DATE_ADD(fecha_inicio, INTERVAL 2 HOUR)) as fecha_fin_falsa,foto,tipo,distance FROM (SELECT *, (6371 * ACOS( SIN(RADIANS(coo1_lat_evento)) * SIN(RADIANS()) + COS(RADIANS(coo2_lng_evento - )) * COS(RADIANS(coo1_lat_evento)) * COS(RADIANS()) ) ) AS distance FROM mt_evento left join mt_poblacion ON mt_evento.poblacion_id = mt_poblacion.idpoblacion WHERE 1=1 AND fecha_inicio >= '2020-08-05 22:22:38' HAVING distance < 120 ORDER BY distance ASC LIMIT 1000) e LEFT JOIN ( select * from mt_grupo left join mt_fotos_grupo on mt_fotos_grupo.grupo_id=mt_grupo.id_grupo where mt_fotos_grupo.principal = 1 or mt_fotos_grupo.foto is null ) b ON e.grupo_id = b.id_grupo Having 1=1 order by fecha_inicio

Filename: models/Model_Buscador.php

Line Number: 296