diff --git a/blomzt/add.php b/blomzt/add.php new file mode 100644 index 0000000..8d6cf54 --- /dev/null +++ b/blomzt/add.php @@ -0,0 +1,90 @@ + + + + + + Blomzt - Add + + + + + + + + + + + + + + +
+ + + +
+ + + + + + + + + + + + 0; +} + +function addToTable($lat, $lon, $url, $table, $conn) { + if (is_numeric($lat) == false || is_numeric($lon) == false || + $lat > 180 || $lat < -180 || + $lon > 180 || $lon < -180) + { + return false; + } + + $sql = "INSERT INTO `" . $table . "` (`id`, `location`, `url`, `date_added`) VALUES (NULL, GeomFromText('POINT(" . $lon ." " . $lat . ")',4326), 'test', CURRENT_TIMESTAMP)"; + //printf($sql); + $res = mysqli_query($conn, $sql); + //($res) ? printf("true") : printf("false"); + return $res; +} +?> \ No newline at end of file diff --git a/blomzt/main.php b/blomzt/main.php index 906a0e5..e604635 100644 --- a/blomzt/main.php +++ b/blomzt/main.php @@ -8,17 +8,8 @@ if (mysqli_connect_errno()) { die("Connection failed: " . mysqli_connect_error()); } -if (!TableExists($config["db_table"], $conn)) { - $sql = "CREATE TABLE " . $config["db_table"] . " ( - id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY, location Point NOT NULL, url VARCHAR(65), date_added TIMESTAMP) - "; - mysqli_query($conn, $sql); -} - ?> - - Blomzt @@ -32,55 +23,8 @@ if (!TableExists($config["db_table"], $conn)) { - - ?> - -
- - - -
- - - - "; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - } - ?> -
Date AddedLatitudeLongtitudeImage
"; - echo $row["date_added"]; - echo ""; - echo $row["Latitude"]; - echo ""; - echo $row["Longtitude"]; - echo ""; - echo ""; - echo "
- - -