-- Uncomment this line to delete the database table and start fresh -- DROP table map_points_of_interest; CREATE TABLE IF NOT EXISTS map_points_of_interest ( id INTEGER PRIMARY KEY AUTOINCREMENT, datetime_added TIMESTAMP DEFAULT CURRENT_TIMESTAMP, latitude TEXT NOT NULL, longitude TEXT NOT NULL, location_name TEXT NOT NULL ); DELETE FROM map_points_of_interest WHERE id = $delete; SELECT 'redirect' AS component, 'map_points_of_interest.sql' AS link WHERE $delete IS NOT NULL; INSERT INTO map_points_of_interest (latitude, longitude, location_name) SELECT :latitude, :longitude, :location_name WHERE :latitude IS NOT NULL AND :longitude IS NOT NULL; SELECT 'table' AS component, 'Points of Interest' AS title, 'Remove' AS markdown, 'View Point' AS markdown, TRUE AS sort, TRUE AS search; SELECT latitude AS Latitude, longitude AS Longitude, location_name AS Name, '[Remove](map_points_of_interest.sql?delete=' || id || ')' AS Remove, '[Go](map_points_of_interest.sql?lat=' || latitude || '&long=' || longitude || ')' AS 'View Point' FROM map_points_of_interest; SELECT 'map' AS component; SELECT 'Your pin: ' || $lat || ',' || $long AS title, $lat AS latitude, $long AS longitude; SELECT 'form' AS component, 'Add a new point of interest:' AS title; SELECT 'latitude' AS name, '40.6892' AS placeholder, :latitude AS value; SELECT 'longitude' AS name, '-74.0445' AS placeholder, :longitude AS value; SELECT 'location_name' AS name, 'Liberty' AS placeholder, :location_name AS value;