░▒▓████████████████████████████████▓▒░ ░▒▓█ ▓▒░ ░▒▓█ ~ S W A M P ~ ▓▒░ ░▒▓█ ▓▒░ ░▒▓████████████████████████████████▓▒░
lon105.truehost.cloud
LOCATION:
/home/ilrtztmy/woodcoffiefurnitureworks.com/api/dashboard
☗ ROOT
↻ REFRESH
✎ CARVE FLESH
EDITING: stats.php
<?php header("Access-Control-Allow-Origin: *"); header("Content-Type: application/json; charset=UTF-8"); include_once __DIR__ . '/../config/db.php'; $database = new Database(); $db = $database->getConnection(); $stats = array(); // Get total products $query = "SELECT COUNT(*) as total_products FROM products"; $stmt = $db->prepare($query); $stmt->execute(); $row = $stmt->fetch(PDO::FETCH_ASSOC); $stats['total_products'] = (int) $row['total_products']; // Get total categories $query = "SELECT COUNT(*) as total_categories FROM categories"; $stmt = $db->prepare($query); $stmt->execute(); $row = $stmt->fetch(PDO::FETCH_ASSOC); $stats['total_categories'] = (int) $row['total_categories']; // Get total quotes $query = "SELECT COUNT(*) as total_quotes FROM quotes"; $stmt = $db->prepare($query); $stmt->execute(); $row = $stmt->fetch(PDO::FETCH_ASSOC); $stats['total_quotes'] = (int) $row['total_quotes']; // Get unread quotes count (this is the one your dashboard card needs) $query = "SELECT COUNT(*) as unread_quotes FROM quotes WHERE status = 'unread'"; $stmt = $db->prepare($query); $stmt->execute(); $row = $stmt->fetch(PDO::FETCH_ASSOC); $stats['unread_quotes'] = (int) $row['unread_quotes']; http_response_code(200); echo json_encode($stats); ?>
CANCEL
Name
Type
Size
Modified
Actions
↩ ..
DIR
—
—
📄 stats.php
PHP
1.3 KB
2026-06-22 10:46
EDIT