<?php

use yii\helpers\Html;

/** @var array $orders */
?>
<div class="panel panel-default">
  <div class="panel-heading">Magento import queue</div>
  <div class="panel-body">
    <p>Imported Magento carts are listed below. Use the console import command to refresh the queue.</p>
  </div>
  <table class="table table-striped">
    <thead>
      <tr>
        <th>ID</th>
        <th>Order #</th>
        <th>Status</th>
        <th>Email</th>
        <th>Date</th>
      </tr>
    </thead>
    <tbody>
      <?php foreach ($orders as $order) : ?>
        <tr>
          <td><?= Html::encode((string) ($order->id ?? '')) ?></td>
          <td><?= Html::encode((string) ($order->ordernumber ?? '')) ?></td>
          <td><?= Html::encode((string) ($order->status ?? '')) ?></td>
          <td><?= Html::encode((string) ($order->email ?? '')) ?></td>
          <td><?= Html::encode((string) date('Y-m-d H:i', (int) ($order->dateordered ?? 0))) ?></td>
        </tr>
      <?php endforeach; ?>
    </tbody>
  </table>
</div>
