]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/what-edit_sponsor.php
Updated copyright year.
[mailer.git] / inc / modules / admin / what-edit_sponsor.php
index c377966e43b41486ec5d54d47a06067425a6e095..88a4e1000c4d7d3c1852633a527c1c2e2ccb0d59 100644 (file)
@@ -16,7 +16,7 @@
  * $Author::                                                          $ *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
- * Copyright (c) 2009 - 2012 by Mailer Developer Team                   *
+ * Copyright (c) 2009 - 2016 by Mailer Developer Team                   *
  * For more information visit: http://mxchange.org                      *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
@@ -45,7 +45,7 @@ addYouAreHereLink('admin', __FILE__);
 
 if ((isGetRequestElementSet('id')) && (isGetRequestElementSet('do'))) {
        // Check for selected sponsor
-       $result_main = SQL_QUERY_ESC("SELECT
+       $result_main = sqlQueryEscaped("SELECT
        `id`, `company`, `position`, `gender`, `surname`, `family`,
        `street_nr1`, `street_nr2`, `zip`, `city`, `country`,
        `phone`, `fax`, `cell`, `email`, `url`, `tax_ident`,
@@ -56,16 +56,16 @@ WHERE
        `id`=%s
 LIMIT 1",
                array(bigintval(getRequestElement('id'))), __FILE__, __LINE__);
-       if (SQL_NUMROWS($result_main) == 1) {
+       if (sqlNumRows($result_main) == 1) {
                // Load sponsor details
-               $content = SQL_FETCHARRAY($result_main);
+               $content = sqlFetchArray($result_main);
 
                //  Warning because low points
                $content['receive_warnings'] = addSelectionBox('yn', $content['receive_warnings'], 'receive_warning');
                $content['warning_interval'] = createTimeSelections($content['warning_interval'], 'warning_interval', 'MWDh');
 
                // Init variables here
-               $TPL = sprintf("admin_edit_sponsor_%s", getRequestElement('do'));
+               $TPL = sprintf('admin_edit_sponsor_%s', getRequestElement('do'));
                initSqls();
 
                // Sponsor was found
@@ -78,8 +78,12 @@ LIMIT 1",
                                                $points = bigintval(convertCommaToDot(postRequestElement('points')));
 
                                                // Add points to account
-                                               SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_sponsor_data` SET `points_amount`=`points_amount`+%s WHERE `id`=%s LIMIT 1",
-                                                       array($points, bigintval(getRequestElement('id'))), __FILE__, __LINE__);
+                                               sqlQueryEscaped("UPDATE `{?_MYSQL_PREFIX?}_sponsor_data` SET `points_amount`=`points_amount`+%s WHERE `id`=%s LIMIT 1",
+                                                       array(
+                                                               $points,
+                                                               bigintval(getRequestElement('id'))
+                                                       ), __FILE__, __LINE__
+                                               );
 
                                                // Remember points /reason for the template
                                                $content['points'] = $points;
@@ -101,7 +105,7 @@ LIMIT 1",
                                                $points = bigintval(convertCommaToDot(postRequestElement('points')));
 
                                                // Add points to account
-                                               SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_sponsor_data` SET `points_used`=`points_used`+%s WHERE `id`=%s LIMIT 1",
+                                               sqlQueryEscaped("UPDATE `{?_MYSQL_PREFIX?}_sponsor_data` SET `points_used`=`points_used`+%s WHERE `id`=%s LIMIT 1",
                                                        array($points, bigintval(getRequestElement('id'))), __FILE__, __LINE__);
 
                                                // Remember points /reason for the template
@@ -145,16 +149,16 @@ LIMIT 1",
                                        break;
 
                                default: // Unknown mode
-                                       logDebugMessage(__FILE__, __LINE__, sprintf("Unknown mode %s detected.", getRequestElement('do')));
+                                       logDebugMessage(__FILE__, __LINE__, sprintf('Unknown mode %s detected.', getRequestElement('do')));
                                        $message = '{%message,ADMIN_SPONSOR_INVALID_MODE=' . getRequestElement('do') . '%}';
                                        break;
-                       }
+                       } // END - switch
 
                        if (!empty($message)) {
                                // Output message
                                displayMessage($message);
                        } // END - if
-               } elseif (isFileReadable(sprintf("%stemplates/%s/html/admin/%s.tpl", getPath(), getLanguage(), $TPL))) {
+               } elseif (isFileReadable(sprintf('%s/admin/%s.tpl', getTemplateBasePath('html'), $TPL))) {
                        // Create mailto link
                        $content['contact'] = '<a href="' . generateSponsorEmailLink($content['email'], 'sponsor_data') . '">' . $content['surname'] . ' ' . $content['family'] . '</a>';
 
@@ -170,7 +174,7 @@ LIMIT 1",
        }
 
        // Free result
-       SQL_FREERESULT($result_main);
+       sqlFreeResult($result_main);
 } else {
        // Not called by what-list_sponsor.php
        displayMessage('{--ADMIN_CALL_NOT_DIRECTLY--}');