Edit dashboard.php via Editor

This commit is contained in:
Flatlogic Bot 2026-01-01 09:17:36 +00:00
parent 96076ad6fc
commit ab93e047c8

23
dashboard.php Normal file
View File

@ -0,0 +1,23 @@
<?php
session_start();
header("Content-Type: application/json");
require "db/config.php";
$userId = $_SESSION['user_id'] ?? null;
if (!$userId) {
http_response_code(401);
echo json_encode(["error" => "unauthorized"]);
exit;
}
$stmt = $pdo->prepare("
SELECT id, title, status, created_at, updated_at, final_video_url
FROM projects
WHERE user_id = ?
ORDER BY created_at DESC
");
$stmt->execute([$userId]);
echo json_encode($stmt->fetchAll());
exit;