2.5 KiB
2.5 KiB
✓ WebGIS Fixed - Access Instructions
Issue Fixed
- ✓ Database schema updated and verified
- ✓ API error handling improved
- ✓ Trigger issues resolved
- ✓ All PHP files syntax checked
IMPORTANT: How to Access the Application
The application requires an HTTP server. Do NOT open the file directly from Windows Explorer!
Start XAMPP/Apache Server
- Open XAMPP Control Panel
- Click "Start" for Apache and MySQL
- Wait until both show as "Running" (green)
Access the Application
- Open in Browser:
http://localhost/webgis/ - NOT:
file:///C:/xampp_new/htdocs/webgis/index.html(This blocks fetch requests!)
What Was Fixed
1. Database Issues
- Created
webgis_unifieddatabase - Created
data_unifiedtable with all required columns:- Rumah Ibadah (worship): nama, jenis, alamat, kontak, kegiatan, kapasitas, radius_meter
- Rumah Miskin (poor_house): nama_kepala_keluarga, alamat, jumlah_anggota, kondisi_rumah, sumber_penghasilan, kebutuhan_prioritas, status_bantuan
- Data Umum (point): nama, no_wa, buka_24jam
2. API Error Handling
- Improved error messages in save_point.php
- Added proper Content-Type headers
- Added response status codes
- Added database connection checks
- Updated: save_point.php, update_point.php, delete_point.php, get_point.php
3. Database Triggers
- Fixed trigger references to use IFNULL for NULL fields
- Resolved "Unknown column" error in triggers
Testing the Application
- Access via
http://localhost/webgis/ - Click "Draw Marker" tool on the map
- Click a location on the map
- Select marker type (Rumah Ibadah, Rumah Miskin, or Data Umum)
- Fill in the form fields
- Click "Simpan" to save
Troubleshooting
If you still see "Failed to fetch" errors:
- Check Apache is running - XAMPP Control Panel should show "Running"
- Check MySQL is running - XAMPP Control Panel should show "Running"
- Open Developer Console - F12 in browser
- Check Network tab - Verify requests are going to http://localhost/webgis/save_point.php
- Check Console tab - Look for specific error messages
Database Structure
All data is stored in webgis_unified.data_unified table with columns:
- id, tipe, nama, jenis, alamat, kontak, no_wa, status
- kegiatan, kapasitas, radius_meter
- nama_kepala_keluarga, jumlah_anggota, kondisi_rumah
- sumber_penghasilan, kebutuhan_prioritas, status_bantuan
- latitude, longitude, geom (for geometries)
- created_at, updated_at (timestamps)