<tr>
    <th>
        Status
    </th>
    <th>
        Doctor Note
    </th>
    <th>
        <a href="<?= 'manage.orders.php?' . modifyViewStateQueryString($_REQUEST, $view_state_keys, ['orderbydir' => $orderbydiropp, 'orderbyfield' => 'order-date']) ?>">
            Date
            <?php
            if ($_REQUEST['orderbyfield'] !== 'order-date') {
                $odorderbydir = 'DESC';
            } else {
                $odorderbydir = $orderbydir;
                ?>
                <img src="/admin/images/<?php if ($odorderbydir === 'DESC') { ?>down.png<?php } else { ?>up.png<?php } ?>"
                     border="0"
                     alt=""
                />
            <?php
            }
            ?>
        </a>
    </th>
    <th>
        Customer name
    </th>
    <th>
        <a href="<?= 'manage.orders.php?' . modifyViewStateQueryString($_REQUEST, $view_state_keys, ['orderbydir' => $orderbydiropp, 'orderbyfield' => 'item']) ?>">
            Purchased
            <?php
            if ($_REQUEST['orderbyfield'] !== 'item') {
                $odorderbydir = 'ASC';
            } else {
                $odorderbydir = $orderbydir;
                ?>
                <img src="/admin/images/<?php if ($odorderbydir === 'DESC') { ?>down.png<?php } else { ?>up.png<?php } ?>"
                     border="0"
                     alt=""
                />
            <?php
            }
            ?>
        </a>
    </th>
    <th>
        Actions
    </th>
</tr>