$customer['customer_id']]; if ($status) { $where .= ' AND order_status = :status'; $params['status'] = $status; } $total = db()->count('orders', $where, $params); $pagination = paginate($total, $page, 10); $orders = db()->fetchAll( "SELECT * FROM orders WHERE {$where} ORDER BY created_at DESC LIMIT :limit OFFSET :offset", array_merge($params, ['limit' => $pagination['per_page'], 'offset' => $pagination['offset']]) ); require_once __DIR__ . '/../includes/header.php'; require_once __DIR__ . '/includes/sidebar.php'; ?>
View and track your order history