refactor: migrate API scripts to a centralized directory and implement shared database configuration

This commit is contained in:
superbia-17
2026-06-12 23:54:55 +07:00
parent 4424a57a0d
commit 5f1da32298
4 changed files with 9 additions and 4 deletions
+2 -1
View File
@@ -1,5 +1,6 @@
<?php
$conn = new mysqli("localhost", "root", "", "gis_project");
require_once __DIR__ . '/config.php';
$conn = getDB();
$id = $_POST['id'];
+2 -1
View File
@@ -1,6 +1,7 @@
<?php
header('Content-Type: application/json');
$conn = new mysqli("localhost", "root", "", "gis_project");
require_once __DIR__ . '/config.php';
$conn = getDB();
$result = $conn->query("SELECT * FROM worship_places");
$places = [];
+2 -1
View File
@@ -1,6 +1,7 @@
<?php
header('Content-Type: application/json');
$conn = new mysqli("localhost", "root", "", "gis_project");
require_once __DIR__ . '/config.php';
$conn = getDB();
$name = $_POST['name'];
$lat = $_POST['lat'];
+3 -1
View File
@@ -1,5 +1,7 @@
<?php
$conn = new mysqli("localhost", "root", "", "gis_project");
require_once __DIR__ . '/config.php';
$conn = getDB();
$id = $_POST['id'];
$rad = $_POST['radius'];