<?php
$workspace_path = "c:\\Users\\User\\Documents\\Antigravity Projects\\Apperal Managment System -Vanila- PHP";
chdir($workspace_path);

require_once 'includes/db.php';

$invoices = fetchAll("SELECT id, invoice_number, product_details, units_completed, unit_price, total_amount FROM production_invoices LIMIT 10");

echo "--- Existing Invoices ---\n";
foreach ($invoices as $inv) {
    $preview = substr(str_replace("\n", " | ", $inv['product_details']), 0, 80);
    echo "ID: {$inv['id']} | Num: {$inv['invoice_number']} | Details: {$preview}...\n";
}
?>
