<?php
/**
 * @var \App\View\AppView $this
 * @var \App\Model\Entity\Notification[]|\Cake\Collection\CollectionInterface $notifications
 */
?>
<div class="notifications index content">
    <h3>Notificaciones</h3>
    <div class="table-responsive">
        <table>
            <thead>
                <tr>
                    <th><?= $this->Paginator->sort('ip') ?></th>
                    <th><?= $this->Paginator->sort('chatbot_id', 'Chat') ?></th>
                    <th>Mensaje</th>
                    <th><?= $this->Paginator->sort('send', 'Enviado') ?></th>
                    <th><?= $this->Paginator->sort('created', 'Registrado') ?></th>
                </tr>
            </thead>
            <tbody>
                <?php foreach ($notifications as $notification): ?>
                <tr>
                    <td><?= h($notification->ip) ?></td>
                    <td><?= $notification->has('chatbot') ? $notification->chatbot->name : '' ?></td>
                    <td><?= $notification->message ?></td>
                    <td><?= h($notification->send ? 'Si':'No') ?></td>
                    <td><?= h($notification->created) ?></td>
                </tr>
                <?php endforeach; ?>
            </tbody>
        </table>
    </div>
    <?= $this->element('paginator') ?>
</div>
