     1:  2:  3:  4:  5:  6:  7:  8:  9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26:

    <?php

    namespace WPGMZA;

    class MapSelect
    {
        public function __construct()
        {

        }

        public function html()
        {
            global $wpdb;

            $maps = $wpdb->get_results("SELECT id, map_title FROM {$wpdb->prefix}wpgmza_maps");

            $options = "";
            foreach($maps as $map)
                $options .= "<option value='{$map->id}'>" . htmlentities($map->map_title) . "</option>";

            $html = '<select name="map">' . $options . '</select>';

            return $html;
        }
    }