<?if (is_array($payments)):?>

    <table>
        <tr>
            <td><strong>Заказ</strong></td>
            <td><strong>Дата</strong></td>
            <td><strong>Продукт</strong></td>
            <td><strong>Оплата</strong></td>
        </tr>   
    <?foreach ($payments as $payment):?>
        <tr>
            <td><?=$payment['buy_id']?></td>
            <td><?=$payment['date']?></td>
                
                <?if ($payment['category_id'] <> 2 && $payment['buy_status'] == 1):?>
                    <td><strong><a href="<?=SITE?>read/<?=$payment['pricehash']?>"><?=$payment['pricename']?></a></strong></td>
                <?else:?>
                    <td><?=$payment['pricename']?></td>   
                <?endif?>
                
                <?if ($payment['buy_status'] == 1):?>    
                    <td>-<?=$payment['price']?> руб.</td>
                <?else:?>
                    <td><em>неоплачен</em></td>
                <?endif?>    
        </tr>  
    
    <?endforeach?>   
    </table> 

<?endif?>    