You are here

function uc_coupon_codes_csv in Ubercart Discount Coupons 7.2

Same name and namespace in other branches
  1. 5 uc_coupon.module \uc_coupon_codes_csv()
  2. 6 uc_coupon.admin.inc \uc_coupon_codes_csv()
  3. 7.3 uc_coupon.admin.inc \uc_coupon_codes_csv()

Generate a list of bulk coupon codes.

2 string references to 'uc_coupon_codes_csv'
uc_coupon_menu in ./uc_coupon.module
Implements hook_menu().
uc_coupon_purchase_menu in uc_coupon_purchase/uc_coupon_purchase.module
Implements hook_menu().

File

./uc_coupon.admin.inc, line 1136
Discount Coupons administration pages.

Code

function uc_coupon_codes_csv($coupon) {
  if (!$coupon->bulk) {
    drupal_not_found();
    return;
  }
  header('Content-Type: application/octet-stream');
  header('Content-Disposition: attachment; filename="' . $coupon->code . '.csv";');
  for ($id = 0; $id < $coupon->data['bulk_number']; $id++) {
    echo uc_coupon_get_bulk_code($coupon, $id) . "\n";
  }
  exit;
}