{# Template : Contact #}
{% 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>

    <ul class="tabnav el">
        <li class="{{ request().requestUri() == '/shop/admin/medications/manage.medications.php' ? 'selected' : '' }}">
            <a href="/shop/admin/medications/manage.medications.php">Customer Profile Medications</a>
        </li>
        <li class="{{ request().requestUri() == '/plugins/Prescriptions/admin/' ? 'selected' : '' }}">
            <a href="/plugins/Prescriptions/admin/">Private Prescription Medications</a>
        </li>
    </ul>

    {% include 'admin/messages.twig' %}

    <form method="POST" action="{{ self }}" enctype="multipart/form-data" class="style">
        <h3>Upload Prescription Price list (CSV)</h3>
        <div class="row">
            <label for="delimiter">
                Delimiter
            </label>
            <select name="delimiter" id="delimiter">
                <option value=",">Comma (,)</option>
                <option value="\t">Tab (\t)</option>
                <option value=";">Semicolon (;)</option>
            </select>
        </div>
        <div class="row">
            <label for="file">
                Price list file
            </label>
            <input type="file"
                   name="file"
                   id="file"/>
        </div>
        <div class="row">
            <button type="submit"
                    name="action"
                    value="upload"
                    class="btn">
                Upload
            </button>
        </div>
    </form>

    {% if items|length > 0 %}
        <table class="manage-items">
            <thead>
                <tr>
                    <th>Name</th>
                    <th>Pack Size</th>
                    <th>Prescription Price</th>
                    <th>Cost</th>
                </tr>
            </thead>
            <tbody class="tabular">
                {% for item in items %}
                    <tr>
                        <td>{{ item.name }}</td>
                        <td>{{ item.pack_size }}</td>
                        <td>&pound;{{ item.price }}</td>
                        <td>&pound;{{ item.store_cost }}</td>
                    </tr>
                {% endfor %}
            </tbody>

        </table>
        {{ pagination|raw }}
    {% endif %}

{% endblock %}