]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/what-list_rallye_prices.php
Renamed all SQL-related functions to camel-case notation
[mailer.git] / inc / modules / admin / what-list_rallye_prices.php
index 04e46651615f966495e9222978f3756c753691b3..4813e1e360ec1f8feaac88ccc37215282bacad19 100644 (file)
@@ -48,12 +48,12 @@ if (isGetRequestElementSet('rallye_id')) {
        if (isFormSent('add')) {
                if ((isPostRequestElementSet('level')) && ((isPostRequestElementSet('points')) || (isPostRequestElementSet('info')))) {
                        // Submitted data is valid, but maybe we already have this price level?
-                       $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_rallye_prices` WHERE `rallye_id`=%s AND `price_level`='%s' LIMIT 1",
+                       $result = sqlQueryEscaped("SELECT `id` FROM `{?_MYSQL_PREFIX?}_rallye_prices` WHERE `rallye_id`=%s AND `price_level`='%s' LIMIT 1",
                        array(bigintval(getRequestElement('rallye_id')), bigintval(postRequestElement('level'))), __FILE__, __LINE__);
 
-                       if (SQL_HASZERONUMS($result)) {
+                       if (ifSqlHasZeroNums($result)) {
                                // Ok, new price level entered!
-                               SQL_QUERY_ESC("INSERT INTO
+                               sqlQueryEscaped("INSERT INTO
        `{?_MYSQL_PREFIX?}_rallye_prices`
 (`rallye_id`, `price_level`, `points`, `info`)
        VALUES
@@ -67,7 +67,7 @@ if (isGetRequestElementSet('rallye_id')) {
                                displayMessage('{--ADMIN_RALLYE_PRICE_LEVEL_SAVED--}');
                        } else {
                                // Free memory
-                               SQL_FREERESULT($result);
+                               sqlFreeResult($result);
 
                                // Price level found
                                displayMessage('{--ADMIN_RALLYE_PRICE_ALREADY_FOUND--}');
@@ -78,7 +78,7 @@ if (isGetRequestElementSet('rallye_id')) {
                if (ifPostContainsSelections()) {
                        // Delete selected entries
                        foreach (postRequestElement('sel') as $id => $sel) {
-                               SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_rallye_prices` WHERE `id`=%s LIMIT 1",
+                               sqlQueryEscaped("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_rallye_prices` WHERE `id`=%s LIMIT 1",
                                        array(bigintval($id)), __FILE__, __LINE__);
                        } // END - foreach
 
@@ -94,7 +94,7 @@ if (isGetRequestElementSet('rallye_id')) {
                        $id = bigintval($id);
 
                        // Update entry
-                       SQL_QUERY_ESC("UPDATE
+                       sqlQueryEscaped("UPDATE
        `{?_MYSQL_PREFIX?}_rallye_prices`
 SET
        `rallye_id`=%s,
@@ -124,7 +124,7 @@ LIMIT 1",
                        $OUT = '';
                        foreach (postRequestElement('sel') as $id => $sel) {
                                // Load data to selected rallye
-                               $result = SQL_QUERY_ESC("SELECT
+                               $result = sqlQueryEscaped("SELECT
        `id`,
        `rallye_id`,
        `price_level`,
@@ -138,10 +138,10 @@ LIMIT 1",
                                        array(bigintval($id)), __FILE__, __LINE__);
 
                                // Fetch data
-                               $content = SQL_FETCHARRAY($result);
+                               $content = sqlFetchArray($result);
 
                                // Free result
-                               SQL_FREERESULT($result);
+                               sqlFreeResult($result);
 
                                // Add more content
                                $content['rallye_content'] = generateOptions('rallye_data', 'id', 'title', $content['rallye_id']);
@@ -169,7 +169,7 @@ LIMIT 1",
                        $OUT = '';
                        foreach (postRequestElement('sel') as $id => $sel) {
                                // Load data to selected rallye
-                               $result = SQL_QUERY_ESC("SELECT
+                               $result = sqlQueryEscaped("SELECT
        `id`,
        `rallye_id`,
        `price_level`,
@@ -183,10 +183,10 @@ LIMIT 1",
                                        array(bigintval($id)), __FILE__, __LINE__);
 
                                // Fetch data
-                               $content = SQL_FETCHARRAY($result);
+                               $content = sqlFetchArray($result);
 
                                // Free result
-                               SQL_FREERESULT($result);
+                               sqlFreeResult($result);
 
                                // Load row template and switch color
                                $OUT .= loadTemplate('admin_delete_rallye_prices_row', TRUE, $content);
@@ -205,19 +205,19 @@ LIMIT 1",
                }
        } else {
                // A rallye was selected, so check if there are already prices assigned...
-               $result = SQL_QUERY_ESC("SELECT `id`, `price_level`, `points`, `info` FROM `{?_MYSQL_PREFIX?}_rallye_prices` WHERE `rallye_id`=%s ORDER BY `price_level` ASC",
+               $result = sqlQueryEscaped("SELECT `id`, `price_level`, `points`, `info` FROM `{?_MYSQL_PREFIX?}_rallye_prices` WHERE `rallye_id`=%s ORDER BY `price_level` ASC",
                        array(bigintval(getRequestElement('rallye_id'))), __FILE__, __LINE__);
 
-               if (!SQL_HASZERONUMS($result)) {
+               if (!ifSqlHasZeroNums($result)) {
                        // Load all prices for the selected rallye
                        $OUT = '';
-                       while ($content = SQL_FETCHARRAY($result)) {
+                       while ($content = sqlFetchArray($result)) {
                                // Load row template and switch color
                                $OUT .= loadTemplate('admin_list_rallye_prices_simple_row', TRUE, $content);
                        } // END - while
 
                        // Free memory
-                       SQL_FREERESULT($result);
+                       sqlFreeResult($result);
 
                        // @TODO Rewrite these two constants
                        $content['rows'] = $OUT;
@@ -236,7 +236,7 @@ LIMIT 1",
        } // END - if
 } else {
        // No rallye selected so display all available without prices
-       $result = SQL_QUERY("SELECT
+       $result = sqlQuery("SELECT
        `d`.`id` AS `rallye_id`,
        `d`.`admin_id`,
        `d`.`start_time`,
@@ -252,10 +252,10 @@ ON
        `d`.`admin_id`=`a`.`id`
 ORDER BY
        `d`.`start_time` DESC", __FILE__, __LINE__);
-       if (!SQL_HASZERONUMS($result)) {
+       if (!ifSqlHasZeroNums($result)) {
                // List found rallyes
                $OUT = '';
-               while ($content = SQL_FETCHARRAY($result)) {
+               while ($content = sqlFetchArray($result)) {
                        // Prepare data for the row template
                        $content['start_time'] = generateDateTime($content['start_time'], '3');
                        $content['end_time']   = generateDateTime($content['end_time']  , '3');
@@ -265,7 +265,7 @@ ORDER BY
                } // END - while
 
                // Free memory
-               SQL_FREERESULT($result);
+               sqlFreeResult($result);
 
                // Load main template
                loadTemplate('admin_list_rallye_prices', FALSE, $OUT);