<?php

include_once 'server/config/config.php';
include_once 'server/lib/mod_dbm/package.dbm.php';

class PoiManager {

    static function getPoiList(User $user){
         
        $dao = new dbObject();
        $q = sprintf("SELECT p.id_poi, p.location_id, p.lat, p.lng, p.id_grupo, p.nombre_poi, p.mostrar, i.*, l.num_casa, l.road, l.city, l.state, l.country, l.postcode
                        FROM pois p LEFT JOIN icons i ON p.icon_id=i.icon_id 
                        LEFT JOIN locations l ON l.location_id = p.location_id 
                        WHERE id_organizacion = %d  AND p.activo =1",$user->getIdOrganizacion());
        $pois = $dao->fetchQuery($q);
        return $pois;
    }
}
