X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fmember%2Fwhat-cash_coupon.php;h=71fdec3434c73ead517f632c1fb85b9f13267816;hb=fed7fa31618320f28ae73af4f19d008012d75849;hp=ca5d40978625bfcae724e9c776538b40c8592701;hpb=2379934be6a196a54f4155bb8e24c49b20736969;p=mailer.git diff --git a/inc/modules/member/what-cash_coupon.php b/inc/modules/member/what-cash_coupon.php index ca5d409786..71fdec3434 100644 --- a/inc/modules/member/what-cash_coupon.php +++ b/inc/modules/member/what-cash_coupon.php @@ -16,8 +16,8 @@ * $Author:: $ * * -------------------------------------------------------------------- * * Copyright (c) 2003 - 2009 by Roland Haeder * - * Copyright (c) 2009 - 2011 by Mailer Developer Team * - * For more information visit: http://www.mxchange.org * + * Copyright (c) 2009 - 2012 by Mailer Developer Team * + * For more information visit: http://mxchange.org * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * @@ -37,7 +37,7 @@ // Some security stuff... if (!defined('__SECURITY')) { - die(); + exit(); } elseif (!isMember()) { redirectToIndexMemberOnlyModule(); } @@ -57,34 +57,34 @@ if (isFormSent()) { if (isPostRequestElementSet('coupon_code')) { // Search for the coupon $result = SQL_QUERY_ESC("SELECT - c.`coupon_id`, - c.`userid`, - c.`coupon_code`, - UNIX_TIMESTAMP(d.`coupon_created`) AS `coupon_created`, - UNIX_TIMESTAMP(d.`coupon_expired`) AS `coupon_expired`, - d.`coupon_type`, - d.`total_created`, - d.`total_cashed`, - d.`points`, - d.`coupon_description` + `c`.`coupon_id`, + `c`.`userid`, + `c`.`coupon_code`, + UNIX_TIMESTAMP(`d`.`coupon_created`) AS `coupon_created`, + UNIX_TIMESTAMP(`d`.`coupon_expired`) AS `coupon_expired`, + `d`.`coupon_type`, + `d`.`total_created`, + `d`.`total_cashed`, + `d`.`points`, + `d`.`coupon_description` FROM - `{?_MYSQL_PREFIX?}_user_coupons` AS c + `{?_MYSQL_PREFIX?}_user_coupons` AS `c` INNER JOIN - `{?_MYSQL_PREFIX?}_coupon_data` AS d + `{?_MYSQL_PREFIX?}_coupon_data` AS `d` ON - c.`coupon_id`=d.`id` + `c`.`coupon_id`=`d`.`id` WHERE - c.`coupon_code`='%s' AND - c.`userid`=%s AND - c.`cashed_on` IS NULL AND - UNIX_TIMESTAMP(d.`coupon_expired`) > UNIX_TIMESTAMP() + `c`.`coupon_code`='%s' AND + `c`.`userid`=%s AND + `c`.`cashed_on` IS NULL AND + UNIX_TIMESTAMP(`d`.`coupon_expired`) > UNIX_TIMESTAMP() LIMIT 1", array( postRequestElement('coupon_code'), getMemberId() ), __FILE__, __LINE__); - // Do we have an entry? + // Is there an entry? if (SQL_NUMROWS($result) == 1) { // Load data $content = SQL_FETCHARRAY($result); @@ -110,7 +110,7 @@ LIMIT 1", // Does it work? if (SQL_HASZEROAFFECTED()) { // Abort it here, it always must work - debug_report_bug(__FILE__, __LINE__, 'User coupon cannot be updated! coupon_id=' . $content['coupon_id']); + reportBug(__FILE__, __LINE__, 'User coupon cannot be updated! coupon_id=' . $content['coupon_id']); } // END - if // Update count as well @@ -120,7 +120,7 @@ LIMIT 1", // Does it work? if (SQL_HASZEROAFFECTED()) { // Abort it here, it always must work - debug_report_bug(__FILE__, __LINE__, 'Coupon data cannot be updated! coupon_id=' . $content['coupon_id']); + reportBug(__FILE__, __LINE__, 'Coupon data cannot be updated! coupon_id=' . $content['coupon_id']); } // END - if // Run post filter chain @@ -165,7 +165,7 @@ LIMIT 1", } } else { // Load form template - loadTemplate('member_cash_coupon', false); + loadTemplate('member_cash_coupon', FALSE); } // [EOF]