You are here

function uc_coupon_delete_confirm_submit in Ubercart Discount Coupons 5

Same name and namespace in other branches
  1. 6 uc_coupon.admin.inc \uc_coupon_delete_confirm_submit()
  2. 7.3 uc_coupon.admin.inc \uc_coupon_delete_confirm_submit()
  3. 7.2 uc_coupon.admin.inc \uc_coupon_delete_confirm_submit()

File

./uc_coupon.module, line 764
Provides discount coupons for Ubercart.

Code

function uc_coupon_delete_confirm_submit($form_id, $form) {
  $coupon = uc_coupon_load($form['cid']);
  db_query("DELETE FROM {uc_coupons} WHERE cid = %d", $form['cid']);
  db_query("DELETE FROM {uc_coupons_orders} WHERE cid = %d", $form['cid']);
  drupal_set_message(t('Coupon %name has been deleted.', array(
    '%name' => $coupon->name,
  )));
  drupal_goto('admin/store/customers/coupon' . ($coupon->status ? '' : '/inactive'));
}