File: /mnt/data/dreamsrent-wp/wp-content/plugins/dreamsrent-booking/inc/orders-list.php
<h2><?php esc_html_e('Orders', 'bookingcore'); ?></h2>
<?php
$orders = wc_get_orders(array(
'limit' => -1,
));
if (!empty($orders)) :
?>
<table class="widefat fixed" cellspacing="0">
<thead>
<tr>
<th scope="col"><?php esc_html_e('Order ID', 'bookingcore'); ?></th>
<th scope="col"><?php esc_html_e('Product Name', 'bookingcore'); ?></th>
<th scope="col"><?php esc_html_e('Date', 'bookingcore'); ?></th>
</tr>
</thead>
<tbody>
<?php foreach ($orders as $order) :
$order_items = $order->get_items();
foreach ($order_items as $item_id => $item) :
?>
<tr>
<td><?php echo esc_html($order->get_id()); ?></td>
<td><?php echo esc_html($item->get_name()); ?></td>
<td><?php echo esc_html($order->get_date_created()->date('Y-m-d H:i:s')); ?></td>
</tr>
<?php endforeach; ?>
<?php endforeach; ?>
</tbody>
</table>
<?php else : ?>
<p><?php esc_html_e('No orders found.', 'bookingcore'); ?></p>
<?php endif; ?>