]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/what-edit_sponsor.php
Project continued:
[mailer.git] / inc / modules / admin / what-edit_sponsor.php
index 0603a9dea73d4ad691d67a53e0870fa4f447250a..cf61c57c5851a020b3a590c50d29b32d2fdd7249 100644 (file)
@@ -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 *
 
 // Some security stuff...
 if ((!defined('__SECURITY')) || (!isAdmin())) {
-       die();
+       exit();
 } // END - if
 
 // Add description as navigation point
 addYouAreHereLink('admin', __FILE__);
 
-if ((isGetRequestElementSet('id')) && (isGetRequestElementSet('mode'))) {
+if ((isGetRequestElementSet('id')) && (isGetRequestElementSet('do'))) {
        // Check for selected sponsor
        $result_main = SQL_QUERY_ESC("SELECT
-       `id`,`company`,`position`,`gender`,`surname`,`family`,
-       `street_nr1`,`street_nr2`,`zip`,`city`,`country`,
-       `phone`,`fax`,`cell`,`email`,`url`,`tax_ident`,
-       `receive_warnings`,`warning_interval`
+       `id`, `company`, `position`, `gender`, `surname`, `family`,
+       `street_nr1`, `street_nr2`, `zip`, `city`, `country`,
+       `phone`, `fax`, `cell`, `email`, `url`, `tax_ident`,
+       `receive_warnings`, `warning_interval`
 FROM
        `{?_MYSQL_PREFIX?}_sponsor_data`
 WHERE
@@ -65,13 +65,13 @@ LIMIT 1",
                $content['warning_interval'] = createTimeSelections($content['warning_interval'], 'warning_interval', 'MWDh');
 
                // Init variables here
-               $TPL = sprintf("admin_edit_sponsor_%s", getRequestElement('mode'));
+               $TPL = sprintf("admin_edit_sponsor_%s", getRequestElement('do'));
                initSqls();
 
                // Sponsor was found
                if ((isFormSent()) || (isFormSent('edit'))) {
                        // Perform action on mode
-                       switch (getRequestElement('mode')) {
+                       switch (getRequestElement('do')) {
                                case 'add_points': // Add points
                                        if (bigintval(postRequestElement('points')) > 0) {
                                                // Replace german decimal comma with computer's decimal dot
@@ -119,17 +119,16 @@ LIMIT 1",
                                        break;
 
                                case 'edit': // Edit sponsor account
-                                       $PASS = true;
+                                       $PASS = TRUE;
                                        if ((postRequestElement('pass1') != postRequestElement('pass2')) || ((!isPostRequestElementSet('pass1')) && (!isPostRequestElementSet('pass1')))) {
                                                // Remove passwords
                                                unsetPostRequestElement('pass1');
                                                unsetPostRequestElement('pass2');
-                                               $PASS = false;
+                                               $PASS = FALSE;
                                        } // END - if
 
                                        // Convert time selection
-                                       $content = array(); $id = 'warning_interval_ye'; $skip = false;
-                                       convertSelectionsToEpocheTime(postRequestArray(), $content, $id, $skip);
+                                       convertSelectionsToEpocheTimeInPostData('warning_interval_ye');
 
                                        // Save the sponsor
                                        handleSponsorRequest(postRequestArray());
@@ -138,16 +137,16 @@ LIMIT 1",
                                        postRequestElement('gender'          , '{%pipe,translateGender=' . postRequestElement('gender') . '%}');
                                        postRequestElement('warning_interval', '{%pipe,createFancyTime=' . postRequestElement('warning_interval') . '%}');
 
-                                       if ($PASS === false) setPostRequestElement('pass1', '{--SPONSOR_PASS_UNCHANGED--}');
+                                       if ($PASS === FALSE) setPostRequestElement('pass1', '{--SPONSOR_PASS_UNCHANGED--}');
 
                                        // Load email template and send the mail away
-                                       $message = loadEmailTemplate('admin_sponsor_edit', postRequestArray(), false);
+                                       $message = loadEmailTemplate('admin_sponsor_edit', postRequestArray(), FALSE);
                                        sendEmail(postRequestElement('email'), '{--ADMIN_SPONSOR_EDIT_SUBJECT--}', $message);
                                        break;
 
                                default: // Unknown mode
-                                       logDebugMessage(__FILE__, __LINE__, sprintf("Unknown mode %s detected.", getRequestElement('mode')));
-                                       $message = '{%message,ADMIN_SPONSOR_INVALID_MODE=' . getRequestElement('mode') . '%}';
+                                       logDebugMessage(__FILE__, __LINE__, sprintf("Unknown mode %s detected.", getRequestElement('do')));
+                                       $message = '{%message,ADMIN_SPONSOR_INVALID_MODE=' . getRequestElement('do') . '%}';
                                        break;
                        }
 
@@ -160,10 +159,10 @@ LIMIT 1",
                        $content['contact'] = '<a href="' . generateSponsorEmailLink($content['email'], 'sponsor_data') . '">' . $content['surname'] . ' ' . $content['family'] . '</a>';
 
                        // Load mode template
-                       loadTemplate($TPL, false, $content);
+                       loadTemplate($TPL, FALSE, $content);
                } else {
                        // Template not found
-                       displayMessage('{%message,ADMIN_SPONSOR_MODUS_TPL_404', getRequestElement('mode') . '%}');
+                       displayMessage('{%message,ADMIN_SPONSOR_MODUS_TPL_404', getRequestElement('do') . '%}');
                }
        } else {
                // Sponsor not found