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 <?php
$conn = new mysqli("localhost", "root", "", "gis_project"); require_once __DIR__ . '/config.php';
$conn = getDB();
$id = $_POST['id']; $id = $_POST['id'];
+2 -1
View File
@@ -1,6 +1,7 @@
<?php <?php
header('Content-Type: application/json'); 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"); $result = $conn->query("SELECT * FROM worship_places");
$places = []; $places = [];
+2 -1
View File
@@ -1,6 +1,7 @@
<?php <?php
header('Content-Type: application/json'); header('Content-Type: application/json');
$conn = new mysqli("localhost", "root", "", "gis_project"); require_once __DIR__ . '/config.php';
$conn = getDB();
$name = $_POST['name']; $name = $_POST['name'];
$lat = $_POST['lat']; $lat = $_POST['lat'];
+3 -1
View File
@@ -1,5 +1,7 @@
<?php <?php
$conn = new mysqli("localhost", "root", "", "gis_project"); require_once __DIR__ . '/config.php';
$conn = getDB();
$id = $_POST['id']; $id = $_POST['id'];
$rad = $_POST['radius']; $rad = $_POST['radius'];