Initial commit

This commit is contained in:
Porawit Dongwang
2026-09-16 23:20:08 +07:00
commit 0041668dbb
32577 changed files with 3687927 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
<?php
require_once 'init.php';
header('Content-Type: application/json');
try {
$stmt = $pdo->query("SELECT * FROM websites ORDER BY display_order ASC");
$websites = $stmt->fetchAll(PDO::FETCH_ASSOC);
$summary = [
'total' => count($websites),
'normal' => 0,
'maintenance' => 0,
'cancelled' => 0
];
foreach ($websites as $row) {
if(isset($summary[$row['status']])) {
$summary[$row['status']]++;
}
}
echo json_encode(['success' => true, 'websites' => $websites, 'summary' => $summary]);
} catch (Exception $e) {
echo json_encode(['success' => false, 'message' => $e->getMessage()]);
}