if ($action == "update") {
            $DBRESULT =& $pearDB->query("UPDATE `mod_gmap_locations` SET `h_id`='{$hg_id}',`lat`='{$lat}',`lng`='{$lng}',`address`='{$address}' WHERE l_id='{$l_id}' LIMIT 1");
        } else {
            if ($action == "delete") {
                $DBRESULT =& $pearDB->query("DELETE from `mod_gmap_locations` WHERE l_id='{$l_id}' LIMIT 1");
            }
        }
    }
    if (PEAR::isError($DBRESULT)) {
        print "DB Error : " . $DBRESULT->getDebugInfo() . "<br>";
    }
}
/*
 * we pass either group or host
 */
getHostgroupLatLong2('host');
getHostList();
$mod_gmap_options = readConfigOptions($pearDB, $oreon);
$tpl = new Smarty();
$tpl = initSmartyTpl($path, $tpl);
$tpl->assign("h_names", $smarty_host);
$tpl->assign("host_list", $smarty_host_list);
$tpl->assign("hostgroup_list", $smarty_hostgroup_list);
$tpl->assign("gmap_lat", $mod_gmap_options['lat']);
$tpl->assign("gmap_lng", $mod_gmap_options['lng']);
$tpl->assign("gmap_height", $mod_gmap_options['height']);
$tpl->assign("gmap_zoom", $mod_gmap_options['zoomLevel']);
/*
 * translations
 */
$tpl->assign("host", _("Hosts"));
        $DBRESULT =& $pearDB->query("INSERT into `mod_gmap_locations` SET `hg_id`='{$hg_id}',`lat`='{$lat}',`lng`='{$lng}',`address`='{$address}'");
    } else {
        if ($action == "update") {
            $DBRESULT =& $pearDB->query("UPDATE `mod_gmap_locations` SET `hg_id`='{$hg_id}',`lat`='{$lat}',`lng`='{$lng}',`address`='{$address}' WHERE l_id='{$l_id}' LIMIT 1");
        } else {
            if ($action == "delete") {
                $DBRESULT =& $pearDB->query("DELETE from `mod_gmap_locations` WHERE l_id='{$l_id}' LIMIT 1");
            }
        }
    }
    if (PEAR::isError($DBRESULT)) {
        print "DB Error : " . $DBRESULT->getDebugInfo() . "<br>";
    }
}
// we pass either group or host
getHostgroupLatLong2('group');
getHostGroupList();
$mod_gmap_options = readConfigOptions($pearDB, $oreon);
$tpl = new Smarty();
$tpl = initSmartyTpl($path, $tpl);
$tpl->assign("h_names", $smarty_host);
$tpl->assign("host_list", $smarty_host_list);
$tpl->assign("hostgroup_list", $smarty_hostgroup_list);
$tpl->assign("gmap_zoom", $mod_gmap_options['zoomLevel']);
$tpl->assign("gmap_lat", $mod_gmap_options['lat']);
$tpl->assign("gmap_lng", $mod_gmap_options['lng']);
/*
 * translations
 */
$tpl->assign("host", _("HostGroups"));
$tpl->assign("address", _("Address, postal code, city, country"));