]> git.mxchange.org Git - mailer.git/commitdiff
Users can now change receive status for coupons
authorRoland Häder <roland@mxchange.org>
Wed, 29 Jun 2011 16:37:18 +0000 (16:37 +0000)
committerRoland Häder <roland@mxchange.org>
Wed, 29 Jun 2011 16:37:18 +0000 (16:37 +0000)
inc/language/coupon_de.php
inc/modules/member/what-cash_coupon.php
templates/de/html/member/member_cash_coupon.tpl

index 41b1931a558d1359b0c2ad9200f246c35ff7a9b9..8b1546abb2cfe965f4f5cb70b2fddfd465303df3 100644 (file)
@@ -77,6 +77,12 @@ addMessages(array(
        'MEMBER_COUPON_CASHED_404' => "Sie haben noch keinen Gutschein eingel&ouml;st oder es wurde noch keiner erstellt. Bitte pr&uuml;fen Sie Ihre Emails, ob Sie eventuell einen erhalten haben, den Sie noch einl&ouml;sen k&ouml;nnen.",
        'MEMBER_LIST_CASHED_COUPONS_TITLE' => "Alle Ihre eingel&ouml;sten Gutscheine",
        'MEMBER_LIST_CASHED_COUPONS_NOTE' => "Bitte beachten Sie, dass Gutscheine nach <span class=\"data\">{%config,createFancyTime=coupon_autopurge_time%}</span> automatisch aus der Datenbank entfernt werden und Ihnen dann nicht mehr angezeigt werden. Das {?POINTS?}-Guthaben behalten Sie weiterhin.",
        'MEMBER_COUPON_CASHED_404' => "Sie haben noch keinen Gutschein eingel&ouml;st oder es wurde noch keiner erstellt. Bitte pr&uuml;fen Sie Ihre Emails, ob Sie eventuell einen erhalten haben, den Sie noch einl&ouml;sen k&ouml;nnen.",
        'MEMBER_LIST_CASHED_COUPONS_TITLE' => "Alle Ihre eingel&ouml;sten Gutscheine",
        'MEMBER_LIST_CASHED_COUPONS_NOTE' => "Bitte beachten Sie, dass Gutscheine nach <span class=\"data\">{%config,createFancyTime=coupon_autopurge_time%}</span> automatisch aus der Datenbank entfernt werden und Ihnen dann nicht mehr angezeigt werden. Das {?POINTS?}-Guthaben behalten Sie weiterhin.",
+       'MEMBER_COUPON_CHANGE_STATUS_TITLE' => "Empfang von Gutscheinen bestellen/abbestellen",
+       'MEMBER_COUPON_RECEIVE_STATUS' => "Sie empfangen derzeit Gutscheine:",
+       'MEMBER_CHANGE_COUPON_STATUS' => "Empfangsstatus &auml;ndern",
+       'MEMBER_COUPON_RECEIVE_STATUS_UNCHANGED' => "Es konnte der Empfang von Gutscheinen nicht ge&auml;ndert werden. Bitte melden Sie sich beim Support.",
+       'MEMBER_COUPON_RECEIVE_STATUS_UNSUBSCRIBED' => "Sie empfangen nun keine Gutscheine mehr.",
+       'MEMBER_COUPON_RECEIVE_STATUS_SUBSCRIBED' => "Sie empfangen nun wieder Gutscheine. Sie erhalten nun eine Email, sobald ein neuer Gutschein erstellt wurde.",
 
        // Subject lines
        'MEMBER_COUPON_SUBJECT' => "Gutschein bei {?MAIN_TITLE?}",
 
        // Subject lines
        'MEMBER_COUPON_SUBJECT' => "Gutschein bei {?MAIN_TITLE?}",
index ae1938a4281fb0a8e05265930ea41a8f0f86f541..da4e810d4b8c9d28ad6bac0363a8447c0c5c65f3 100644 (file)
@@ -147,6 +147,30 @@ LIMIT 1",
                // No code entered!
                displayMessage('{--MEMBER_COUPON_CODE_EMPTY--}');
        }
                // No code entered!
                displayMessage('{--MEMBER_COUPON_CODE_EMPTY--}');
        }
+} elseif (isFormSent('change')) {
+       // Change receive status, depending on its current state
+       if (getUserData('receiving_coupons') == 'Y') {
+               // Unsubscribe from coupons
+               $message = '{--MEMBER_COUPON_RECEIVE_STATUS_UNSUBSCRIBED--}';
+               $newStatus = 'N';
+       } else {
+               // Subscribe to coupons
+               $message = '{--MEMBER_COUPON_RECEIVE_STATUS_SUBSCRIBED--}';
+               $newStatus = 'Y';
+       }
+
+       // And change it in the database
+       SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `receiving_coupons`='%s' WHERE `userid`=%s LIMIT 1",
+               array($newStatus, getMemberId()), __FILE__, __LINE__);
+
+       // Did something change?
+       if (!SQL_HASZEROAFFECTED()) {
+               // Records have been updated
+               displayMessage($message);
+       } else {
+               // Nothing changed!
+               displayMessage('{--MEMBER_COUPON_RECEIVE_STATUS_UNCHANGED--}');
+       }
 } else {
        // Load form template
        loadTemplate('member_cash_coupon', false);
 } else {
        // Load form template
        loadTemplate('member_cash_coupon', false);
index f6c5a23fa2512d8f01a8105b83ce5e72be7f0ce4..4319de89aa92da7e580261cbc36ab3d672f94030 100644 (file)
@@ -4,6 +4,9 @@
        <div class="table_header bottom">
                <strong>{--MEMBER_CASH_COUPON_TITLE--}</strong>
        </div>
        <div class="table_header bottom">
                <strong>{--MEMBER_CASH_COUPON_TITLE--}</strong>
        </div>
+       <div class="para" style="padding-top:4px">
+               {--MEMBER_CASH_COUPON_NOTE--}
+       </div>
        <div class="bottom" style="height:23px;padding-top:4px">
                {--MEMBER_ENTER_COUPON_CODE--}
                <input type="text" class="form_field" name="coupon_code" size="30" maxlength="30" />
        <div class="bottom" style="height:23px;padding-top:4px">
                {--MEMBER_ENTER_COUPON_CODE--}
                <input type="text" class="form_field" name="coupon_code" size="30" maxlength="30" />
        </div>
 </div>
 </form>
        </div>
 </div>
 </form>
-</div>
 
 
-<div class="notice">
-       {--MEMBER_CASH_COUPON_NOTE--}
+<form accept-charset="UTF-8" id="form" action="{%url=modules.php?module=login&amp;what=cash_coupon%}" method="post">
+<div class="table dashed">
+       <div class="table_header bottom">
+               <strong>{--MEMBER_COUPON_CHANGE_STATUS_TITLE--}</strong>
+       </div>
+       <div class="bottom" style="height:18px;padding-top:4px">
+               {--MEMBER_COUPON_RECEIVE_STATUS--}
+               <strong>{%user,receiving_coupons,translateYesNo%}</strong>
+       </div>
+       <div class="table_footer">
+               <input type="submit" class="form_submit" name="change" value="{--MEMBER_CHANGE_COUPON_STATUS--}" />
+       </div>
+</div>
+</form>
 </div>
 </div>