{% extends 'layouts/admin.twig' %}

{% block content %}


    <ul class="breadcrumbs el">
        <li><a href="/admin/">Home</a> /</li>
        <li class="end">{{ page_meta.title }}</li>
    </ul>

    <h1>{{ page_meta.title }}</h1>
    {{ tabnav|raw }}

    {% if upcoming|length > 0 %}
        <table class="manage-items">
            <tr>
                <th>
                    Notification Date
                </th>
                <th>
                    Refill Date
                </th>
                <th>
                    Recipient
                </th>
                <th>
                    Prescription Info
                </th>
                <th>
                    Via Email
                </th>
                <th>
                    Via SMS
                </th>
            </tr>
            <tbody class="tabular">
            {% for notification in upcoming %}
                <tr>
                    <td>
                        {{ notification.reminder_date|date('d/m/Y') }}
                    </td>
                    <td>
                        {{ notification.refill_date|date('d/m/Y') }}
                    </td>
                    <td>
                        <a href="/modules/Members/admin/manage_member.php?id={{ notification.member.id }}">
                            {{ notification.member.fullname }}
                        </a>
                    </td>
                    <td>
                {% if notification.orderItem.item_name %}
                    {{ notification.orderItem.item_name }}
                {% else %}
                    {{ notification.medication_name }}
                {% endif %}
                    </td>
                    <td>
                        {{ notification.send_email ? 'Yes' : '-' }}
                    </td>
                    <td>
                        {{ notification.send_sms ? 'Yes' : '-' }}
                    </td>
                </tr>
            {% endfor %}
            </tbody>
        </table>
    {% else %}
        <p>
            There are no notifications here
        </p>
    {% endif %}



{% endblock %}