Updated SQL File to remove dummy data.

This commit is contained in:
Garcia-Gomez
2026-01-26 13:02:02 -08:00
commit 40aa44fd7a
21 changed files with 1977 additions and 0 deletions

25
update_project_order.php Normal file
View File

@@ -0,0 +1,25 @@
<?php
require 'db.php';
header('Content-Type: application/json');
$data = json_decode(file_get_contents('php://input'), true);
if (!$data || !is_array($data)) {
echo json_encode(['success' => false, 'message' => 'Invalid input']);
exit;
}
$stmt = $pdo->prepare("UPDATE projects SET sort_order = ? WHERE id = ?");
foreach ($data as $item) {
$id = $item['id'];
$order = $item['order'];
if (!is_numeric($id) || !is_numeric($order)) continue;
$stmt->execute([$order, $id]);
}
echo json_encode(['success' => true]);
exit;