function ym_export_coupon_xls($coupon_id)
{
    require_once YM_CLASSES_DIR . 'ym-xls.class.php';
    $xls = new YourMember_xls();
    $all_users = ym_coupon_get_uses($coupon_id);
    $xls->download_from_array($all_users);
}
function ym_render_coupon_view($coupon_id)
{
    // who used this coupon and for what
    $data = ym_coupon_get_uses($coupon_id);
    echo '<table>';
    foreach ($data as $item) {
        echo '<tr ' . ($i % 2 ? 'class="alternate"' : '') . '>';
        echo '<td>(' . $item->id->ID . ') ' . $item->login . ' (' . $item->email . ')</td>';
        echo '<td>' . $item->id->account_type . '</td>';
        echo '<td>' . $item->id->expire_date . '</td>';
        echo '<td>' . $item->id->purchased . '</td>';
        echo '</tr>';
    }
    echo '</table>';
}