]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/what-list_sponsor.php
Renamed all SQL-related functions to camel-case notation
[mailer.git] / inc / modules / admin / what-list_sponsor.php
index bd9f8af319ed254e539c6985f8c110825054e027..ff5e1b1e88598cc62419fed4f55a75d361e3cc45 100644 (file)
@@ -45,7 +45,7 @@ addYouAreHereLink('admin', __FILE__);
 
 if (isGetRequestElementSet('id')) {
        // Show detailed informations to a sponsor
-       $result = SQL_QUERY_ESC("SELECT
+       $result = sqlQueryEscaped("SELECT
        `company`, `position`, `gender`, `surname`, `family`, `street_nr1`, `street_nr2`, `zip`, `city`, `country`,
        `phone`, `fax`, `cell`, `email`, `url`, `tax_ident`,
        `status`,
@@ -60,9 +60,9 @@ WHERE
        `id`=%s LIMIT 1",
        array(bigintval(getRequestElement('id'))), __FILE__, __LINE__);
 
-       if (SQL_NUMROWS($result) == 1) {
+       if (sqlNumRows($result) == 1) {
                // Load sponsor details
-               $content = SQL_FETCHARRAY($result);
+               $content = sqlFetchArray($result);
 
                // Check if an entry is empty
                foreach ($content as $k => $v) {
@@ -89,17 +89,17 @@ WHERE
        }
 
        // Free result
-       SQL_FREERESULT($result);
+       sqlFreeResult($result);
 } elseif (isGetRequestElementSet('refid')) {
        // Search for sponsor
-       $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_sponsor_data` WHERE `id`=%s LIMIT 1",
+       $result = sqlQueryEscaped("SELECT `id` FROM `{?_MYSQL_PREFIX?}_sponsor_data` WHERE `id`=%s LIMIT 1",
                array(bigintval(getRequestElement('refid'))), __FILE__, __LINE__);
-       if (SQL_NUMROWS($result) == 1) {
+       if (sqlNumRows($result) == 1) {
                // Free memory
-               SQL_FREERESULT($result);
+               sqlFreeResult($result);
 
                // Sponsor found so let's list all his referrals
-               $result = SQL_QUERY_ESC("SELECT
+               $result = sqlQueryEscaped("SELECT
        `id`,
        `gender`,
        `surname`,
@@ -120,10 +120,10 @@ ORDER BY
        `id` ASC",
                array(bigintval(getRequestElement('refid'))), __FILE__, __LINE__);
 
-               if (!SQL_HASZERONUMS($result)) {
+               if (!ifSqlHasZeroNums($result)) {
                        // List refs now
                        // Free memory
-                       SQL_FREERESULT($result);
+                       sqlFreeResult($result);
                } else {
                        // No refs made so far
                        displayMessage(getMaskedMessage('ADMIN_SPONSOR_REFS_404', '<a href="{%url=modules.php?module=admin&amp;what=list_sponsor&amp;id=' . bigintval(getRequestElement('refid')) . '%}">' . bigintval(getRequestElement('refid')) . '</a>'));
@@ -134,7 +134,7 @@ ORDER BY
        }
 } else {
        // List all sponsors
-       $result_main = SQL_QUERY("SELECT
+       $result_main = sqlQuery("SELECT
        `id`, `gender`, `surname`, `family`, `email`, `status`,
        UNIX_TIMESTAMP(`sponsor_created`) AS `sponsor_created`,
        UNIX_TIMESTAMP(`last_online`) AS `last_online`,
@@ -146,10 +146,10 @@ FROM
 ORDER BY
        `id` ASC", __FILE__, __LINE__);
 
-       if (!SQL_HASZERONUMS($result_main)) {
+       if (!ifSqlHasZeroNums($result_main)) {
                // At least one sponsor found
                $OUT = '';
-               while ($content = SQL_FETCHARRAY($result_main)) {
+               while ($content = sqlFetchArray($result_main)) {
                        // Transfer data to array
                        $content['email']           = generateEmailLink($content['email'], 'sponsor_data');
                        $content['sponsor_created'] = generateDateTime($content['sponsor_created'], 2);
@@ -160,7 +160,7 @@ ORDER BY
                } // END - while
 
                // Free memory
-               SQL_FREERESULT($result_main);
+               sqlFreeResult($result_main);
 
                // Load final template
                loadTemplate('admin_list_sponsor', FALSE, $OUT);