prepare($sql); $stmt->execute($params); $expenses = $stmt->fetchAll(PDO::FETCH_ASSOC); // Calculate Totals $total_amount = 0; $category_breakdown = []; foreach ($expenses as $exp) { $total_amount += $exp['amount']; if (!isset($category_breakdown[$exp['category_name']])) { $category_breakdown[$exp['category_name']] = 0; } $category_breakdown[$exp['category_name']] += $exp['amount']; } // Fetch Categories $categories = db()->query("SELECT * FROM expense_categories ORDER BY name")->fetchAll(PDO::FETCH_ASSOC); ?>
الفترة من = $date_from ?> إلى = $date_to ?>
| التاريخ | التصنيف | الوصف | المورد | المرجع | طريقة الدفع | بواسطة | المبلغ |
|---|---|---|---|---|---|---|---|
| لا توجد بيانات للفترة المحددة | |||||||
| = $exp['date'] ?> | = htmlspecialchars($exp['category_name']) ?> | = htmlspecialchars($exp['description']) ?> | = htmlspecialchars($exp['vendor'] ?: '-') ?> | = htmlspecialchars($exp['reference'] ?: '-') ?> | = htmlspecialchars($exp['payment_method']) ?> | = htmlspecialchars($exp['created_by'] ?: '-') ?> | = number_format($exp['amount'], 2) ?> |
| الإجمالي النهائي: | = number_format($total_amount, 2) ?> | ||||||