Initial commit: Flutter app + PHP/MySQL backend on Hostinger
Replaces Firebase with a self-hosted PHP/MySQL API served from winded.prymsolutions.com. Includes full backend (schema, auth, events, teams, brackets, suggestions, stats, media, file upload) and updated Flutter repositories and domain models. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/../config/helpers.php';
|
||||
cors();
|
||||
|
||||
$id = $_GET['id'] ?? '';
|
||||
$method = $_SERVER['REQUEST_METHOD'];
|
||||
$db = db();
|
||||
|
||||
if ($id === '') json_err('Missing id');
|
||||
|
||||
if ($method === 'PUT') {
|
||||
require_admin();
|
||||
$b = body();
|
||||
$status = $b['status'] ?? '';
|
||||
if (!in_array($status, ['pending','reviewed','implemented'])) json_err('Invalid status');
|
||||
$db->prepare('UPDATE suggestions SET status = ? WHERE id = ?')->execute([$status, $id]);
|
||||
json_ok(['updated' => true]);
|
||||
}
|
||||
|
||||
if ($method === 'DELETE') {
|
||||
require_admin();
|
||||
$db->prepare('DELETE FROM suggestions WHERE id = ?')->execute([$id]);
|
||||
json_ok(['deleted' => true]);
|
||||
}
|
||||
|
||||
json_err('Method not allowed', 405);
|
||||
Reference in New Issue
Block a user