<div class="form form-profile aif" style='width:auto'>
    <h2 style="margin-top:0px;">
        Promo Codes
    </h2>
    <table class="admintable" style="width:100%; overflow:hidden;">
        <tr>
            <th width="150">Code</th>
            <th width="150">Type</th>
            <th width="150">Amt</th>
            <th width="150">Allowed</th>
            <th width="150">Claimed</th>
            <th>Actions</th>
        </tr>
        <?php
        foreach ($promocodes as $pcode) {
            echo "<tr>
            <td style='padding:10px;'>{$pcode['code']}</td>
            <td style='padding:10px;'>{$pcode['type']}</td>
            <td style='padding:10px;'>{$pcode['amount']}</td>
            <td style='padding:10px;'>{$pcode['allowed']}</td>            
            <td style='padding:10px;'>{$pcode['claimed']}</td>           

            <td style='padding:10px;'><a href='?pcode&edit={$pcode['id']}'>edit</a> | <a href='?pcode&delete={$pcode['id']}' class='confirm'>delete</a></td></tr>";
        }
        ?>
    </table>
    
    <div style="margin:10px;">
        <a href='?pcode&add' class='btn btn-blue'>Add New</a>
    </div>
</div>