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

21
toggle_highlight.php Normal file
View File

@@ -0,0 +1,21 @@
<?php
require 'db.php';
$data = json_decode(file_get_contents('php://input'), true);
$type = $data['type'];
$id = intval($data['id']);
$highlighted = isset($data['highlighted']) && $data['highlighted'] ? 1 : 0;
if ($type === 'task') {
$stmt = $pdo->prepare("UPDATE tasks SET highlighted = ? WHERE id = ?");
$stmt->execute([$highlighted, $id]);
echo json_encode(['success' => true]);
} elseif ($type === 'subtask') {
$stmt = $pdo->prepare("UPDATE subtasks SET highlighted = ? WHERE id = ?");
$stmt->execute([$highlighted, $id]);
echo json_encode(['success' => true]);
} else {
echo json_encode(['success' => false, 'error' => 'Invalid type']);
}
?>