Function Reference: geodir_payment_coupon_form

Summary

This function has not been documented yet.

Source Code

function geodir_payment_coupon_form() {
global $wpdb;

$usage_limit = ”;

if (isset($_REQUEST[‘id’]) && $_REQUEST[‘id’] != ”) {
$cid = (int)$_REQUEST[‘id’];

$couponsql = $wpdb->prepare(“select * from “.COUPON_TABLE.” where cid=%d”, array($cid));
$couponinfo = $wpdb->get_row($couponsql);

$usage_limit = isset($couponinfo->usage_limit) ? trim($couponinfo->usage_limit) : ”;
}

$post_types = geodir_get_posttypes();
$gd_id = !empty($_REQUEST[‘id’]) && (int)$_REQUEST[‘id’] > 0 ? (int)$_REQUEST[‘id’] : ”;
$coupon_code = isset($couponinfo->coupon_code) ? $couponinfo->coupon_code : ”;
$coupon_post_types = isset($couponinfo->post_types) && $couponinfo->post_types != ” ? explode(‘,’, $couponinfo->post_types) : array();
$coupon_discount_type = isset($couponinfo->discount_type) && $couponinfo->discount_type == ‘amt’ ? ‘amt’ : ‘per’;
$discount_amount = isset($couponinfo->discount_amount) && $couponinfo->discount_amount != ” ? (float)$couponinfo->discount_amount : ”;
$recurring = isset($couponinfo->recurring) && (int)$couponinfo->recurring == 1 ? 1 : 0;
$status = isset($couponinfo->status) && (int)$couponinfo->status == 1 ? 1 : 0;

$section_title = $gd_id ? __(‘Edit Coupon’, ‘geodir_payments’) : __(‘Add Coupon’, ‘geodir_payments’);
?>


id=”discount_type” value=”per”>
id=”discount_type” value=”amt”>

1 0