diff --git a/accounting.php b/accounting.php index 363ef2c..0f66122 100644 --- a/accounting.php +++ b/accounting.php @@ -31,11 +31,24 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['add_entry'])) { } } -$ledger = get_full_ledger(); +// Pagination setup +$page = isset($_GET['p']) ? (int)$_GET['p'] : 1; +$limit = 10; +$offset = ($page - 1) * $limit; + +// Fetch ledger data with pagination +$ledger_all = get_full_ledger(); +$total_items = count($ledger_all); +$total_pages = ceil($total_items / $limit); +$ledger = array_slice($ledger_all, $offset, $limit); + $trial_balance = get_trial_balance(); $balance_sheet = get_balance_sheet(); ?> + + +
| الاسم | النوع | ||
|---|---|---|---|
| الاسم | النوع | إجراءات | |
| = htmlspecialchars($account['name']) ?> | -= htmlspecialchars($account['type']) ?> | += htmlspecialchars($typeMap[$account['type']] ?? $account['type']) ?> | ++ + + |